Skip to content

Commit fae9042

Browse files
committed
Error early for ResponseFormat="json",Model="o1-mini"
1 parent 609b49d commit fae9042

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

+llms/+openai/validateResponseFormat.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function validateResponseFormat(format,model)
55
% Copyright 2024 The MathWorks, Inc.
66

77
if format == "json"
8-
if ismember(model,["gpt-4","gpt-4-0613"])
8+
if ismember(model,["gpt-4","gpt-4-0613","o1-preview","o1-mini"])
99
error("llms:invalidOptionAndValueForModel", ...
1010
llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionAndValueForModel", "ResponseFormat", "json", model));
1111
else

tests/topenAIChat.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ function keyNotFound(testCase)
592592
"Input", {{"APIKey", "this-is-not-a-real-key", "ModelName", "gpt-4", "ResponseFormat", "json"}}, ...
593593
"Error", "llms:invalidOptionAndValueForModel"), ...
594594
...
595+
"InvalidResponseFormatModelCombination2", struct( ...
596+
"Input", {{"APIKey", "this-is-not-a-real-key", "ModelName", "o1-mini", "ResponseFormat", "json"}}, ...
597+
"Error", "llms:invalidOptionAndValueForModel"), ...
598+
...
595599
"InvalidStreamFunType", struct( ...
596600
"Input",{{"StreamFun", "2" }},...
597601
"Error", "MATLAB:validators:mustBeA"), ...

0 commit comments

Comments
 (0)