Skip to content

Commit

Permalink
fix: comments about supportsStructuredOutputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeasonstudio committed Aug 8, 2024
1 parent 3596082 commit 722658b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/language-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ChromeAIChatLanguageModel implements LanguageModelV1 {
readonly modelId: ChromeAIChatModelId = 'text';
readonly provider = 'gemini-nano';
readonly supportsImageUrls = false;
readonly supportsStructuredOutputs = true;
readonly supportsStructuredOutputs = false;

options: ChromeAIChatSettings;

Expand Down Expand Up @@ -113,7 +113,7 @@ export class ChromeAIChatLanguageModel implements LanguageModelV1 {
if (options.mode.type === 'object-json') {
prompt.unshift({
role: 'system',
content: `Throughout our conversation, always start your responses with "{" and end with "}", ensuring the output is a concise JSON object and strictly avoid including any comments, notes, explanations, or examples in your output.\nFor instance, if the JSON schema is {"type":"object","properties":{"someKey":{"type":"string"}},"required":["someKey"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}, your response should immediately begin with "{" and strictly end with "}", following the format: {"someKey": "someValue"}.\nAdhere to this format for all queries moving forward.\nJSON schema: ${JSON.stringify(options.mode.schema)}`,
content: `Throughout our conversation, always start your responses with "{" and end with "}", ensuring the output is a concise JSON object and strictly avoid including any comments, notes, explanations, or examples in your output.\nFor instance, if the JSON schema is {"type":"object","properties":{"someKey":{"type":"string"}},"required":["someKey"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}, your response should immediately begin with "{" and strictly end with "}", following the format: {"someKey": "someValue"}.\nAdhere to this format for all queries moving forward.`,
});
}

Expand Down

0 comments on commit 722658b

Please sign in to comment.