File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
packages/api/src/controllers Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @hyperdx/api ' : patch
3+ ---
4+
5+ Update OpenAI model configuration to use the new Responses API
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ const mockCreateAnthropic = jest.fn(
1313 ( _opts ?: Record < string , unknown > ) => mockAnthropicFactory ,
1414) ;
1515
16- const mockOpenAIChatFactory = jest . fn ( ( _model ?: string ) => mockOpenAIModel ) ;
16+ const mockOpenAIResponsesFactory = jest . fn ( ( _model ?: string ) => mockOpenAIModel ) ;
1717const mockCreateOpenAI = jest . fn ( ( _opts ?: Record < string , unknown > ) => ( {
18- chat : mockOpenAIChatFactory ,
18+ responses : mockOpenAIResponsesFactory ,
1919} ) ) ;
2020
2121jest . mock ( '@ai-sdk/anthropic' , ( ) => ( {
@@ -191,7 +191,7 @@ describe('openai provider', () => {
191191 expect ( mockCreateOpenAI ) . toHaveBeenCalledWith (
192192 expect . objectContaining ( { apiKey : 'sk-test' } ) ,
193193 ) ;
194- expect ( mockOpenAIChatFactory ) . toHaveBeenCalledWith ( 'gpt-4o' ) ;
194+ expect ( mockOpenAIResponsesFactory ) . toHaveBeenCalledWith ( 'gpt-4o' ) ;
195195 } ) ;
196196
197197 it ( 'passes baseURL when AI_BASE_URL is set' , ( ) => {
Original file line number Diff line number Diff line change @@ -368,9 +368,7 @@ function getAnthropicModel(): LanguageModel {
368368}
369369
370370/**
371- * Configure OpenAI-compatible model.
372- * Works with any OpenAI Chat Completions-compatible endpoint
373- * (e.g. Azure OpenAI, OpenRouter, LiteLLM proxies).
371+ * Configure OpenAI-compatible model using the Responses API (/v1/responses).
374372 */
375373function getOpenAIModel ( ) : LanguageModel {
376374 const apiKey = config . AI_API_KEY ;
@@ -399,5 +397,5 @@ function getOpenAIModel(): LanguageModel {
399397 ...( Object . keys ( headers ) . length > 0 && { headers } ) ,
400398 } ) ;
401399
402- return openai . chat ( config . AI_MODEL_NAME ) ;
400+ return openai . responses ( config . AI_MODEL_NAME ) ;
403401}
You can’t perform that action at this time.
0 commit comments