-
Notifications
You must be signed in to change notification settings - Fork 126
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
support for system prompts in runPrompt #622
Conversation
@@ -8,7 +8,7 @@ import { | |||
CancellationToken, | |||
checkCancelled, | |||
} from "./cancellation" | |||
import { assert, logError } from "./util" | |||
import { assert, logError, logVerbose } from "./util" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import 'logVerbose'. If it's not being used, it should be removed.
generated by pr-review-commit
unused_import
@@ -27,15 +27,16 @@ import { | |||
} from "./chattypes" | |||
import { promptParametersSchemaToJSONSchema } from "./parameters" | |||
|
|||
async function callExpander( | |||
export async function callExpander( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The visibility of the function 'callExpander' has been changed from private to public. This could potentially expose internal logic and should be reviewed.
generated by pr-review-commit
function_visibility_change
import { CancelError, isCancelError, serializeError } from "./error" | ||
import { | ||
CancelError, | ||
isCancelError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import 'ChatCompletionMessageParam'. If it's not being used, it should be removed.
generated by pr-review-commit
unused_import
The pull request introduces several changes across multiple files. Here are the main points:
Concerns:
Suggestions: --- a/packages/core/src/chat.ts
+++ b/packages/core/src/chat.ts
@@ -8,7 +8,7 @@ import {
CancellationToken,
checkCancelled,
} from "./cancellation"
-import { assert, logError, logVerbose } from "./util"
+import { assert, logError } from "./util" Overall, this pull request looks good to me (LGTM). 🚀 Please consider the suggestion regarding the unused import.
|
resolveSystems
method (insystems.ts
file).system
andmodel
options in the context creator (createPromptContext
inpromptcontext.ts
).resolveSystems
methoddefschema
' word in the source.expandTemplate
function inexpander.ts
to call the expander for each system in the systems array.RunPromptResult
for the prompt.system
field to thePromptGeneratorOptions
interface inprompt_template.d.ts
file.runPrompt
.expandTemplate
andcreatePromptContext
by replacing some abrupt returns with throwing of descriptive error messages.NotSupportedError
.runprompt.genai.js
in thepackage/sample/genaisrc/style/
directory has been updated to demonstrate a usage of the newsystem
property.runPrompt
calls are made, one for generating a poem and another for generating JSON. Thesystem
option is used in the first call. EachrunPrompt
has its own label.