fix(OpenAIResponseAPIClient):ensure openai-response providers always use Response API (#8145)

Update OpenAIResponseAPIClient.ts
This commit is contained in:
luoxu1314 2025-07-14 23:57:16 +08:00 committed by GitHub
parent 71917eb0ec
commit d4dde58e13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,6 +78,9 @@ export class OpenAIResponseAPIClient extends OpenAIBaseClient<
*
*/
public getClient(model: Model) {
if (this.provider.type === 'openai-response') {
return this
}
if (isOpenAILLMModel(model) && !isOpenAIChatCompletionOnlyModel(model)) {
if (this.provider.id === 'azure-openai' || this.provider.type === 'azure-openai') {
this.provider = { ...this.provider, apiHost: this.formatApiHost() }