Download src/workflow/code-retry/client.ts from Bin29/ManimCat: direct link, hf CLI and curl.
- Browser
- Download file 550 Bytes
-
https://huggingface.co/spaces/Bin29/ManimCat/resolve/main/src/workflow/code-retry/client.ts
- Command line
-
hf download hf://spaces/Bin29/ManimCat/src/workflow/code-retry/client.ts
-
curl -L -o client.ts https://huggingface.co/spaces/Bin29/ManimCat/resolve/main/src/workflow/code-retry/client.ts
550 Bytes
| /** | |
| * Code Retry Service - OpenAI 客户端管理 | |
| */ | |
| import OpenAI from 'openai' | |
| import type { CustomApiConfig } from '../../types' | |
| import { createCustomOpenAIClient } from '../../infrastructure/ai-provider/provider-client-factory' | |
| /** | |
| * 获取 OpenAI 客户端 | |
| */ | |
| export function getClient(customApiConfig?: CustomApiConfig): OpenAI | null { | |
| if (customApiConfig) { | |
| return createCustomOpenAIClient(customApiConfig) | |
| } | |
| return null | |
| } | |
| /** | |
| * 检查客户端是否可用 | |
| */ | |
| export function isClientAvailable(): boolean { | |
| return true | |
| } | |