Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiakit committed Feb 26, 2024
1 parent 2336202 commit 5cf9c0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion +llms/+internal/callOpenAIChatAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
message = response.Body.Data.choices(1).message;
else
pat = '{"' + wildcardPattern + '":';
if contains(streamedText,'{"id":"call_')
if contains(streamedText,pat)
s = jsondecode(streamedText);
if contains(s.function.arguments,pat)
prompt = jsondecode(s.function.arguments);
Expand Down
2 changes: 1 addition & 1 deletion +llms/+stream/responseStreamer.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
try
json = jsondecode(str{i});
catch ME
error("API returned il-formed json:" + str{i})
error("API returned il-formed json: " + str{i})
end
if ischar(json.choices.finish_reason) && ismember(json.choices.finish_reason,["stop","tool_calls"])
stop = true;
Expand Down

0 comments on commit 5cf9c0e

Please sign in to comment.