Skip to content

Commit 1f69e80

Browse files
committed
feat(ai): Update OpenAI models supporting structured output
1 parent a9b01fe commit 1f69e80

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/ai-openai/src/node/openai-language-model.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ export class OpenAiModel implements LanguageModel {
134134
}
135135

136136
protected supportsStructuredOutput(): boolean {
137-
// currently only the lastest 4o and 4o-mini models support structured output
138-
// see https://platform.openai.com/docs/guides/structured-outputs
139-
return this.model === 'gpt-4o-2024-08-06' || this.model === 'gpt-4o-mini';
137+
// see https://platform.openai.com/docs/models/gpt-4o
138+
return [
139+
'gpt-4o',
140+
'gpt-4o-2024-08-06',
141+
'gpt-4o-mini'
142+
].includes(this.model);
140143
}
141144

142145
protected async handleStructuredOutputRequest(openai: OpenAI, request: LanguageModelRequest): Promise<LanguageModelParsedResponse> {

0 commit comments

Comments
 (0)