Skip to content

Commit

Permalink
fix: moonshot did not return usage cause error (#5551)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyurus authored May 29, 2024
1 parent 4b4f611 commit a320c93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/langchain-community/src/chat_models/moonshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export class ChatMoonshot extends BaseChatModel implements ChatMoonshotParams {
prompt_tokens = 0,
completion_tokens = 0,
total_tokens = 0,
} = data.usage;
} = data.usage ?? {};

const { text } = data.output;

Expand Down

0 comments on commit a320c93

Please sign in to comment.