Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor runPrompt usage and remove fetchText and cancel from import prompts #700

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/core/src/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/core/src/importprompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
"host",
"workspace",
"path",
"parsers",
"env",
"retrieval",
"fetchText",
"cancel",
"runPrompt",

Check failure on line 26 in packages/core/src/importprompt.ts

View workflow job for this annotation

GitHub Actions / build

The functions `fetchText` and `cancel` have been removed. If these functions are being used elsewhere in the code, this could lead to undefined function errors. Please ensure that these functions are either not being used elsewhere, or that appropriate replacements have been provided. 🕵️‍♀️
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions fetchText and cancel have been removed. If these functions are being used elsewhere in the code, this could lead to undefined function errors. Please ensure that these functions are either not being used elsewhere, or that appropriate replacements have been provided. 🕵️‍♀️

generated by pr-review-commit removed_functions

]

const oldGlb: any = {}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/types/prompt_template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1555,9 +1555,13 @@
): void
defFileOutput(
pattern: string,
description?: string,
options?: FileOutputOptions
): void
runPrompt(
generator: string | PromptGenerator,
options?: PromptGeneratorOptions
): Promise<RunPromptResult>

Check failure on line 1564 in packages/core/src/types/prompt_template.d.ts

View workflow job for this annotation

GitHub Actions / build

The function `runPrompt` has been added to the `ChatGenerationContext` interface. If this function is not implemented in all classes that implement this interface, this could lead to unimplemented function errors. Please ensure that this function is implemented in all classes that use this interface. 🚀
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function runPrompt has been added to the ChatGenerationContext interface. If this function is not implemented in all classes that implement this interface, this could lead to unimplemented function errors. Please ensure that this function is implemented in all classes that use this interface. 🚀

generated by pr-review-commit added_function

}

interface GenerationOutput {
Expand Down Expand Up @@ -2256,17 +2260,13 @@
* Force disconnect network
*/
disconnect(): Promise<void>
}

interface PromptContext extends ChatGenerationContext {
script(options: PromptArgs): void
system(options: PromptSystemArgs): void
defFileMerge(fn: FileMergeHandler): void
defOutputProcessor(fn: PromptOutputProcessorHandler): void

Check failure on line 2269 in packages/core/src/types/prompt_template.d.ts

View workflow job for this annotation

GitHub Actions / build

The function `runPrompt` has been removed from the `PromptContext` interface. If this function is being used in any implementations of this interface, this could lead to undefined function errors. Please ensure that this function is either not being used in any implementations, or that an appropriate replacement has been provided. 🧐
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function runPrompt has been removed from the PromptContext interface. If this function is being used in any implementations of this interface, this could lead to undefined function errors. Please ensure that this function is either not being used in any implementations, or that an appropriate replacement has been provided. 🧐

generated by pr-review-commit removed_function

runPrompt(
generator: string | PromptGenerator,
options?: PromptGeneratorOptions
): Promise<RunPromptResult>
env: ExpansionVariables
path: Path
parsers: Parsers
Expand Down
8 changes: 4 additions & 4 deletions packages/sample/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sample/genaisrc/llm-as-expert.genai.mts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defTool(
},
},
async ({ prompt }) => {
const res = await runPrompt(prompt, {
const res = await env.generator.runPrompt(prompt, {
model: "openai:gpt-3.5-turbo",
label: "llm-gpt35",
})
Expand All @@ -62,7 +62,7 @@ defTool(
},
},
async ({ prompt }) => {
const res = await runPrompt(prompt, {
const res = await env.generator.runPrompt(prompt, {
model: "openai:gpt-4o",
label: "llm-4o",
})
Expand Down
8 changes: 4 additions & 4 deletions packages/sample/genaisrc/node/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sample/genaisrc/pr-create.genai.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ script({
})

const defaultBranch = (env.vars.defaultBranch || "main") + ""
const { text, finishReason, error } = await runPrompt(async (_) => {
const { text, error } = await runPrompt(async (_) => {
const { stdout: changes } = await host.exec("git", [
"diff",
defaultBranch,
Expand Down
8 changes: 4 additions & 4 deletions packages/sample/genaisrc/python/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/genaisrc/style/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/src/aici/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/src/errors/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/src/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/src/makecode/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/src/tla/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sample/src/vision/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions slides/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.