fix(OpenAIResponseAPIClient): refine client selection logic for non-chat models (#8238)

- Updated the getClient method to ensure the OpenAIResponseAPIClient is only returned for non-chat completion models, improving model compatibility checks.
This commit is contained in:
SuYao 2025-07-17 17:38:20 +08:00 committed by GitHub
parent 9218ac237b
commit fe91d4b56a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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