@langchain/openai
Advanced tools
Comparing version 0.3.13 to 0.3.14
import { OpenAI as OpenAIClient } from "openai"; | ||
import { AIMessage, AIMessageChunk, ChatMessage, ChatMessageChunk, FunctionMessageChunk, HumanMessageChunk, SystemMessageChunk, ToolMessageChunk, isAIMessage, convertToChunk, } from "@langchain/core/messages"; | ||
import { AIMessage, AIMessageChunk, ChatMessage, ChatMessageChunk, FunctionMessageChunk, HumanMessageChunk, SystemMessageChunk, ToolMessageChunk, isAIMessage, } from "@langchain/core/messages"; | ||
import { ChatGenerationChunk, } from "@langchain/core/outputs"; | ||
@@ -1209,12 +1209,2 @@ import { getEnvironmentVariable } from "@langchain/core/utils/env"; | ||
async *_streamResponseChunks(messages, options, runManager) { | ||
if (this.model.includes("o1-")) { | ||
console.warn("[WARNING]: OpenAI o1 models do not yet support token-level streaming. Streaming will yield single chunk."); | ||
const result = await this._generate(messages, options, runManager); | ||
const messageChunk = convertToChunk(result.generations[0].message); | ||
yield new ChatGenerationChunk({ | ||
message: messageChunk, | ||
text: typeof messageChunk.content === "string" ? messageChunk.content : "", | ||
}); | ||
return; | ||
} | ||
const messagesMapped = _convertMessagesToOpenAIParams(messages); | ||
@@ -1221,0 +1211,0 @@ const params = { |
{ | ||
"name": "@langchain/openai", | ||
"version": "0.3.13", | ||
"version": "0.3.14", | ||
"description": "OpenAI integrations for LangChain.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
1
62
391206
10772