File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/mcp-server/src/bridge Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export function createOpenAIStreamTransformer(
8787 enqueueChunk ( controller , createChunk ( delta ) ) ;
8888 }
8989
90- if ( part . functionCall ? .name ) {
90+ if ( part . functionCall && part . functionCall . name ) {
9191 const fc = part . functionCall ;
9292 const callId = `call_${ randomUUID ( ) } ` ;
9393
@@ -133,10 +133,10 @@ export function createOpenAIStreamTransformer(
133133 if ( finishReason && finishReason !== 'FINISH_REASON_UNSPECIFIED' ) {
134134 const reason =
135135 finishReason === FinishReason . STOP
136- ? 'stop'
137- : finishReason === FinishReason . TOOL_CALL
136+ ? toolCallStates . length > 0
138137 ? 'tool_calls'
139- : finishReason . toLowerCase ( ) ;
138+ : 'stop'
139+ : finishReason . toLowerCase ( ) ;
140140 enqueueChunk ( controller , createChunk ( { } , reason ) ) ;
141141 }
142142 } ,
You can’t perform that action at this time.
0 commit comments