@langchain/openai
Advanced tools
Comparing version 0.3.15 to 0.3.16
@@ -71,9 +71,11 @@ import { OpenAI as OpenAIClient } from "openai"; | ||
} | ||
let response_metadata; | ||
if (rawResponse.system_fingerprint) { | ||
response_metadata = { | ||
usage: { ...rawResponse.usage }, | ||
system_fingerprint: rawResponse.system_fingerprint, | ||
}; | ||
} | ||
const response_metadata = { | ||
model_name: rawResponse.model, | ||
...(rawResponse.system_fingerprint | ||
? { | ||
usage: { ...rawResponse.usage }, | ||
system_fingerprint: rawResponse.system_fingerprint, | ||
} | ||
: {}), | ||
}; | ||
if (message.audio) { | ||
@@ -1276,2 +1278,3 @@ additional_kwargs.audio = message.audio; | ||
generationInfo.system_fingerprint = data.system_fingerprint; | ||
generationInfo.model_name = data.model; | ||
} | ||
@@ -1456,5 +1459,3 @@ if (this.logprobs) { | ||
// Doing this ensures all fields on the message are serialized | ||
generation.message = new AIMessage({ | ||
...generation.message, | ||
}); | ||
generation.message = new AIMessage(Object.fromEntries(Object.entries(generation.message).filter(([key]) => !key.startsWith("lc_")))); | ||
generations.push(generation); | ||
@@ -1461,0 +1462,0 @@ } |
{ | ||
"name": "@langchain/openai", | ||
"version": "0.3.15", | ||
"version": "0.3.16", | ||
"description": "OpenAI integrations for LangChain.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
394078
10837