File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/mcp-server/src/bridge Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ export function createOpenAIStreamTransformer(
8888 }
8989
9090 if ( part . functionCall && part . functionCall . name ) {
91- const fc = part . functionCall ;
9291 const callId = `call_${ randomUUID ( ) } ` ;
9392
9493 // 模拟分块发送 tool_calls
@@ -99,7 +98,7 @@ export function createOpenAIStreamTransformer(
9998 index : toolCallStates . length ,
10099 id : callId ,
101100 type : 'function' ,
102- function : { name : fc . name , arguments : '' } ,
101+ function : { name : part . functionCall . name , arguments : '' } ,
103102 } ,
104103 ] ,
105104 } ;
@@ -116,16 +115,16 @@ export function createOpenAIStreamTransformer(
116115 index : toolCallStates . length ,
117116 id : callId ,
118117 type : 'function' ,
119- function : { arguments : JSON . stringify ( fc . args ) } ,
118+ function : { arguments : JSON . stringify ( part . functionCall . args ) } ,
120119 } ,
121120 ] ,
122121 } ;
123122 enqueueChunk ( controller , createChunk ( argsDelta ) ) ;
124123
125124 toolCallStates . push ( {
126125 id : callId ,
127- name : fc . name ,
128- arguments : JSON . stringify ( fc . args ) ,
126+ name : part . functionCall . name ,
127+ arguments : JSON . stringify ( part . functionCall . args ) ,
129128 } ) ;
130129 }
131130 }
You can’t perform that action at this time.
0 commit comments