Skip to content

Commit

Permalink
openai[patch]: Properly dedupe system fingerprint (#6638)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored Aug 26, 2024
1 parent a64cf77 commit 56b0d04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ export class ChatOpenAI<
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const generationInfo: Record<string, any> = { ...newTokenIndices };
if (choice.finish_reason !== undefined) {
if (choice.finish_reason != null) {
generationInfo.finish_reason = choice.finish_reason;
// Only include system fingerprint in the last chunk for now
// to avoid concatenation issues
Expand Down

0 comments on commit 56b0d04

Please sign in to comment.