From 722658b17367c45040da5d80f20d06344000576a Mon Sep 17 00:00:00 2001 From: Jeason Date: Thu, 8 Aug 2024 15:44:33 +0800 Subject: [PATCH] fix: comments about supportsStructuredOutputs --- src/language-model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/language-model.ts b/src/language-model.ts index a19fff3..fe93ddd 100644 --- a/src/language-model.ts +++ b/src/language-model.ts @@ -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; @@ -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.`, }); }