From 26c2e431ce5d9612d7500ea708bdb856b400da76 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 20 Jun 2024 19:11:20 +0000 Subject: [PATCH 1/5] support response_type in runprompt --- demo/genaisrc/genaiscript.d.ts | 12 ++++++------ docs/genaisrc/genaiscript.d.ts | 12 ++++++------ genaisrc/genaiscript.d.ts | 12 ++++++------ packages/core/src/genaisrc/genaiscript.d.ts | 12 ++++++------ packages/core/src/types/prompt_template.d.ts | 12 ++++++------ packages/sample/genaisrc/genaiscript.d.ts | 12 ++++++------ packages/sample/genaisrc/node/genaiscript.d.ts | 12 ++++++------ packages/sample/genaisrc/python/genaiscript.d.ts | 12 ++++++------ packages/sample/genaisrc/style/genaiscript.d.ts | 12 ++++++------ packages/sample/genaisrc/style/runprompt.genai.js | 15 +++++++++++++++ packages/sample/src/aici/genaiscript.d.ts | 12 ++++++------ packages/sample/src/errors/genaiscript.d.ts | 12 ++++++------ packages/sample/src/makecode/genaiscript.d.ts | 12 ++++++------ packages/sample/src/tla/genaiscript.d.ts | 12 ++++++------ packages/sample/src/vision/genaiscript.d.ts | 12 ++++++------ slides/genaisrc/genaiscript.d.ts | 12 ++++++------ 16 files changed, 105 insertions(+), 90 deletions(-) create mode 100644 packages/sample/genaisrc/style/runprompt.genai.js diff --git a/demo/genaisrc/genaiscript.d.ts b/demo/genaisrc/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/demo/genaisrc/genaiscript.d.ts +++ b/demo/genaisrc/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/docs/genaisrc/genaiscript.d.ts b/docs/genaisrc/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/docs/genaisrc/genaiscript.d.ts +++ b/docs/genaisrc/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/genaisrc/genaiscript.d.ts b/genaisrc/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/genaisrc/genaiscript.d.ts +++ b/genaisrc/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/core/src/genaisrc/genaiscript.d.ts b/packages/core/src/genaisrc/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/core/src/genaisrc/genaiscript.d.ts +++ b/packages/core/src/genaisrc/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index fe672865f9..71da05e1e9 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -173,12 +179,6 @@ interface ScriptRuntimeOptions { tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/genaisrc/genaiscript.d.ts b/packages/sample/genaisrc/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/genaisrc/genaiscript.d.ts +++ b/packages/sample/genaisrc/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/genaisrc/node/genaiscript.d.ts b/packages/sample/genaisrc/node/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/genaisrc/node/genaiscript.d.ts +++ b/packages/sample/genaisrc/node/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/genaisrc/python/genaiscript.d.ts b/packages/sample/genaisrc/python/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/genaisrc/python/genaiscript.d.ts +++ b/packages/sample/genaisrc/python/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/genaisrc/style/genaiscript.d.ts b/packages/sample/genaisrc/style/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/genaisrc/style/genaiscript.d.ts +++ b/packages/sample/genaisrc/style/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/genaisrc/style/runprompt.genai.js b/packages/sample/genaisrc/style/runprompt.genai.js new file mode 100644 index 0000000000..ce7524345b --- /dev/null +++ b/packages/sample/genaisrc/style/runprompt.genai.js @@ -0,0 +1,15 @@ +script({ + model: "openai:gpt-3.5-turbo", + tests: {} +}) + +const res = await runPrompt(_ => { + _.$`generate 3 random numbers between 1 and 10 and respond in JSON` +}, { + model: "openai:gpt-3.5-turbo", + responseType: "json_object" +}) + +$`Is this JSON? + +${res.text}` \ No newline at end of file diff --git a/packages/sample/src/aici/genaiscript.d.ts b/packages/sample/src/aici/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/src/aici/genaiscript.d.ts +++ b/packages/sample/src/aici/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/src/errors/genaiscript.d.ts b/packages/sample/src/errors/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/src/errors/genaiscript.d.ts +++ b/packages/sample/src/errors/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/src/makecode/genaiscript.d.ts b/packages/sample/src/makecode/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/src/makecode/genaiscript.d.ts +++ b/packages/sample/src/makecode/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/src/tla/genaiscript.d.ts b/packages/sample/src/tla/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/src/tla/genaiscript.d.ts +++ b/packages/sample/src/tla/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/packages/sample/src/vision/genaiscript.d.ts b/packages/sample/src/vision/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/packages/sample/src/vision/genaiscript.d.ts +++ b/packages/sample/src/vision/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ diff --git a/slides/genaisrc/genaiscript.d.ts b/slides/genaisrc/genaiscript.d.ts index 37944cb354..135b8f61de 100644 --- a/slides/genaisrc/genaiscript.d.ts +++ b/slides/genaisrc/genaiscript.d.ts @@ -128,6 +128,12 @@ interface ModelOptions extends ModelConnectionOptions { */ temperature?: number + /** + * Specifies the type of output. Default is `markdown`. Use `responseSchema` to + * specify an output schema. + */ + responseType?: PromptTemplateResponseType + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -207,12 +213,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * Specifies the type of output. Default is `markdown`. Use `responseSchema` to - * specify an output schema. - */ - responseType?: PromptTemplateResponseType - /** * JSON object schema for the output. Enables the `JSON` output mode. */ From bdebe9957bfaa2f493e25d5a6b7abc15db0a0862 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 20 Jun 2024 19:13:10 +0000 Subject: [PATCH 2/5] avoid some error codes --- packages/sample/genaisrc/pr-review-commit.genai.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sample/genaisrc/pr-review-commit.genai.js b/packages/sample/genaisrc/pr-review-commit.genai.js index bdc2d6c90c..65759b3d7e 100644 --- a/packages/sample/genaisrc/pr-review-commit.genai.js +++ b/packages/sample/genaisrc/pr-review-commit.genai.js @@ -46,4 +46,5 @@ Think step by step and for each annotation explain your result. - do NOT cross-reference annotations, assume they are all independent - read the full source code of the files if you need more context - only report issues about code in GIT_DIFF +- do NOT report issues for the following code: missing_coma, ` From aad6b971f0a8df39499ea9ee3714e291766b0d6c Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 20 Jun 2024 19:22:43 +0000 Subject: [PATCH 3/5] move responseSchema as well --- demo/genaisrc/genaiscript.d.ts | 16 +++++++++++----- docs/genaisrc/genaiscript.d.ts | 16 +++++++++++----- genaisrc/genaiscript.d.ts | 16 +++++++++++----- packages/core/src/genaisrc/genaiscript.d.ts | 16 +++++++++++----- packages/core/src/types/prompt_template.d.ts | 14 ++++++++++---- packages/sample/genaisrc/genaiscript.d.ts | 16 +++++++++++----- packages/sample/genaisrc/node/genaiscript.d.ts | 16 +++++++++++----- packages/sample/genaisrc/python/genaiscript.d.ts | 16 +++++++++++----- packages/sample/genaisrc/style/genaiscript.d.ts | 16 +++++++++++----- packages/sample/src/aici/genaiscript.d.ts | 16 +++++++++++----- packages/sample/src/errors/genaiscript.d.ts | 16 +++++++++++----- packages/sample/src/makecode/genaiscript.d.ts | 16 +++++++++++----- packages/sample/src/tla/genaiscript.d.ts | 16 +++++++++++----- packages/sample/src/vision/genaiscript.d.ts | 16 +++++++++++----- slides/genaisrc/genaiscript.d.ts | 16 +++++++++++----- 15 files changed, 164 insertions(+), 74 deletions(-) diff --git a/demo/genaisrc/genaiscript.d.ts b/demo/genaisrc/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/demo/genaisrc/genaiscript.d.ts +++ b/demo/genaisrc/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/docs/genaisrc/genaiscript.d.ts b/docs/genaisrc/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/docs/genaisrc/genaiscript.d.ts +++ b/docs/genaisrc/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/genaisrc/genaiscript.d.ts b/genaisrc/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/genaisrc/genaiscript.d.ts +++ b/genaisrc/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/core/src/genaisrc/genaiscript.d.ts b/packages/core/src/genaisrc/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/core/src/genaisrc/genaiscript.d.ts +++ b/packages/core/src/genaisrc/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index 71da05e1e9..79f5aa4b3a 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,14 +180,15 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ system?: SystemPromptId[] - tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. + * List of tools used by the prompt. */ - responseSchema?: JSONSchemaObject + tools?: SystemToolId[] /** * Secrets required by the prompt diff --git a/packages/sample/genaisrc/genaiscript.d.ts b/packages/sample/genaisrc/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/genaisrc/genaiscript.d.ts +++ b/packages/sample/genaisrc/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/genaisrc/node/genaiscript.d.ts b/packages/sample/genaisrc/node/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/genaisrc/node/genaiscript.d.ts +++ b/packages/sample/genaisrc/node/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/genaisrc/python/genaiscript.d.ts b/packages/sample/genaisrc/python/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/genaisrc/python/genaiscript.d.ts +++ b/packages/sample/genaisrc/python/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/genaisrc/style/genaiscript.d.ts b/packages/sample/genaisrc/style/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/genaisrc/style/genaiscript.d.ts +++ b/packages/sample/genaisrc/style/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/src/aici/genaiscript.d.ts b/packages/sample/src/aici/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/src/aici/genaiscript.d.ts +++ b/packages/sample/src/aici/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/src/errors/genaiscript.d.ts b/packages/sample/src/errors/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/src/errors/genaiscript.d.ts +++ b/packages/sample/src/errors/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/src/makecode/genaiscript.d.ts b/packages/sample/src/makecode/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/src/makecode/genaiscript.d.ts +++ b/packages/sample/src/makecode/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/src/tla/genaiscript.d.ts b/packages/sample/src/tla/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/src/tla/genaiscript.d.ts +++ b/packages/sample/src/tla/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/packages/sample/src/vision/genaiscript.d.ts b/packages/sample/src/vision/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/packages/sample/src/vision/genaiscript.d.ts +++ b/packages/sample/src/vision/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ diff --git a/slides/genaisrc/genaiscript.d.ts b/slides/genaisrc/genaiscript.d.ts index 135b8f61de..6df4e35eaa 100644 --- a/slides/genaisrc/genaiscript.d.ts +++ b/slides/genaisrc/genaiscript.d.ts @@ -134,6 +134,11 @@ interface ModelOptions extends ModelConnectionOptions { */ responseType?: PromptTemplateResponseType + /** + * JSON object schema for the output. Enables the `JSON` output mode. + */ + responseSchema?: JSONSchemaObject + /** * “Top_p” or nucleus sampling is a setting that decides how many possible words to consider. * A high “top_p” value means the model looks at more possible words, even the less likely ones, @@ -175,6 +180,9 @@ interface ModelOptions extends ModelConnectionOptions { } interface ScriptRuntimeOptions { + /** + * List of system script ids used by the prompt. + */ /** * System prompt identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/system/)) * - `system`: Base system prompt @@ -201,6 +209,9 @@ interface ScriptRuntimeOptions { **/ system?: SystemPromptId[] + /** + * List of tools used by the prompt. + */ /** * System tool identifiers ([reference](https://microsoft.github.io/genaiscript/reference/scripts/tools/)) * - `fs_find_files`: Finds file matching a glob pattern. @@ -213,11 +224,6 @@ interface ScriptRuntimeOptions { **/ tools?: SystemToolId[] - /** - * JSON object schema for the output. Enables the `JSON` output mode. - */ - responseSchema?: JSONSchemaObject - /** * Secrets required by the prompt */ From 3e8fe1534e105453378100d8ba44e610a5329d65 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 20 Jun 2024 19:23:44 +0000 Subject: [PATCH 4/5] updaed ignore comments --- packages/sample/genaisrc/pr-review-commit.genai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sample/genaisrc/pr-review-commit.genai.js b/packages/sample/genaisrc/pr-review-commit.genai.js index 65759b3d7e..ed683b34a6 100644 --- a/packages/sample/genaisrc/pr-review-commit.genai.js +++ b/packages/sample/genaisrc/pr-review-commit.genai.js @@ -46,5 +46,5 @@ Think step by step and for each annotation explain your result. - do NOT cross-reference annotations, assume they are all independent - read the full source code of the files if you need more context - only report issues about code in GIT_DIFF -- do NOT report issues for the following code: missing_coma, +- do NOT report issues for the following code: missing_coma, missing_comment, missing_blank_line ` From 4dcb458af9304da394ce0964fc428f5f40ef1e59 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 20 Jun 2024 19:25:52 +0000 Subject: [PATCH 5/5] more describe options --- packages/sample/genaisrc/pr-describe.genai.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/sample/genaisrc/pr-describe.genai.js b/packages/sample/genaisrc/pr-describe.genai.js index 0c4326c936..39c71875ff 100644 --- a/packages/sample/genaisrc/pr-describe.genai.js +++ b/packages/sample/genaisrc/pr-describe.genai.js @@ -1,6 +1,7 @@ script({ model: "openai:gpt-4-32k", files: [], + temperature: 1, title: "pr-describe", system: ["system", "system.fs_find_files", "system.fs_read_file"], }) @@ -28,6 +29,7 @@ $`You are an expert software developer and architect. ## Instructions +- do NOT explain that GIT_DIFF displays changes in the codebase - try to extract the intent of the changes, don't focus on the details - use bullet points to list the changes - use emojis to make the description more engaging