Skip to content

Commit 6c92f29

Browse files
fix: enable structured outputs for chat models
1 parent d6dad0f commit 6c92f29

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/provider.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,17 @@ describe('GitHubModelsProvider', () => {
100100
}),
101101
)
102102
})
103+
104+
it('should enable structured outputs for chat models', () => {
105+
const provider = createGitHubModels()
106+
provider('gpt-4')
107+
108+
expect(OpenAICompatibleChatLanguageModelMock).toHaveBeenCalledWith(
109+
'gpt-4',
110+
expect.objectContaining({
111+
supportsStructuredOutputs: true,
112+
}),
113+
)
114+
})
103115
})
104116
})

src/provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function createGitHubModels(options: GitHubModelsProviderOptions = {}): G
6666
headers: getHeaders,
6767
fetch: options.fetch,
6868
includeUsage: true,
69+
supportsStructuredOutputs: true,
6970
} satisfies OpenAICompatibleChatConfig
7071

7172
const createModel = (modelId: GitHubModelsChatModelId) => new OpenAICompatibleChatLanguageModel(modelId, baseOptions)

0 commit comments

Comments
 (0)