|
114 | 114 | arguments
|
115 | 115 | systemPrompt {llms.utils.mustBeTextOrEmpty} = []
|
116 | 116 | nvp.Tools (1,:) {mustBeA(nvp.Tools, "openAIFunction")} = openAIFunction.empty
|
| 117 | +<<<<<<< HEAD |
117 | 118 | nvp.ModelName (1,1) {mustBeMember(nvp.ModelName,["gpt-4", "gpt-4-0613", "gpt-4-32k", ...
|
118 | 119 | "gpt-3.5-turbo", "gpt-4-1106-preview", ...
|
119 | 120 | "gpt-3.5-turbo-1106", "gpt-4-vision-preview", ...
|
120 | 121 | "gpt-4-turbo-preview"])} = "gpt-3.5-turbo"
|
| 122 | +======= |
| 123 | + nvp.ModelName (1,1) {mustBeMember(nvp.ModelName,["gpt-4-turbo", ... |
| 124 | + "gpt-4-turbo-2024-04-09","gpt-4","gpt-4-0613", ... |
| 125 | + "gpt-3.5-turbo","gpt-3.5-turbo-0125", ... |
| 126 | + "gpt-3.5-turbo-1106"])} = "gpt-3.5-turbo" |
| 127 | +>>>>>>> dev-update-040924models |
121 | 128 | nvp.Temperature {mustBeValidTemperature} = 1
|
122 | 129 | nvp.TopProbabilityMass {mustBeValidTopP} = 1
|
123 | 130 | nvp.StopSequences {mustBeValidStop} = {}
|
|
131 | 138 |
|
132 | 139 | if isfield(nvp,"StreamFun")
|
133 | 140 | 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 | 141 | else
|
139 | 142 | this.StreamFun = [];
|
140 | 143 | end
|
|
146 | 149 | else
|
147 | 150 | this.Tools = nvp.Tools;
|
148 | 151 | [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 | 152 | end
|
154 | 153 |
|
155 | 154 | if ~isempty(systemPrompt)
|
|
163 | 162 | this.Temperature = nvp.Temperature;
|
164 | 163 | this.TopProbabilityMass = nvp.TopProbabilityMass;
|
165 | 164 | 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 | 165 |
|
172 | 166 | % ResponseFormat is only supported in the latest models only
|
173 | 167 | 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 |
| 168 | + if ismember(this.ModelName,["gpt-4","gpt-4-0613"]) |
178 | 169 | error("llms:invalidOptionAndValueForModel", ...
|
179 | 170 | llms.utils.errorMessageCatalog.getMessage("llms:invalidOptionAndValueForModel", "ResponseFormat", "json", this.ModelName));
|
| 171 | + else |
| 172 | + warning("llms:warningJsonInstruction", ... |
| 173 | + llms.utils.errorMessageCatalog.getMessage("llms:warningJsonInstruction")) |
180 | 174 | end
|
181 | 175 |
|
182 | 176 | end
|
|
222 | 216 | end
|
223 | 217 |
|
224 | 218 | 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 | 219 |
|
230 | 220 | if isstring(messages) && isscalar(messages)
|
231 | 221 | messagesStruct = {struct("role", "user", "content", messages)};
|
|
0 commit comments