File tree 2 files changed +14
-6
lines changed
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 73
73
if isempty(nvp .StreamFun )
74
74
message = response .Body .Data .choices(1 ).message;
75
75
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
78
90
end
79
91
if isfield(message , " tool_choice" )
80
92
text = " " ;
Original file line number Diff line number Diff line change @@ -172,10 +172,6 @@ function deploymentNotFound(testCase)
172
172
end
173
173
174
174
% 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
-
179
175
function warningJSONResponseFormat(testCase )
180
176
testCase .assumeFail(" TODO for azureChat" );
181
177
end
You can’t perform that action at this time.
0 commit comments