diff --git a/src/provider.test.ts b/src/provider.test.ts index b576f1f..46869d2 100644 --- a/src/provider.test.ts +++ b/src/provider.test.ts @@ -100,5 +100,17 @@ describe('GitHubModelsProvider', () => { }), ) }) + + it('should enable structured outputs for chat models', () => { + const provider = createGitHubModels() + provider('gpt-4') + + expect(OpenAICompatibleChatLanguageModelMock).toHaveBeenCalledWith( + 'gpt-4', + expect.objectContaining({ + supportsStructuredOutputs: true, + }), + ) + }) }) }) diff --git a/src/provider.ts b/src/provider.ts index 2397788..937d17e 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -66,6 +66,7 @@ export function createGitHubModels(options: GitHubModelsProviderOptions = {}): G headers: getHeaders, fetch: options.fetch, includeUsage: true, + supportsStructuredOutputs: true, } satisfies OpenAICompatibleChatConfig const createModel = (modelId: GitHubModelsChatModelId) => new OpenAICompatibleChatLanguageModel(modelId, baseOptions)