Skip to content

Commit

Permalink
bettering
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Jan 14, 2024
1 parent 1734ba4 commit e46acc3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions backend/files/etc/www/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ The resolver will not resolve hidden files or folders, implying files and folder
you to create _"private"_ folders where you store _"reusable component"_ types of files that you use as your own
mixin components from your Hyperlambda code using the **[io.file.mixin]** slot.

If you add a file extention to your request, and your extention is not _".html"_, the resolver will try to resolve
If you add a file extension to your request, and your extension is not _".html"_, the resolver will try to resolve
your request as a static file request, and returning the file as a static resource. The MIME type a statically rendered
file is served with depends upon its file extention, and can be seen using **[mime.list]**. Notice, if you have
file is served with depends upon its file extension, and can be seen using **[mime.list]**. Notice, if you have
an HTML file that does _not_ have an associated Hyperlambda codebehind file, the file will be served as a static
resource, and not dynamically rendered.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ try
cached:int:1
auth:guest,root
greeting:Hi there, how can I help you?
system_message:You are a helpful assistant. If I ask you to create code for me, then return only the code and no explanation without any Markdown or ``` characters .
system_message:You are a helpful assistant. If I ask you to create code for me, then return only the code and no explanation without any Markdown or ``` characters. If I ask you to modify my existing code, then modify my last code according to my instructions and return the entire modified code back to me.

.catch

Expand Down
2 changes: 1 addition & 1 deletion backend/files/system/openai/upload-training-data.post.hl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ strings.split:x:@.arguments/*/file/*/name
.:.
strings.to-lower:x:@strings.split/0/-

// Converting file to lambda object according to its extention.
// Converting file to lambda object according to its extension.
switch:x:@strings.to-lower

// ZIP file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { OpenAIConfigurationDialogComponent } from 'src/app/components/protected
})
export class OpenAIPromptComponent implements OnInit {

@Input() currentFileData: any;
@Input() currentFileContent: string;
@Input() currentFileSession: string;
@Input() fileType: string;
@Output() callback? = new EventEmitter<string>();
@Input() callbackText?: string = null;
Expand Down Expand Up @@ -109,15 +110,15 @@ export class OpenAIPromptComponent implements OnInit {
this.generalService.showLoading();
this.waitingForAnswer = true;

let currentFileContent = this.currentFileData?.content;
let currentFileContent = this.currentFileContent;
if (currentFileContent && currentFileContent.length > 0) {
currentFileContent = '[CURRENT_CONTENT]\r\n\r\n' + currentFileContent;
currentFileContent = currentFileContent;
}
this.openAiService.query(
this.openAiPrompt,
this.fileType,
false,
this.currentFileData?.path,
this.currentFileSession,
null,
currentFileContent).subscribe({
next: (result: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ <h3 class="my-0 fw-bold">Hyper IDE</h3>
(callback)="insertFromOpenAI($event)"
callbackText="Use"
dialogue="false"
[currentFileData]="currentFileData"
[currentFileContent]="currentFileData.content"
[currentFileSession]="currentFileData.path"
[fileType]="fileType()"
class="w-100">
</app-openai-prompt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ <h3 class="my-0 fw-bold">SQL</h3>
fileType="sql"
(callback)="insertFromOpenAI($event)"
callbackText="Use"
[currentFileContent]="input.sql"
currentFileSession="sql-studio.editor"
class="w-100">
</app-openai-prompt>

Expand Down

0 comments on commit e46acc3

Please sign in to comment.