File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 7373 if isempty(nvp .StreamFun )
7474 message = response .Body .Data .choices(1 ).message;
7575 else
76- message = struct(" role" , " assistant" , ...
77- " content" , streamedText );
76+ pat = ' {"' + wildcardPattern + ' ":' ;
77+ if contains(streamedText ,pat )
78+ s = jsondecode(streamedText );
79+ if contains(s .function .arguments ,pat )
80+ prompt = jsondecode(s .function .arguments );
81+ s.function.arguments = prompt ;
82+ end
83+ message = struct(" role" , " assistant" , ...
84+ " content" ,[], ...
85+ " tool_calls" ,jsondecode(streamedText ));
86+ else
87+ message = struct(" role" , " assistant" , ...
88+ " content" , streamedText );
89+ end
7890 end
7991 if isfield(message , " tool_choice" )
8092 text = " " ;
Original file line number Diff line number Diff line change @@ -172,10 +172,6 @@ function deploymentNotFound(testCase)
172172 end
173173
174174 % open TODOs for azureChat
175- function generateWithToolsAndStreamFunc(testCase )
176- testCase .assumeFail(" need to make azureChat return tool_call in the same way as openAIChat" );
177- end
178-
179175 function warningJSONResponseFormat(testCase )
180176 testCase .assumeFail(" TODO for azureChat" );
181177 end
You can’t perform that action at this time.
0 commit comments