diff --git a/langchain/src/chat_models/llama_cpp.ts b/langchain/src/chat_models/llama_cpp.ts index 76ad790708c8..0a05745a0522 100644 --- a/langchain/src/chat_models/llama_cpp.ts +++ b/langchain/src/chat_models/llama_cpp.ts @@ -115,7 +115,7 @@ export class ChatLlamaCpp extends SimpleChatModel { /** @ignore */ async _call( messages: BaseMessage[], - _options: this["ParsedCallOptions"] + options: this["ParsedCallOptions"] ): Promise { let prompt = ""; @@ -136,6 +136,7 @@ export class ChatLlamaCpp extends SimpleChatModel { try { const promptOptions = { + onToken: options.onToken, maxTokens: this?.maxTokens, temperature: this?.temperature, topK: this?.topK, diff --git a/langchain/src/llms/llama_cpp.ts b/langchain/src/llms/llama_cpp.ts index 5081bde04008..f2d6518ffd2b 100644 --- a/langchain/src/llms/llama_cpp.ts +++ b/langchain/src/llms/llama_cpp.ts @@ -72,10 +72,11 @@ export class LlamaCpp extends LLM { /** @ignore */ async _call( prompt: string, - _options?: this["ParsedCallOptions"] + options?: this["ParsedCallOptions"] ): Promise { try { const promptOptions = { + onToken: options?.onToken, maxTokens: this?.maxTokens, temperature: this?.temperature, topK: this?.topK,