|
131 | 131 |
|
132 | 132 | if isfield(nvp,"StreamFun")
|
133 | 133 | this.StreamFun = nvp.StreamFun;
|
134 |
| - if strcmp(nvp.ModelName,'gpt-4-vision-preview') |
135 |
| - error("llms:invalidOptionForModel", ... |
136 |
| - llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionForModel", "StreamFun", nvp.ModelName)); |
137 |
| - end |
138 | 134 | else
|
139 | 135 | this.StreamFun = [];
|
140 | 136 | end
|
|
146 | 142 | else
|
147 | 143 | this.Tools = nvp.Tools;
|
148 | 144 | [this.FunctionsStruct, this.FunctionNames] = functionAsStruct(nvp.Tools);
|
149 |
| - if strcmp(nvp.ModelName,'gpt-4-vision-preview') |
150 |
| - error("llms:invalidOptionForModel", ... |
151 |
| - llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionForModel", "Tools", nvp.ModelName)); |
152 |
| - end |
153 | 145 | end
|
154 | 146 |
|
155 | 147 | if ~isempty(systemPrompt)
|
|
163 | 155 | this.Temperature = nvp.Temperature;
|
164 | 156 | this.TopProbabilityMass = nvp.TopProbabilityMass;
|
165 | 157 | this.StopSequences = nvp.StopSequences;
|
166 |
| - if ~isempty(nvp.StopSequences) && strcmp(nvp.ModelName,'gpt-4-vision-preview') |
167 |
| - error("llms:invalidOptionForModel", ... |
168 |
| - llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionForModel", "StopSequences", nvp.ModelName)); |
169 |
| - end |
170 |
| - |
171 | 158 |
|
172 | 159 | % ResponseFormat is only supported in the latest models only
|
173 | 160 | if (nvp.ResponseFormat == "json")
|
174 |
| - if ismember(this.ModelName,["gpt-3.5-turbo-1106","gpt-4-1106-preview"]) |
175 |
| - warning("llms:warningJsonInstruction", ... |
176 |
| - llms.utils.errorMessageCatalog.getMessage("llms:warningJsonInstruction")) |
177 |
| - else |
| 161 | + if ismember(this.ModelName,["gpt-4","gpt-4-0613"]) |
178 | 162 | error("llms:invalidOptionAndValueForModel", ...
|
179 | 163 | llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionAndValueForModel", "ResponseFormat", "json", this.ModelName));
|
| 164 | + else |
| 165 | + warning("llms:warningJsonInstruction", ... |
| 166 | + llms.utils.errorMessageCatalog.getMessage("llms:warningJsonInstruction")) |
180 | 167 | end
|
181 | 168 |
|
182 | 169 | end
|
|
222 | 209 | end
|
223 | 210 |
|
224 | 211 | toolChoice = convertToolChoice(this, nvp.ToolChoice);
|
225 |
| - if ~isempty(nvp.ToolChoice) && strcmp(this.ModelName,'gpt-4-vision-preview') |
226 |
| - error("llms:invalidOptionForModel", ... |
227 |
| - llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionForModel", "ToolChoice", this.ModelName)); |
228 |
| - end |
229 | 212 |
|
230 | 213 | if isstring(messages) && isscalar(messages)
|
231 | 214 | messagesStruct = {struct("role", "user", "content", messages)};
|
|
0 commit comments