File size: 518 Bytes
94e1b2f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /**
* Code Retry Service - OpenAI 客户端管理
*/
import OpenAI from 'openai'
import type { CustomApiConfig } from '../../types'
import { createCustomOpenAIClient } from '../openai-client-factory'
/**
* 获取 OpenAI 客户端
*/
export function getClient(customApiConfig?: CustomApiConfig): OpenAI | null {
if (customApiConfig) {
return createCustomOpenAIClient(customApiConfig)
}
return null
}
/**
* 检查客户端是否可用
*/
export function isClientAvailable(): boolean {
return true
}
|