diff --git a/src/extension/background/APIHandler/AILanguageModelHandler.ts b/src/extension/background/APIHandler/AILanguageModelHandler.ts index 563a58d..53c6a87 100644 --- a/src/extension/background/APIHandler/AILanguageModelHandler.ts +++ b/src/extension/background/APIHandler/AILanguageModelHandler.ts @@ -86,8 +86,8 @@ class AILanguageModelHandler { const template = new Template(promptConfig.template) const prompt = template.render({ messages: history, - bos_token: promptConfig.bosToken, - eos_token: promptConfig.eosToken + bos_token: manifest.tokens.bosToken, + eos_token: manifest.tokens.eosToken }) const tokenCount = await AIPrompter.countTokens(prompt, props, {}) diff --git a/src/extension/background/APIHandler/AIRewriterHandler.ts b/src/extension/background/APIHandler/AIRewriterHandler.ts index 04ca9c7..f51925e 100644 --- a/src/extension/background/APIHandler/AIRewriterHandler.ts +++ b/src/extension/background/APIHandler/AIRewriterHandler.ts @@ -134,8 +134,8 @@ class AIRewriterHandler { shared_context: sharedContext, context, input, - bos_token: config.bosToken, - eos_token: config.eosToken + bos_token: manifest.tokens.bosToken, + eos_token: manifest.tokens.eosToken }) } } diff --git a/src/extension/background/APIHandler/AISummarizerHandler.ts b/src/extension/background/APIHandler/AISummarizerHandler.ts index 8229168..e2a4db1 100644 --- a/src/extension/background/APIHandler/AISummarizerHandler.ts +++ b/src/extension/background/APIHandler/AISummarizerHandler.ts @@ -133,8 +133,8 @@ class AISummarizerHandler { shared_context: sharedContext, context, input, - bos_token: config.bosToken, - eos_token: config.eosToken + bos_token: manifest.tokens.bosToken, + eos_token: manifest.tokens.eosToken }) } } diff --git a/src/extension/background/APIHandler/AIWriterHandler.ts b/src/extension/background/APIHandler/AIWriterHandler.ts index 2177975..83c70f8 100644 --- a/src/extension/background/APIHandler/AIWriterHandler.ts +++ b/src/extension/background/APIHandler/AIWriterHandler.ts @@ -133,8 +133,8 @@ class AIWriterHandler { sharedContext, context, input, - bos_token: config.bosToken, - eos_token: config.eosToken + bos_token: manifest.tokens.bosToken, + eos_token: manifest.tokens.eosToken }) } } diff --git a/src/shared/AIModelManifest.ts b/src/shared/AIModelManifest.ts index e27b3eb..f9e5bd8 100644 --- a/src/shared/AIModelManifest.ts +++ b/src/shared/AIModelManifest.ts @@ -22,8 +22,6 @@ export type AIModelManifestConfig = { export type AIModelPromptConfig = { template: string - bosToken?: string - eosToken?: string } export type AIModelManifest = { @@ -37,6 +35,8 @@ export type AIModelManifest = { max: number default: number stop?: string[] + bosToken?: string + eosToken?: string } prompts?: { languageModel?: AIModelPromptConfig