Skip to content

Commit

Permalink
support response_type in runprompt (#556)
Browse files Browse the repository at this point in the history
* support response_type in runprompt

* avoid some error codes

* move responseSchema as well

* updaed ignore comments

* more describe options
  • Loading branch information
pelikhan committed Jun 20, 2024
1 parent bf875d4 commit 931ba7f
Show file tree
Hide file tree
Showing 18 changed files with 271 additions and 163 deletions.
28 changes: 17 additions & 11 deletions demo/genaisrc/genaiscript.d.ts

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

28 changes: 17 additions & 11 deletions docs/genaisrc/genaiscript.d.ts

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

28 changes: 17 additions & 11 deletions genaisrc/genaiscript.d.ts

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

28 changes: 17 additions & 11 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.

24 changes: 15 additions & 9 deletions packages/core/src/types/prompt_template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ interface ModelOptions extends ModelConnectionOptions {
*/
temperature?: number

/**
* 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.
*/
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,
Expand Down Expand Up @@ -169,20 +180,15 @@ interface ModelOptions extends ModelConnectionOptions {
}

interface ScriptRuntimeOptions {
system?: SystemPromptId[]

tools?: SystemToolId[]

/**
* Specifies the type of output. Default is `markdown`. Use `responseSchema` to
* specify an output schema.
* List of system script ids used by the prompt.
*/
responseType?: PromptTemplateResponseType
system?: SystemPromptId[]

/**
* 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
Expand Down
28 changes: 17 additions & 11 deletions packages/sample/genaisrc/genaiscript.d.ts

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

28 changes: 17 additions & 11 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: 2 additions & 0 deletions packages/sample/genaisrc/pr-describe.genai.js
Original file line number Diff line number Diff line change
@@ -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"],
})
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 931ba7f

Please sign in to comment.