Skip to content

Commit

Permalink
Eliminated validation related to removed models
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiakit committed Apr 13, 2024
1 parent 9010081 commit 1e626d9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions +llms/+internal/callOpenAIChatAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,16 @@

parameters.stream = ~isempty(nvp.StreamFun);

if ~isempty(functions) && ~strcmp(nvp.ModelName,'gpt-4-vision-preview')
if ~isempty(functions)
parameters.tools = functions;
end

if ~isempty(nvp.ToolChoice) && ~strcmp(nvp.ModelName,'gpt-4-vision-preview')
if ~isempty(nvp.ToolChoice)
parameters.tool_choice = nvp.ToolChoice;
end

if ismember(nvp.ModelName,["gpt-3.5-turbo-1106","gpt-4-1106-preview"])
if strcmp(nvp.ResponseFormat,"json")
parameters.response_format = struct('type','json_object');
end
if strcmp(nvp.ResponseFormat,"json")
parameters.response_format = struct('type','json_object');
end

if ~isempty(nvp.Seed)
Expand All @@ -142,9 +140,6 @@
dict = mapNVPToParameters;

nvpOptions = keys(dict);
if strcmp(nvp.ModelName,'gpt-4-vision-preview')
nvpOptions(ismember(nvpOptions,"StopSequences")) = [];
end

for opt = nvpOptions.'
if isfield(nvp, opt)
Expand Down

0 comments on commit 1e626d9

Please sign in to comment.