@sdkwork/ai-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +276 -0
- package/dist/api/assistants.d.ts +19 -0
- package/dist/api/assistants.d.ts.map +1 -0
- package/dist/api/audio.d.ts +15 -0
- package/dist/api/audio.d.ts.map +1 -0
- package/dist/api/base.d.ts +13 -0
- package/dist/api/base.d.ts.map +1 -0
- package/dist/api/batches.d.ts +17 -0
- package/dist/api/batches.d.ts.map +1 -0
- package/dist/api/chat-completions.d.ts +19 -0
- package/dist/api/chat-completions.d.ts.map +1 -0
- package/dist/api/chat.d.ts +27 -0
- package/dist/api/chat.d.ts.map +1 -0
- package/dist/api/context.d.ts +16 -0
- package/dist/api/context.d.ts.map +1 -0
- package/dist/api/embeddings.d.ts +10 -0
- package/dist/api/embeddings.d.ts.map +1 -0
- package/dist/api/files.d.ts +19 -0
- package/dist/api/files.d.ts.map +1 -0
- package/dist/api/images.d.ts +14 -0
- package/dist/api/images.d.ts.map +1 -0
- package/dist/api/index.d.ts +20 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/knowledge-bases.d.ts +27 -0
- package/dist/api/knowledge-bases.d.ts.map +1 -0
- package/dist/api/models.d.ts +14 -0
- package/dist/api/models.d.ts.map +1 -0
- package/dist/api/moderations.d.ts +10 -0
- package/dist/api/moderations.d.ts.map +1 -0
- package/dist/api/music.d.ts +17 -0
- package/dist/api/music.d.ts.map +1 -0
- package/dist/api/paths.d.ts +3 -0
- package/dist/api/paths.d.ts.map +1 -0
- package/dist/api/rerank.d.ts +10 -0
- package/dist/api/rerank.d.ts.map +1 -0
- package/dist/api/responses.d.ts +18 -0
- package/dist/api/responses.d.ts.map +1 -0
- package/dist/api/threads.d.ts +43 -0
- package/dist/api/threads.d.ts.map +1 -0
- package/dist/api/videos.d.ts +17 -0
- package/dist/api/videos.d.ts.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/http/client.d.ts +21 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +639 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk.d.ts +49 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/types/annotation.d.ts +11 -0
- package/dist/types/annotation.d.ts.map +1 -0
- package/dist/types/assistant-create-request.d.ts +26 -0
- package/dist/types/assistant-create-request.d.ts.map +1 -0
- package/dist/types/assistant-delete-response.d.ts +10 -0
- package/dist/types/assistant-delete-response.d.ts.map +1 -0
- package/dist/types/assistant-list-response.d.ts +15 -0
- package/dist/types/assistant-list-response.d.ts.map +1 -0
- package/dist/types/assistant-response.d.ts +30 -0
- package/dist/types/assistant-response.d.ts.map +1 -0
- package/dist/types/attachment.d.ts +8 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/audio-parameters.d.ts +8 -0
- package/dist/types/audio-parameters.d.ts.map +1 -0
- package/dist/types/audio.d.ts +12 -0
- package/dist/types/audio.d.ts.map +1 -0
- package/dist/types/batch-create-request.d.ts +12 -0
- package/dist/types/batch-create-request.d.ts.map +1 -0
- package/dist/types/batch-list-response.d.ts +15 -0
- package/dist/types/batch-list-response.d.ts.map +1 -0
- package/dist/types/batch-response.d.ts +42 -0
- package/dist/types/batch-response.d.ts.map +1 -0
- package/dist/types/cancel-response-response.d.ts +2 -0
- package/dist/types/cancel-response-response.d.ts.map +1 -0
- package/dist/types/categories.d.ts +22 -0
- package/dist/types/categories.d.ts.map +1 -0
- package/dist/types/category-scores.d.ts +22 -0
- package/dist/types/category-scores.d.ts.map +1 -0
- package/dist/types/chat-completion-delete-response.d.ts +10 -0
- package/dist/types/chat-completion-delete-response.d.ts.map +1 -0
- package/dist/types/chat-completion-list.d.ts +15 -0
- package/dist/types/chat-completion-list.d.ts.map +1 -0
- package/dist/types/chat-completion-request.d.ts +66 -0
- package/dist/types/chat-completion-request.d.ts.map +1 -0
- package/dist/types/chat-completion-response.d.ts +22 -0
- package/dist/types/chat-completion-response.d.ts.map +1 -0
- package/dist/types/chat-message-list.d.ts +15 -0
- package/dist/types/chat-message-list.d.ts.map +1 -0
- package/dist/types/chat-message.d.ts +23 -0
- package/dist/types/chat-message.d.ts.map +1 -0
- package/dist/types/chat-with-context-request.d.ts +3 -0
- package/dist/types/chat-with-context-request.d.ts.map +1 -0
- package/dist/types/choice.d.ts +16 -0
- package/dist/types/choice.d.ts.map +1 -0
- package/dist/types/chunk-config.d.ts +10 -0
- package/dist/types/chunk-config.d.ts.map +1 -0
- package/dist/types/common.d.ts +36 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/completion-tokens-details.d.ts +12 -0
- package/dist/types/completion-tokens-details.d.ts.map +1 -0
- package/dist/types/content-block.d.ts +12 -0
- package/dist/types/content-block.d.ts.map +1 -0
- package/dist/types/content.d.ts +13 -0
- package/dist/types/content.d.ts.map +1 -0
- package/dist/types/context-create-request.d.ts +16 -0
- package/dist/types/context-create-request.d.ts.map +1 -0
- package/dist/types/context-message.d.ts +13 -0
- package/dist/types/context-message.d.ts.map +1 -0
- package/dist/types/context-response.d.ts +22 -0
- package/dist/types/context-response.d.ts.map +1 -0
- package/dist/types/count-claude-tokens-request.d.ts +2 -0
- package/dist/types/count-claude-tokens-request.d.ts.map +1 -0
- package/dist/types/count-claude-tokens-response.d.ts +2 -0
- package/dist/types/count-claude-tokens-response.d.ts.map +1 -0
- package/dist/types/create-chat-completion-response.d.ts +2 -0
- package/dist/types/create-chat-completion-response.d.ts.map +1 -0
- package/dist/types/create-claude-message-request.d.ts +2 -0
- package/dist/types/create-claude-message-request.d.ts.map +1 -0
- package/dist/types/create-claude-message-response.d.ts +2 -0
- package/dist/types/create-claude-message-response.d.ts.map +1 -0
- package/dist/types/create-response-request.d.ts +3 -0
- package/dist/types/create-response-request.d.ts.map +1 -0
- package/dist/types/create-response-response.d.ts +2 -0
- package/dist/types/create-response-response.d.ts.map +1 -0
- package/dist/types/create-run-response.d.ts +2 -0
- package/dist/types/create-run-response.d.ts.map +1 -0
- package/dist/types/create-thread-and-run-response.d.ts +2 -0
- package/dist/types/create-thread-and-run-response.d.ts.map +1 -0
- package/dist/types/create-transcription-request.d.ts +5 -0
- package/dist/types/create-transcription-request.d.ts.map +1 -0
- package/dist/types/create-translation-request.d.ts +5 -0
- package/dist/types/create-translation-request.d.ts.map +1 -0
- package/dist/types/delete-response-response.d.ts +2 -0
- package/dist/types/delete-response-response.d.ts.map +1 -0
- package/dist/types/document-add-request.d.ts +17 -0
- package/dist/types/document-add-request.d.ts.map +1 -0
- package/dist/types/document-response.d.ts +22 -0
- package/dist/types/document-response.d.ts.map +1 -0
- package/dist/types/document.d.ts +8 -0
- package/dist/types/document.d.ts.map +1 -0
- package/dist/types/embedding-request.d.ts +9 -0
- package/dist/types/embedding-request.d.ts.map +1 -0
- package/dist/types/embedding-response.d.ts +14 -0
- package/dist/types/embedding-response.d.ts.map +1 -0
- package/dist/types/embedding.d.ts +10 -0
- package/dist/types/embedding.d.ts.map +1 -0
- package/dist/types/error-object.d.ts +12 -0
- package/dist/types/error-object.d.ts.map +1 -0
- package/dist/types/errors.d.ts +9 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/file-citation.d.ts +8 -0
- package/dist/types/file-citation.d.ts.map +1 -0
- package/dist/types/filter.d.ts +10 -0
- package/dist/types/filter.d.ts.map +1 -0
- package/dist/types/function-call.d.ts +8 -0
- package/dist/types/function-call.d.ts.map +1 -0
- package/dist/types/function.d.ts +8 -0
- package/dist/types/function.d.ts.map +1 -0
- package/dist/types/get-response-response.d.ts +2 -0
- package/dist/types/get-response-response.d.ts.map +1 -0
- package/dist/types/image-data.d.ts +6 -0
- package/dist/types/image-data.d.ts.map +1 -0
- package/dist/types/image-file-content.d.ts +6 -0
- package/dist/types/image-file-content.d.ts.map +1 -0
- package/dist/types/image-generation-request.d.ts +14 -0
- package/dist/types/image-generation-request.d.ts.map +1 -0
- package/dist/types/image-generation-response.d.ts +6 -0
- package/dist/types/image-generation-response.d.ts.map +1 -0
- package/dist/types/index.d.ts +131 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/json-schema.d.ts +12 -0
- package/dist/types/json-schema.d.ts.map +1 -0
- package/dist/types/knowledge-base-create-request.d.ts +14 -0
- package/dist/types/knowledge-base-create-request.d.ts.map +1 -0
- package/dist/types/knowledge-base-list-response.d.ts +11 -0
- package/dist/types/knowledge-base-list-response.d.ts.map +1 -0
- package/dist/types/knowledge-base-response.d.ts +22 -0
- package/dist/types/knowledge-base-response.d.ts.map +1 -0
- package/dist/types/knowledge-search-request.d.ts +15 -0
- package/dist/types/knowledge-search-request.d.ts.map +1 -0
- package/dist/types/knowledge-search-response.d.ts +9 -0
- package/dist/types/knowledge-search-response.d.ts.map +1 -0
- package/dist/types/last-error.d.ts +8 -0
- package/dist/types/last-error.d.ts.map +1 -0
- package/dist/types/list-documents-response.d.ts +3 -0
- package/dist/types/list-documents-response.d.ts.map +1 -0
- package/dist/types/list-response-input-items-response.d.ts +2 -0
- package/dist/types/list-response-input-items-response.d.ts.map +1 -0
- package/dist/types/logprobs.d.ts +9 -0
- package/dist/types/logprobs.d.ts.map +1 -0
- package/dist/types/message.d.ts +17 -0
- package/dist/types/message.d.ts.map +1 -0
- package/dist/types/moderation-request.d.ts +7 -0
- package/dist/types/moderation-request.d.ts.map +1 -0
- package/dist/types/moderation-response.d.ts +11 -0
- package/dist/types/moderation-response.d.ts.map +1 -0
- package/dist/types/moderation-result.d.ts +12 -0
- package/dist/types/moderation-result.d.ts.map +1 -0
- package/dist/types/music-error.d.ts +8 -0
- package/dist/types/music-error.d.ts.map +1 -0
- package/dist/types/music-generation-request.d.ts +24 -0
- package/dist/types/music-generation-request.d.ts.map +1 -0
- package/dist/types/open-ai-file-delete-response.d.ts +6 -0
- package/dist/types/open-ai-file-delete-response.d.ts.map +1 -0
- package/dist/types/open-ai-file-list.d.ts +15 -0
- package/dist/types/open-ai-file-list.d.ts.map +1 -0
- package/dist/types/open-ai-file-object.d.ts +24 -0
- package/dist/types/open-ai-file-object.d.ts.map +1 -0
- package/dist/types/open-ai-model-delete-response.d.ts +6 -0
- package/dist/types/open-ai-model-delete-response.d.ts.map +1 -0
- package/dist/types/open-ai-model-list.d.ts +6 -0
- package/dist/types/open-ai-model-list.d.ts.map +1 -0
- package/dist/types/open-ai-model.d.ts +7 -0
- package/dist/types/open-ai-model.d.ts.map +1 -0
- package/dist/types/open-ai-video-delete-response.d.ts +6 -0
- package/dist/types/open-ai-video-delete-response.d.ts.map +1 -0
- package/dist/types/open-ai-video-list.d.ts +6 -0
- package/dist/types/open-ai-video-list.d.ts.map +1 -0
- package/dist/types/open-ai-video.d.ts +35 -0
- package/dist/types/open-ai-video.d.ts.map +1 -0
- package/dist/types/patch-update-completion-request.d.ts +2 -0
- package/dist/types/patch-update-completion-request.d.ts.map +1 -0
- package/dist/types/prompt-tokens-details.d.ts +8 -0
- package/dist/types/prompt-tokens-details.d.ts.map +1 -0
- package/dist/types/request-counts.d.ts +10 -0
- package/dist/types/request-counts.d.ts.map +1 -0
- package/dist/types/required-action.d.ts +9 -0
- package/dist/types/required-action.d.ts.map +1 -0
- package/dist/types/rerank-request.d.ts +15 -0
- package/dist/types/rerank-request.d.ts.map +1 -0
- package/dist/types/rerank-response.d.ts +16 -0
- package/dist/types/rerank-response.d.ts.map +1 -0
- package/dist/types/response-format.d.ts +9 -0
- package/dist/types/response-format.d.ts.map +1 -0
- package/dist/types/result.d.ts +10 -0
- package/dist/types/result.d.ts.map +1 -0
- package/dist/types/run-create-request.d.ts +33 -0
- package/dist/types/run-create-request.d.ts.map +1 -0
- package/dist/types/run-list-response.d.ts +15 -0
- package/dist/types/run-list-response.d.ts.map +1 -0
- package/dist/types/run-response.d.ts +55 -0
- package/dist/types/run-response.d.ts.map +1 -0
- package/dist/types/run-step-list-response.d.ts +15 -0
- package/dist/types/run-step-list-response.d.ts.map +1 -0
- package/dist/types/run-step-response.d.ts +34 -0
- package/dist/types/run-step-response.d.ts.map +1 -0
- package/dist/types/search-result.d.ts +14 -0
- package/dist/types/search-result.d.ts.map +1 -0
- package/dist/types/segment.d.ts +13 -0
- package/dist/types/segment.d.ts.map +1 -0
- package/dist/types/speech-request.d.ts +10 -0
- package/dist/types/speech-request.d.ts.map +1 -0
- package/dist/types/stream-options.d.ts +8 -0
- package/dist/types/stream-options.d.ts.map +1 -0
- package/dist/types/submit-tool-outputs-request.d.ts +3 -0
- package/dist/types/submit-tool-outputs-request.d.ts.map +1 -0
- package/dist/types/submit-tool-outputs-response.d.ts +2 -0
- package/dist/types/submit-tool-outputs-response.d.ts.map +1 -0
- package/dist/types/submit-tool-outputs.d.ts +7 -0
- package/dist/types/submit-tool-outputs.d.ts.map +1 -0
- package/dist/types/suno-music-delete-response.d.ts +6 -0
- package/dist/types/suno-music-delete-response.d.ts.map +1 -0
- package/dist/types/suno-music-list.d.ts +9 -0
- package/dist/types/suno-music-list.d.ts.map +1 -0
- package/dist/types/suno-music.d.ts +31 -0
- package/dist/types/suno-music.d.ts.map +1 -0
- package/dist/types/text-content.d.ts +8 -0
- package/dist/types/text-content.d.ts.map +1 -0
- package/dist/types/thinking.d.ts +6 -0
- package/dist/types/thinking.d.ts.map +1 -0
- package/dist/types/thread-create-request.d.ts +11 -0
- package/dist/types/thread-create-request.d.ts.map +1 -0
- package/dist/types/thread-delete-response.d.ts +10 -0
- package/dist/types/thread-delete-response.d.ts.map +1 -0
- package/dist/types/thread-message-create-request.d.ts +13 -0
- package/dist/types/thread-message-create-request.d.ts.map +1 -0
- package/dist/types/thread-message-list-response.d.ts +15 -0
- package/dist/types/thread-message-list-response.d.ts.map +1 -0
- package/dist/types/thread-message-modify-request.d.ts +6 -0
- package/dist/types/thread-message-modify-request.d.ts.map +1 -0
- package/dist/types/thread-message-response.d.ts +33 -0
- package/dist/types/thread-message-response.d.ts.map +1 -0
- package/dist/types/thread-response.d.ts +14 -0
- package/dist/types/thread-response.d.ts.map +1 -0
- package/dist/types/thread-run-create-request.d.ts +36 -0
- package/dist/types/thread-run-create-request.d.ts.map +1 -0
- package/dist/types/tool-call.d.ts +11 -0
- package/dist/types/tool-call.d.ts.map +1 -0
- package/dist/types/tool.d.ts +9 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/top-logprob.d.ts +10 -0
- package/dist/types/top-logprob.d.ts.map +1 -0
- package/dist/types/transcription-response.d.ts +11 -0
- package/dist/types/transcription-response.d.ts.map +1 -0
- package/dist/types/truncation-strategy.d.ts +8 -0
- package/dist/types/truncation-strategy.d.ts.map +1 -0
- package/dist/types/update-chat-completion-request.d.ts +3 -0
- package/dist/types/update-chat-completion-request.d.ts.map +1 -0
- package/dist/types/update-completion-request.d.ts +2 -0
- package/dist/types/update-completion-request.d.ts.map +1 -0
- package/dist/types/update-run-request.d.ts +3 -0
- package/dist/types/update-run-request.d.ts.map +1 -0
- package/dist/types/upload-file-request.d.ts +5 -0
- package/dist/types/upload-file-request.d.ts.map +1 -0
- package/dist/types/usage.d.ts +16 -0
- package/dist/types/usage.d.ts.map +1 -0
- package/dist/types/video-error.d.ts +12 -0
- package/dist/types/video-error.d.ts.map +1 -0
- package/dist/types/video-generation-request.d.ts +20 -0
- package/dist/types/video-generation-request.d.ts.map +1 -0
- package/dist/types/word.d.ts +6 -0
- package/dist/types/word.d.ts.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/http/client.ts","../src/api/paths.ts","../src/api/chat.ts","../src/api/videos.ts","../src/api/threads.ts","../src/api/responses.ts","../src/api/rerank.ts","../src/api/music.ts","../src/api/moderations.ts","../src/api/chat-completions.ts","../src/api/knowledge-bases.ts","../src/api/images.ts","../src/api/files.ts","../src/api/embeddings.ts","../src/api/context.ts","../src/api/batches.ts","../src/api/audio.ts","../src/api/assistants.ts","../src/api/models.ts","../src/sdk.ts","../src/api/base.ts"],"sourcesContent":["import type { SdkworkAiConfig } from '../types/common';\nimport type { RequestOptions, QueryParams } from '@sdkwork/sdk-common';\nimport type { AuthTokenManager } from '@sdkwork/sdk-common';\nimport { BaseHttpClient, withRetry } from '@sdkwork/sdk-common';\n\nexport class HttpClient extends BaseHttpClient {\n private static readonly API_KEY_HEADER = 'Authorization';\n private static readonly API_KEY_USE_BEARER = true;\n\n constructor(config: SdkworkAiConfig) {\n super(config as any);\n }\n\n private getInternalAuthConfig(): any {\n const self = this as any;\n self.authConfig = self.authConfig || {};\n return self.authConfig;\n }\n\n private getInternalHeaders(): Record<string, string> {\n const self = this as any;\n self.config = self.config || {};\n self.config.headers = self.config.headers || {};\n return self.config.headers;\n }\n\n setApiKey(apiKey: string): void {\n const authConfig = this.getInternalAuthConfig();\n const headers = this.getInternalHeaders();\n authConfig.apiKey = apiKey;\n authConfig.tokenManager?.clearTokens?.();\n\n if (HttpClient.API_KEY_HEADER === 'Authorization' && HttpClient.API_KEY_USE_BEARER) {\n authConfig.authMode = 'apikey';\n delete headers['Access-Token'];\n return;\n }\n\n authConfig.authMode = 'dual-token';\n headers[HttpClient.API_KEY_HEADER] = HttpClient.API_KEY_USE_BEARER\n ? `Bearer ${apiKey}`\n : apiKey;\n\n if (HttpClient.API_KEY_HEADER.toLowerCase() !== 'authorization') {\n delete headers['Authorization'];\n }\n if (HttpClient.API_KEY_HEADER.toLowerCase() !== 'access-token') {\n delete headers['Access-Token'];\n }\n }\n\n setAuthToken(token: string): void {\n const headers = this.getInternalHeaders();\n if (HttpClient.API_KEY_HEADER.toLowerCase() !== 'authorization') {\n delete headers[HttpClient.API_KEY_HEADER];\n }\n super.setAuthToken(token);\n }\n\n setAccessToken(token: string): void {\n const headers = this.getInternalHeaders();\n if (HttpClient.API_KEY_HEADER.toLowerCase() !== 'access-token') {\n delete headers[HttpClient.API_KEY_HEADER];\n }\n super.setAccessToken(token);\n }\n\n setTokenManager(manager: AuthTokenManager): void {\n const baseProto = Object.getPrototypeOf(HttpClient.prototype) as { setTokenManager?: (this: HttpClient, m: AuthTokenManager) => void };\n if (typeof baseProto.setTokenManager === 'function') {\n baseProto.setTokenManager.call(this, manager);\n return;\n }\n this.getInternalAuthConfig().tokenManager = manager;\n }\n\n async request<T>(path: string, options: RequestOptions = {}): Promise<T> {\n const execute = (this as any).execute;\n if (typeof execute !== 'function') {\n throw new Error('BaseHttpClient execute method is not available');\n }\n return withRetry(\n () => execute.call(this, { \n url: path, \n method: options.method ?? 'GET', \n ...options \n }),\n { maxRetries: 3 }\n );\n }\n\n async get<T>(path: string, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.request<T>(path, { method: 'GET', params, headers });\n }\n\n async post<T>(path: string, body?: unknown, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.request<T>(path, { method: 'POST', body, params, headers });\n }\n\n async put<T>(path: string, body?: unknown, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.request<T>(path, { method: 'PUT', body, params, headers });\n }\n\n async delete<T>(path: string, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.request<T>(path, { method: 'DELETE', params, headers });\n }\n\n async patch<T>(path: string, body?: unknown, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.request<T>(path, { method: 'PATCH', body, params, headers });\n }\n}\n\nexport function createHttpClient(config: SdkworkAiConfig): HttpClient {\n return new HttpClient(config);\n}\n","export const AI_API_PREFIX = '/ai/v3';\n\nexport function aiApiPath(path: string): string {\n if (!path) {\n return AI_API_PREFIX;\n }\n if (/^https?:\\/\\//i.test(path)) {\n return path;\n }\n const normalizedPrefixRaw = (AI_API_PREFIX || '').trim();\n const normalizedPrefix = normalizedPrefixRaw\n ? `/${normalizedPrefixRaw.replace(/^\\/+|\\/+$/g, '')}`\n : '';\n const normalizedPath = path.startsWith('/') ? path : `/${path}`;\n\n if (!normalizedPrefix || normalizedPrefix === '/') {\n return normalizedPath;\n }\n if (normalizedPath === normalizedPrefix || normalizedPath.startsWith(`${normalizedPrefix}/`)) {\n return normalizedPath;\n }\n return `${normalizedPrefix}${normalizedPath}`;\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { ChatCompletionDeleteResponse, ChatCompletionList, ChatCompletionRequest, ChatCompletionResponse, ChatMessageList, CountClaudeTokensRequest, CountClaudeTokensResponse, CreateChatCompletionResponse, CreateClaudeMessageRequest, CreateClaudeMessageResponse, PatchUpdateCompletionRequest, UpdateCompletionRequest } from '../types';\n\n\nexport class ChatApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Get chat completion */\n async getCompletion(completion_id: string | number): Promise<ChatCompletionResponse> {\n return this.client.get<ChatCompletionResponse>(aiApiPath(`/chat/completions/${completion_id}`));\n }\n\n/** Update chat completion */\n async updateCompletion(completion_id: string | number, body: UpdateCompletionRequest): Promise<ChatCompletionResponse> {\n return this.client.post<ChatCompletionResponse>(aiApiPath(`/chat/completions/${completion_id}`), body);\n }\n\n/** Delete chat completion */\n async deleteCompletion(completion_id: string | number): Promise<ChatCompletionDeleteResponse> {\n return this.client.delete<ChatCompletionDeleteResponse>(aiApiPath(`/chat/completions/${completion_id}`));\n }\n\n/** Update chat completion */\n async patchUpdateCompletion(completion_id: string | number, body: PatchUpdateCompletionRequest): Promise<ChatCompletionResponse> {\n return this.client.patch<ChatCompletionResponse>(aiApiPath(`/chat/completions/${completion_id}`), body);\n }\n\n/** Count Claude tokens */\n async countClaudeTokens(body: CountClaudeTokensRequest): Promise<CountClaudeTokensResponse> {\n return this.client.post<CountClaudeTokensResponse>(aiApiPath(`/messages/count_tokens`), body);\n }\n\n/** Create Claude message */\n async createClaudeMessage(body: CreateClaudeMessageRequest, headers?: Record<string, string>): Promise<CreateClaudeMessageResponse> {\n return this.client.post<CreateClaudeMessageResponse>(aiApiPath(`/messages`), body, undefined, headers);\n }\n\n/** List chat completions */\n async listCompletions(params?: QueryParams): Promise<ChatCompletionList> {\n return this.client.get<ChatCompletionList>(aiApiPath(`/chat/completions`), params);\n }\n\n/** Create chat completion */\n async createChatCompletion(body: ChatCompletionRequest): Promise<CreateChatCompletionResponse> {\n return this.client.post<CreateChatCompletionResponse>(aiApiPath(`/chat/completions`), body);\n }\n\n/** Get chat completion messages */\n async getMessages(completion_id: string | number, params?: QueryParams): Promise<ChatMessageList> {\n return this.client.get<ChatMessageList>(aiApiPath(`/chat/completions/${completion_id}/messages`), params);\n }\n}\n\nexport function createChatApi(client: HttpClient): ChatApi {\n return new ChatApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { OpenAiVideo, OpenAiVideoDeleteResponse, OpenAiVideoList, VideoGenerationRequest } from '../types';\n\n\nexport class VideosApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** List videos */\n async listVideos(params?: QueryParams): Promise<OpenAiVideoList> {\n return this.client.get<OpenAiVideoList>(aiApiPath(`/videos`), params);\n }\n\n/** Create video */\n async createVideo(body: VideoGenerationRequest): Promise<OpenAiVideo> {\n return this.client.post<OpenAiVideo>(aiApiPath(`/videos`), body);\n }\n\n/** Retrieve video */\n async retrieveVideo(videoId: string | number): Promise<OpenAiVideo> {\n return this.client.get<OpenAiVideo>(aiApiPath(`/videos/${videoId}`));\n }\n\n/** Delete video */\n async deleteVideo(videoId: string | number): Promise<OpenAiVideoDeleteResponse> {\n return this.client.delete<OpenAiVideoDeleteResponse>(aiApiPath(`/videos/${videoId}`));\n }\n}\n\nexport function createVideosApi(client: HttpClient): VideosApi {\n return new VideosApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { CreateRunResponse, CreateThreadAndRunResponse, RunCreateRequest, RunListResponse, RunResponse, RunStepListResponse, RunStepResponse, SubmitToolOutputsRequest, SubmitToolOutputsResponse, ThreadCreateRequest, ThreadDeleteResponse, ThreadMessageCreateRequest, ThreadMessageListResponse, ThreadMessageModifyRequest, ThreadMessageResponse, ThreadResponse, ThreadRunCreateRequest, UpdateRunRequest } from '../types';\n\n\nexport class ThreadsApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Submit tool outputs */\n async submitToolOutputs(thread_id: string | number, run_id: string | number, body: SubmitToolOutputsRequest): Promise<SubmitToolOutputsResponse> {\n return this.client.post<SubmitToolOutputsResponse>(aiApiPath(`/threads/${thread_id}/runs/${run_id}/submit_tool_outputs`), body);\n }\n\n/** Cancel run */\n async cancelRun(thread_id: string | number, run_id: string | number): Promise<RunResponse> {\n return this.client.post<RunResponse>(aiApiPath(`/threads/${thread_id}/runs/${run_id}/cancel`));\n }\n\n/** Get run */\n async getRun(thread_id: string | number, run_id: string | number): Promise<RunResponse> {\n return this.client.get<RunResponse>(aiApiPath(`/threads/${thread_id}/runs/${run_id}`));\n }\n\n/** Modify run */\n async updateRun(thread_id: string | number, run_id: string | number, body: UpdateRunRequest): Promise<RunResponse> {\n return this.client.post<RunResponse>(aiApiPath(`/threads/${thread_id}/runs/${run_id}`), body);\n }\n\n/** List runs */\n async listRuns(thread_id: string | number, params?: QueryParams): Promise<RunListResponse> {\n return this.client.get<RunListResponse>(aiApiPath(`/threads/${thread_id}/runs`), params);\n }\n\n/** Create run */\n async createRun(thread_id: string | number, body: RunCreateRequest): Promise<CreateRunResponse> {\n return this.client.post<CreateRunResponse>(aiApiPath(`/threads/${thread_id}/runs`), body);\n }\n\n/** Get thread message */\n async getThreadMessage(thread_id: string | number, message_id: string | number): Promise<ThreadMessageResponse> {\n return this.client.get<ThreadMessageResponse>(aiApiPath(`/threads/${thread_id}/messages/${message_id}`));\n }\n\n/** Modify thread message */\n async updateThreadMessage(thread_id: string | number, message_id: string | number, body: ThreadMessageModifyRequest): Promise<ThreadMessageResponse> {\n return this.client.post<ThreadMessageResponse>(aiApiPath(`/threads/${thread_id}/messages/${message_id}`), body);\n }\n\n/** List thread messages */\n async listThreadMessages(thread_id: string | number, params?: QueryParams): Promise<ThreadMessageListResponse> {\n return this.client.get<ThreadMessageListResponse>(aiApiPath(`/threads/${thread_id}/messages`), params);\n }\n\n/** Create thread message */\n async createThreadMessage(thread_id: string | number, body: ThreadMessageCreateRequest): Promise<ThreadMessageResponse> {\n return this.client.post<ThreadMessageResponse>(aiApiPath(`/threads/${thread_id}/messages`), body);\n }\n\n/** Get thread */\n async getThread(thread_id: string | number): Promise<ThreadResponse> {\n return this.client.get<ThreadResponse>(aiApiPath(`/threads/${thread_id}`));\n }\n\n/** Update thread */\n async updateThread(thread_id: string | number, body: ThreadCreateRequest): Promise<ThreadResponse> {\n return this.client.post<ThreadResponse>(aiApiPath(`/threads/${thread_id}`), body);\n }\n\n/** Delete thread */\n async deleteThread(thread_id: string | number): Promise<ThreadDeleteResponse> {\n return this.client.delete<ThreadDeleteResponse>(aiApiPath(`/threads/${thread_id}`));\n }\n\n/** Create thread and run */\n async createThreadAndRun(body: ThreadRunCreateRequest): Promise<CreateThreadAndRunResponse> {\n return this.client.post<CreateThreadAndRunResponse>(aiApiPath(`/threads/runs`), body);\n }\n\n/** Create thread */\n async createThread(body: ThreadCreateRequest): Promise<ThreadResponse> {\n return this.client.post<ThreadResponse>(aiApiPath(`/threads`), body);\n }\n\n/** Get run step */\n async getRunStep(thread_id: string | number, run_id: string | number, step_id: string | number): Promise<RunStepResponse> {\n return this.client.get<RunStepResponse>(aiApiPath(`/threads/${thread_id}/runs/${run_id}/steps/${step_id}`));\n }\n\n/** List run steps */\n async listRunSteps(thread_id: string | number, run_id: string | number, params?: QueryParams): Promise<RunStepListResponse> {\n return this.client.get<RunStepListResponse>(aiApiPath(`/threads/${thread_id}/runs/${run_id}/steps`), params);\n }\n}\n\nexport function createThreadsApi(client: HttpClient): ThreadsApi {\n return new ThreadsApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { CancelResponseResponse, CreateResponseRequest, CreateResponseResponse, DeleteResponseResponse, GetResponseResponse, ListResponseInputItemsResponse } from '../types';\n\n\nexport class ResponsesApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Cancel response */\n async cancelResponse(response_id: string | number): Promise<CancelResponseResponse> {\n return this.client.post<CancelResponseResponse>(aiApiPath(`/responses/${response_id}/cancel`));\n }\n\n/** Create response */\n async createResponse(body: CreateResponseRequest): Promise<CreateResponseResponse> {\n return this.client.post<CreateResponseResponse>(aiApiPath(`/responses`), body);\n }\n\n/** List response input items */\n async listResponseInputItems(response_id: string | number): Promise<ListResponseInputItemsResponse> {\n return this.client.get<ListResponseInputItemsResponse>(aiApiPath(`/responses/${response_id}/input_items`));\n }\n\n/** Get response */\n async getResponse(response_id: string | number): Promise<GetResponseResponse> {\n return this.client.get<GetResponseResponse>(aiApiPath(`/responses/${response_id}`));\n }\n\n/** Delete response */\n async deleteResponse(response_id: string | number): Promise<DeleteResponseResponse> {\n return this.client.delete<DeleteResponseResponse>(aiApiPath(`/responses/${response_id}`));\n }\n}\n\nexport function createResponsesApi(client: HttpClient): ResponsesApi {\n return new ResponsesApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { RerankRequest, RerankResponse } from '../types';\n\n\nexport class RerankApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Rerank documents */\n async rerank(body: RerankRequest): Promise<RerankResponse> {\n return this.client.post<RerankResponse>(aiApiPath(`/rerank`), body);\n }\n}\n\nexport function createRerankApi(client: HttpClient): RerankApi {\n return new RerankApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { MusicGenerationRequest, SunoMusic, SunoMusicDeleteResponse, SunoMusicList } from '../types';\n\n\nexport class MusicApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Generate music */\n async generate(body: MusicGenerationRequest): Promise<SunoMusic> {\n return this.client.post<SunoMusic>(aiApiPath(`/music/generations`), body);\n }\n\n/** Retrieve music */\n async retrieve(musicId: string | number): Promise<SunoMusic> {\n return this.client.get<SunoMusic>(aiApiPath(`/music/${musicId}`));\n }\n\n/** Delete music */\n async deleteMusic(musicId: string | number): Promise<SunoMusicDeleteResponse> {\n return this.client.delete<SunoMusicDeleteResponse>(aiApiPath(`/music/${musicId}`));\n }\n\n/** List music */\n async listMusic(params?: QueryParams): Promise<SunoMusicList> {\n return this.client.get<SunoMusicList>(aiApiPath(`/music`), params);\n }\n}\n\nexport function createMusicApi(client: HttpClient): MusicApi {\n return new MusicApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { ModerationRequest, ModerationResponse } from '../types';\n\n\nexport class ModerationsApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Create moderation */\n async createModeration(body: ModerationRequest): Promise<ModerationResponse> {\n return this.client.post<ModerationResponse>(aiApiPath(`/moderations`), body);\n }\n}\n\nexport function createModerationsApi(client: HttpClient): ModerationsApi {\n return new ModerationsApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { ChatCompletionDeleteResponse, ChatCompletionList, ChatCompletionResponse, ChatMessageList, UpdateChatCompletionRequest } from '../types';\n\n\nexport class ChatCompletionsApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Get chat completion */\n async getChatCompletion(completionId: string | number): Promise<ChatCompletionResponse> {\n return this.client.get<ChatCompletionResponse>(aiApiPath(`/management/chat/completions/${completionId}`));\n }\n\n/** Update chat completion */\n async updateChatCompletion(completionId: string | number, body: UpdateChatCompletionRequest): Promise<ChatCompletionResponse> {\n return this.client.post<ChatCompletionResponse>(aiApiPath(`/management/chat/completions/${completionId}`), body);\n }\n\n/** Delete chat completion */\n async deleteChatCompletion(completionId: string | number): Promise<ChatCompletionDeleteResponse> {\n return this.client.delete<ChatCompletionDeleteResponse>(aiApiPath(`/management/chat/completions/${completionId}`));\n }\n\n/** Get chat messages */\n async getChatMessages(completionId: string | number, params?: QueryParams): Promise<ChatMessageList> {\n return this.client.get<ChatMessageList>(aiApiPath(`/management/chat/completions/${completionId}/messages`), params);\n }\n\n/** List chat completions */\n async listChatCompletions(params?: QueryParams): Promise<ChatCompletionList> {\n return this.client.get<ChatCompletionList>(aiApiPath(`/management/chat/completions`), params);\n }\n}\n\nexport function createChatCompletionsApi(client: HttpClient): ChatCompletionsApi {\n return new ChatCompletionsApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { DocumentAddRequest, DocumentResponse, KnowledgeBaseCreateRequest, KnowledgeBaseListResponse, KnowledgeBaseResponse, KnowledgeSearchRequest, KnowledgeSearchResponse, ListDocumentsResponse } from '../types';\n\n\nexport class KnowledgeBasesApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** List documents */\n async listDocuments(knowledgeBaseId: string | number, params?: QueryParams): Promise<ListDocumentsResponse> {\n return this.client.get<ListDocumentsResponse>(aiApiPath(`/knowledge-bases/${knowledgeBaseId}/documents`), params);\n }\n\n/** Add document */\n async addDocument(knowledgeBaseId: string | number, body: DocumentAddRequest): Promise<DocumentResponse> {\n return this.client.post<DocumentResponse>(aiApiPath(`/knowledge-bases/${knowledgeBaseId}/documents`), body);\n }\n\n/** Search knowledge */\n async searchKnowledge(body: KnowledgeSearchRequest): Promise<KnowledgeSearchResponse> {\n return this.client.post<KnowledgeSearchResponse>(aiApiPath(`/knowledge-bases/search`), body);\n }\n\n/** List knowledge bases */\n async listKnowledgeBases(params?: QueryParams): Promise<KnowledgeBaseListResponse> {\n return this.client.get<KnowledgeBaseListResponse>(aiApiPath(`/knowledge-bases`), params);\n }\n\n/** Create knowledge base */\n async createKnowledgeBase(body: KnowledgeBaseCreateRequest): Promise<KnowledgeBaseResponse> {\n return this.client.post<KnowledgeBaseResponse>(aiApiPath(`/knowledge-bases`), body);\n }\n\n/** Get document */\n async getDocument(knowledgeBaseId: string | number, documentId: string | number): Promise<DocumentResponse> {\n return this.client.get<DocumentResponse>(aiApiPath(`/knowledge-bases/${knowledgeBaseId}/documents/${documentId}`));\n }\n\n/** Delete document */\n async deleteDocument(knowledgeBaseId: string | number, documentId: string | number): Promise<void> {\n return this.client.delete<void>(aiApiPath(`/knowledge-bases/${knowledgeBaseId}/documents/${documentId}`));\n }\n\n/** Get knowledge base */\n async getKnowledgeBase(knowledgeBaseId: string | number): Promise<KnowledgeBaseResponse> {\n return this.client.get<KnowledgeBaseResponse>(aiApiPath(`/knowledge-bases/${knowledgeBaseId}`));\n }\n\n/** Delete knowledge base */\n async deleteKnowledgeBase(knowledgeBaseId: string | number): Promise<void> {\n return this.client.delete<void>(aiApiPath(`/knowledge-bases/${knowledgeBaseId}`));\n }\n}\n\nexport function createKnowledgeBasesApi(client: HttpClient): KnowledgeBasesApi {\n return new KnowledgeBasesApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { ImageGenerationRequest, ImageGenerationResponse } from '../types';\n\n\nexport class ImagesApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Create image variation */\n async createImageVariation(body: ImageGenerationRequest): Promise<ImageGenerationResponse> {\n return this.client.post<ImageGenerationResponse>(aiApiPath(`/images/variations`), body);\n }\n\n/** Create image */\n async createImage(body: ImageGenerationRequest): Promise<ImageGenerationResponse> {\n return this.client.post<ImageGenerationResponse>(aiApiPath(`/images/generations`), body);\n }\n\n/** Create image edit */\n async createImageEdit(body: ImageGenerationRequest): Promise<ImageGenerationResponse> {\n return this.client.post<ImageGenerationResponse>(aiApiPath(`/images/edits`), body);\n }\n}\n\nexport function createImagesApi(client: HttpClient): ImagesApi {\n return new ImagesApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { OpenAiFileDeleteResponse, OpenAiFileList, OpenAiFileObject } from '../types';\n\n\nexport class FilesApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** List files */\n async listFiles(params?: QueryParams): Promise<OpenAiFileList> {\n return this.client.get<OpenAiFileList>(aiApiPath(`/files`), params);\n }\n\n/** Upload file */\n async uploadFile(body?: FormData, params?: QueryParams): Promise<OpenAiFileObject> {\n return this.client.post<OpenAiFileObject>(aiApiPath(`/files`), body, params);\n }\n\n/** Retrieve file content */\n async retrieveFileContent(fileId: string | number): Promise<string> {\n return this.client.get<string>(aiApiPath(`/files/${fileId}/content`));\n }\n\n/** Retrieve file */\n async retrieveFile(fileId: string | number): Promise<OpenAiFileObject> {\n return this.client.get<OpenAiFileObject>(aiApiPath(`/files/${fileId}`));\n }\n\n/** Delete file */\n async deleteFile(fileId: string | number): Promise<OpenAiFileDeleteResponse> {\n return this.client.delete<OpenAiFileDeleteResponse>(aiApiPath(`/files/${fileId}`));\n }\n}\n\nexport function createFilesApi(client: HttpClient): FilesApi {\n return new FilesApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { EmbeddingRequest, EmbeddingResponse } from '../types';\n\n\nexport class EmbeddingsApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Create embeddings */\n async createEmbedding(body: EmbeddingRequest): Promise<EmbeddingResponse> {\n return this.client.post<EmbeddingResponse>(aiApiPath(`/embeddings`), body);\n }\n}\n\nexport function createEmbeddingsApi(client: HttpClient): EmbeddingsApi {\n return new EmbeddingsApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { ChatWithContextRequest, ContextCreateRequest, ContextResponse } from '../types';\n\n\nexport class ContextApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Chat with context */\n async chatWith(contextId: string | number, body: ChatWithContextRequest): Promise<ContextResponse> {\n return this.client.post<ContextResponse>(aiApiPath(`/context/${contextId}/chat/completions`), body);\n }\n\n/** Create context */\n async createContext(body: ContextCreateRequest): Promise<ContextResponse> {\n return this.client.post<ContextResponse>(aiApiPath(`/context/create`), body);\n }\n\n/** Get context */\n async getContext(contextId: string | number): Promise<ContextResponse> {\n return this.client.get<ContextResponse>(aiApiPath(`/context/${contextId}`));\n }\n\n/** Delete context */\n async deleteContext(contextId: string | number): Promise<void> {\n return this.client.delete<void>(aiApiPath(`/context/${contextId}`));\n }\n}\n\nexport function createContextApi(client: HttpClient): ContextApi {\n return new ContextApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { BatchCreateRequest, BatchListResponse, BatchResponse } from '../types';\n\n\nexport class BatchesApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Cancel batch */\n async cancelBatch(batch_id: string | number): Promise<BatchResponse> {\n return this.client.post<BatchResponse>(aiApiPath(`/batches/${batch_id}/cancel`));\n }\n\n/** List batches */\n async listBatches(params?: QueryParams): Promise<BatchListResponse> {\n return this.client.get<BatchListResponse>(aiApiPath(`/batches`), params);\n }\n\n/** Create batch */\n async createBatch(body: BatchCreateRequest): Promise<BatchResponse> {\n return this.client.post<BatchResponse>(aiApiPath(`/batches`), body);\n }\n\n/** Get batch */\n async getBatch(batch_id: string | number): Promise<BatchResponse> {\n return this.client.get<BatchResponse>(aiApiPath(`/batches/${batch_id}`));\n }\n}\n\nexport function createBatchesApi(client: HttpClient): BatchesApi {\n return new BatchesApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { SpeechRequest, TranscriptionResponse } from '../types';\n\n\nexport class AudioApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Create translation */\n async createTranslation(body?: FormData, params?: QueryParams): Promise<TranscriptionResponse> {\n return this.client.post<TranscriptionResponse>(aiApiPath(`/audio/translations`), body, params);\n }\n\n/** Create transcription */\n async createTranscription(body?: FormData, params?: QueryParams): Promise<TranscriptionResponse> {\n return this.client.post<TranscriptionResponse>(aiApiPath(`/audio/transcriptions`), body, params);\n }\n\n/** Create speech */\n async createSpeech(body: SpeechRequest): Promise<string> {\n return this.client.post<string>(aiApiPath(`/audio/speech`), body);\n }\n}\n\nexport function createAudioApi(client: HttpClient): AudioApi {\n return new AudioApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { AssistantCreateRequest, AssistantDeleteResponse, AssistantListResponse, AssistantResponse } from '../types';\n\n\nexport class AssistantsApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Get assistant */\n async getAssistant(assistant_id: string | number): Promise<AssistantResponse> {\n return this.client.get<AssistantResponse>(aiApiPath(`/assistants/${assistant_id}`));\n }\n\n/** Update assistant */\n async updateAssistant(assistant_id: string | number, body: AssistantCreateRequest): Promise<AssistantResponse> {\n return this.client.post<AssistantResponse>(aiApiPath(`/assistants/${assistant_id}`), body);\n }\n\n/** Delete assistant */\n async deleteAssistant(assistant_id: string | number): Promise<AssistantDeleteResponse> {\n return this.client.delete<AssistantDeleteResponse>(aiApiPath(`/assistants/${assistant_id}`));\n }\n\n/** List assistants */\n async listAssistants(params?: QueryParams): Promise<AssistantListResponse> {\n return this.client.get<AssistantListResponse>(aiApiPath(`/assistants`), params);\n }\n\n/** Create assistant */\n async createAssistant(body: AssistantCreateRequest): Promise<AssistantResponse> {\n return this.client.post<AssistantResponse>(aiApiPath(`/assistants`), body);\n }\n}\n\nexport function createAssistantsApi(client: HttpClient): AssistantsApi {\n return new AssistantsApi(client);\n}\n","import { aiApiPath } from './paths';\nimport type { HttpClient } from '../http/client';\nimport type { QueryParams } from '../types/common';\nimport type { OpenAiModel, OpenAiModelDeleteResponse, OpenAiModelList } from '../types';\n\n\nexport class ModelsApi {\n private client: HttpClient;\n \n constructor(client: HttpClient) { \n this.client = client; \n }\n\n/** Retrieve model */\n async retrieveModel(model: string | number): Promise<OpenAiModel> {\n return this.client.get<OpenAiModel>(aiApiPath(`/models/${model}`));\n }\n\n/** Delete model */\n async deleteModel(model: string | number): Promise<OpenAiModelDeleteResponse> {\n return this.client.delete<OpenAiModelDeleteResponse>(aiApiPath(`/models/${model}`));\n }\n\n/** List models */\n async listModels(): Promise<OpenAiModelList> {\n return this.client.get<OpenAiModelList>(aiApiPath(`/models`));\n }\n}\n\nexport function createModelsApi(client: HttpClient): ModelsApi {\n return new ModelsApi(client);\n}\n","import { HttpClient, createHttpClient } from './http/client';\nimport type { SdkworkAiConfig } from './types/common';\nimport type { AuthTokenManager } from '@sdkwork/sdk-common';\n\nimport { ChatApi, createChatApi } from './api/chat';\nimport { VideosApi, createVideosApi } from './api/videos';\nimport { ThreadsApi, createThreadsApi } from './api/threads';\nimport { ResponsesApi, createResponsesApi } from './api/responses';\nimport { RerankApi, createRerankApi } from './api/rerank';\nimport { MusicApi, createMusicApi } from './api/music';\nimport { ModerationsApi, createModerationsApi } from './api/moderations';\nimport { ChatCompletionsApi, createChatCompletionsApi } from './api/chat-completions';\nimport { KnowledgeBasesApi, createKnowledgeBasesApi } from './api/knowledge-bases';\nimport { ImagesApi, createImagesApi } from './api/images';\nimport { FilesApi, createFilesApi } from './api/files';\nimport { EmbeddingsApi, createEmbeddingsApi } from './api/embeddings';\nimport { ContextApi, createContextApi } from './api/context';\nimport { BatchesApi, createBatchesApi } from './api/batches';\nimport { AudioApi, createAudioApi } from './api/audio';\nimport { AssistantsApi, createAssistantsApi } from './api/assistants';\nimport { ModelsApi, createModelsApi } from './api/models';\n\nexport class SdkworkAiClient {\n private httpClient: HttpClient;\n\n public readonly chat: ChatApi;\n public readonly videos: VideosApi;\n public readonly threads: ThreadsApi;\n public readonly responses: ResponsesApi;\n public readonly rerank: RerankApi;\n public readonly music: MusicApi;\n public readonly moderations: ModerationsApi;\n public readonly chatCompletions: ChatCompletionsApi;\n public readonly knowledgeBases: KnowledgeBasesApi;\n public readonly images: ImagesApi;\n public readonly files: FilesApi;\n public readonly embeddings: EmbeddingsApi;\n public readonly context: ContextApi;\n public readonly batches: BatchesApi;\n public readonly audio: AudioApi;\n public readonly assistants: AssistantsApi;\n public readonly models: ModelsApi;\n\n constructor(config: SdkworkAiConfig) {\n this.httpClient = createHttpClient(config);\n this.chat = createChatApi(this.httpClient);\n\n this.videos = createVideosApi(this.httpClient);\n\n this.threads = createThreadsApi(this.httpClient);\n\n this.responses = createResponsesApi(this.httpClient);\n\n this.rerank = createRerankApi(this.httpClient);\n\n this.music = createMusicApi(this.httpClient);\n\n this.moderations = createModerationsApi(this.httpClient);\n\n this.chatCompletions = createChatCompletionsApi(this.httpClient);\n\n this.knowledgeBases = createKnowledgeBasesApi(this.httpClient);\n\n this.images = createImagesApi(this.httpClient);\n\n this.files = createFilesApi(this.httpClient);\n\n this.embeddings = createEmbeddingsApi(this.httpClient);\n\n this.context = createContextApi(this.httpClient);\n\n this.batches = createBatchesApi(this.httpClient);\n\n this.audio = createAudioApi(this.httpClient);\n\n this.assistants = createAssistantsApi(this.httpClient);\n\n this.models = createModelsApi(this.httpClient);\n }\n\n setApiKey(apiKey: string): this {\n this.httpClient.setApiKey(apiKey);\n return this;\n }\n\n setAuthToken(token: string): this {\n this.httpClient.setAuthToken(token);\n return this;\n }\n\n setAccessToken(token: string): this {\n this.httpClient.setAccessToken(token);\n return this;\n }\n\n setTokenManager(manager: AuthTokenManager): this {\n this.httpClient.setTokenManager(manager);\n return this;\n }\n\n get http(): HttpClient {\n return this.httpClient;\n }\n}\n\nexport function createClient(config: SdkworkAiConfig): SdkworkAiClient {\n return new SdkworkAiClient(config);\n}\n\nexport default SdkworkAiClient;\n","import type { QueryParams } from '../types/common';\nimport type { HttpClient } from '../http/client';\n\nexport abstract class BaseApi {\n constructor(\n protected http: HttpClient,\n protected basePath: string\n ) {}\n\n protected async get<T>(path: string, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.http.get<T>(`${this.basePath}${path}`, params, headers);\n }\n\n protected async post<T>(path: string, body?: unknown, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.http.post<T>(`${this.basePath}${path}`, body, params, headers);\n }\n\n protected async put<T>(path: string, body?: unknown, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.http.put<T>(`${this.basePath}${path}`, body, params, headers);\n }\n\n protected async delete<T>(path: string, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.http.delete<T>(`${this.basePath}${path}`, params, headers);\n }\n\n protected async patch<T>(path: string, body?: unknown, params?: QueryParams, headers?: Record<string, string>): Promise<T> {\n return this.http.patch<T>(`${this.basePath}${path}`, body, params, headers);\n }\n}\n"],"names":["_HttpClient","BaseHttpClient","config","self","apiKey","authConfig","headers","token","manager","baseProto","path","options","execute","withRetry","params","body","HttpClient","createHttpClient","AI_API_PREFIX","aiApiPath","normalizedPrefixRaw","normalizedPrefix","normalizedPath","ChatApi","client","completion_id","createChatApi","VideosApi","videoId","createVideosApi","ThreadsApi","thread_id","run_id","message_id","step_id","createThreadsApi","ResponsesApi","response_id","createResponsesApi","RerankApi","createRerankApi","MusicApi","musicId","createMusicApi","ModerationsApi","createModerationsApi","ChatCompletionsApi","completionId","createChatCompletionsApi","KnowledgeBasesApi","knowledgeBaseId","documentId","createKnowledgeBasesApi","ImagesApi","createImagesApi","FilesApi","fileId","createFilesApi","EmbeddingsApi","createEmbeddingsApi","ContextApi","contextId","createContextApi","BatchesApi","batch_id","createBatchesApi","AudioApi","createAudioApi","AssistantsApi","assistant_id","createAssistantsApi","ModelsApi","model","createModelsApi","SdkworkAiClient","createClient","BaseApi","http","basePath"],"mappings":";;AAKO,MAAMA,IAAN,MAAMA,UAAmBC,EAAe;AAAA,EAI7C,YAAYC,GAAyB;AACnC,UAAMA,CAAa;AAAA,EACrB;AAAA,EAEQ,wBAA6B;AACnC,UAAMC,IAAO;AACb,WAAAA,EAAK,aAAaA,EAAK,cAAc,CAAA,GAC9BA,EAAK;AAAA,EACd;AAAA,EAEQ,qBAA6C;AACnD,UAAMA,IAAO;AACb,WAAAA,EAAK,SAASA,EAAK,UAAU,CAAA,GAC7BA,EAAK,OAAO,UAAUA,EAAK,OAAO,WAAW,CAAA,GACtCA,EAAK,OAAO;AAAA,EACrB;AAAA,EAEA,UAAUC,GAAsB;AAC9B,UAAMC,IAAa,KAAK,sBAAA,GAClBC,IAAU,KAAK,mBAAA;AAIrB,QAHAD,EAAW,SAASD,GACpBC,EAAW,cAAc,cAAA,GAErBL,EAAW,mBAAmB,mBAAmBA,EAAW,oBAAoB;AAClF,MAAAK,EAAW,WAAW,UACtB,OAAOC,EAAQ,cAAc;AAC7B;AAAA,IACF;AAEA,IAAAD,EAAW,WAAW,cACtBC,EAAQN,EAAW,cAAc,IAAIA,EAAW,qBAC5C,UAAUI,CAAM,KAChBA,GAEAJ,EAAW,eAAe,YAAA,MAAkB,mBAC9C,OAAOM,EAAQ,eAEbN,EAAW,eAAe,YAAA,MAAkB,kBAC9C,OAAOM,EAAQ,cAAc;AAAA,EAEjC;AAAA,EAEA,aAAaC,GAAqB;AAChC,UAAMD,IAAU,KAAK,mBAAA;AACrB,IAAIN,EAAW,eAAe,YAAA,MAAkB,mBAC9C,OAAOM,EAAQN,EAAW,cAAc,GAE1C,MAAM,aAAaO,CAAK;AAAA,EAC1B;AAAA,EAEA,eAAeA,GAAqB;AAClC,UAAMD,IAAU,KAAK,mBAAA;AACrB,IAAIN,EAAW,eAAe,YAAA,MAAk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AazE,GAA0C;AACrE,SAAO,IAAIwE,EAAgBxE,CAAM;AACnC;ACxGO,MAAe0E,EAAQ;AAAA,EAC5B,YACYC,GACAC,GACV;AAFU,SAAA,OAAAD,GACA,KAAA,WAAAC;AAAA,EACT;AAAA,EAEH,MAAgB,IAAOpE,GAAcI,GAAsBR,GAA8C;AACvG,WAAO,KAAK,KAAK,IAAO,GAAG,KAAK,QAAQ,GAAGI,CAAI,IAAII,GAAQR,CAAO;AAAA,EACpE;AAAA,EAEA,MAAgB,KAAQI,GAAcK,GAAgBD,GAAsBR,GAA8C;AACxH,WAAO,KAAK,KAAK,KAAQ,GAAG,KAAK,QAAQ,GAAGI,CAAI,IAAIK,GAAMD,GAAQR,CAAO;AAAA,EAC3E;AAAA,EAEA,MAAgB,IAAOI,GAAcK,GAAgBD,GAAsBR,GAA8C;AACvH,WAAO,KAAK,KAAK,IAAO,GAAG,KAAK,QAAQ,GAAGI,CAAI,IAAIK,GAAMD,GAAQR,CAAO;AAAA,EAC1E;AAAA,EAEA,MAAgB,OAAUI,GAAcI,GAAsBR,GAA8C;AAC1G,WAAO,KAAK,KAAK,OAAU,GAAG,KAAK,QAAQ,GAAGI,CAAI,IAAII,GAAQR,CAAO;AAAA,EACvE;AAAA,EAEA,MAAgB,MAASI,GAAcK,GAAgBD,GAAsBR,GAA8C;AACzH,WAAO,KAAK,KAAK,MAAS,GAAG,KAAK,QAAQ,GAAGI,CAAI,IAAIK,GAAMD,GAAQR,CAAO;AAAA,EAC5E;AACF;"}
|
package/dist/sdk.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { HttpClient } from './http/client';
|
|
2
|
+
import { SdkworkAiConfig } from './types/common';
|
|
3
|
+
import { AuthTokenManager } from '@sdkwork/sdk-common';
|
|
4
|
+
import { ChatApi } from './api/chat';
|
|
5
|
+
import { VideosApi } from './api/videos';
|
|
6
|
+
import { ThreadsApi } from './api/threads';
|
|
7
|
+
import { ResponsesApi } from './api/responses';
|
|
8
|
+
import { RerankApi } from './api/rerank';
|
|
9
|
+
import { MusicApi } from './api/music';
|
|
10
|
+
import { ModerationsApi } from './api/moderations';
|
|
11
|
+
import { ChatCompletionsApi } from './api/chat-completions';
|
|
12
|
+
import { KnowledgeBasesApi } from './api/knowledge-bases';
|
|
13
|
+
import { ImagesApi } from './api/images';
|
|
14
|
+
import { FilesApi } from './api/files';
|
|
15
|
+
import { EmbeddingsApi } from './api/embeddings';
|
|
16
|
+
import { ContextApi } from './api/context';
|
|
17
|
+
import { BatchesApi } from './api/batches';
|
|
18
|
+
import { AudioApi } from './api/audio';
|
|
19
|
+
import { AssistantsApi } from './api/assistants';
|
|
20
|
+
import { ModelsApi } from './api/models';
|
|
21
|
+
export declare class SdkworkAiClient {
|
|
22
|
+
private httpClient;
|
|
23
|
+
readonly chat: ChatApi;
|
|
24
|
+
readonly videos: VideosApi;
|
|
25
|
+
readonly threads: ThreadsApi;
|
|
26
|
+
readonly responses: ResponsesApi;
|
|
27
|
+
readonly rerank: RerankApi;
|
|
28
|
+
readonly music: MusicApi;
|
|
29
|
+
readonly moderations: ModerationsApi;
|
|
30
|
+
readonly chatCompletions: ChatCompletionsApi;
|
|
31
|
+
readonly knowledgeBases: KnowledgeBasesApi;
|
|
32
|
+
readonly images: ImagesApi;
|
|
33
|
+
readonly files: FilesApi;
|
|
34
|
+
readonly embeddings: EmbeddingsApi;
|
|
35
|
+
readonly context: ContextApi;
|
|
36
|
+
readonly batches: BatchesApi;
|
|
37
|
+
readonly audio: AudioApi;
|
|
38
|
+
readonly assistants: AssistantsApi;
|
|
39
|
+
readonly models: ModelsApi;
|
|
40
|
+
constructor(config: SdkworkAiConfig);
|
|
41
|
+
setApiKey(apiKey: string): this;
|
|
42
|
+
setAuthToken(token: string): this;
|
|
43
|
+
setAccessToken(token: string): this;
|
|
44
|
+
setTokenManager(manager: AuthTokenManager): this;
|
|
45
|
+
get http(): HttpClient;
|
|
46
|
+
}
|
|
47
|
+
export declare function createClient(config: SdkworkA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AAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAAa;IAE/B,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,MAAM,EAAE,SAAS,CAAC;IAClC,SAAgB,OAAO,EAAE,UAAU,CAAC;IACpC,SAAgB,SAAS,EAAE,YAAY,CAAC;IACxC,SAAgB,MAAM,EAAE,SAAS,CAAC;IAClC,SAAgB,KAAK,EAAE,QAAQ,CAAC;IAChC,SAAgB,WAAW,EAAE,cAAc,CAAC;IAC5C,SAAgB,eAAe,EAAE,kBAAkB,CAAC;IACpD,SAAgB,cAAc,EAAE,iBAAiB,CAAC;IAClD,SAAgB,MAAM,EAAE,SAAS,CAAC;IAClC,SAAgB,KAAK,EAAE,QAAQ,CAAC;IAChC,SAAgB,UAAU,EAAE,aAAa,CAAC;IAC1C,SAAgB,OAAO,EAAE,UAAU,CAAC;IACpC,SAAgB,OAAO,EAAE,UAAU,CAAC;IACpC,SAAgB,KAAK,EAAE,QAAQ,CAAC;IAChC,SAAgB,UAAU,EAAE,aAAa,CAAC;IAC1C,SAAgB,MAAM,EAAE,SAAS,CAAC;gBAEtB,MAAM,EAAE,eAAe;IAqCnC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKjC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKnC,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAKhD,IAAI,IAAI,IAAI,UAAU,CAErB;CACF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAErE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileCitation } from './file-citation';
|
|
2
|
+
/** Annotation */
|
|
3
|
+
export interface Annotation {
|
|
4
|
+
/** The type of annotation */
|
|
5
|
+
type?: string;
|
|
6
|
+
/** The text in the message content that needs to be replaced */
|
|
7
|
+
text?: string;
|
|
8
|
+
/** File citation details */
|
|
9
|
+
file_citation?: FileCitation;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/types/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,iBAAiB;AACjB,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ResponseFormat } from './response-format';
|
|
2
|
+
import { Tool } from './tool';
|
|
3
|
+
/** Assistant creation request */
|
|
4
|
+
export interface AssistantCreateRequest {
|
|
5
|
+
/** 模型ID */
|
|
6
|
+
model: string;
|
|
7
|
+
/** 助手名称 */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** 助手描述 */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** 系统指令 */
|
|
12
|
+
instructions?: string;
|
|
13
|
+
/** 工具列表 */
|
|
14
|
+
tools?: Tool[];
|
|
15
|
+
/** 元数据 */
|
|
16
|
+
metadata?: Record<string, string>;
|
|
17
|
+
/** 温度参数 */
|
|
18
|
+
temperature?: number;
|
|
19
|
+
/** 工具资源 */
|
|
20
|
+
tool_resources?: Record<string, unknown>;
|
|
21
|
+
/** 响应格式 */
|
|
22
|
+
response_format?: ResponseFormat;
|
|
23
|
+
/** Top P参数 */
|
|
24
|
+
top_p?: number;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=assistant-create-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-create-request.d.ts","sourceRoot":"","sources":["../../src/types/assistant-create-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,iCAAiC;AACjC,MAAM,WAAW,sBAAsB;IACrC,WAAW;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW;IACX,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,WAAW;IACX,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,cAAc;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** OpenAI assistant delete response */
|
|
2
|
+
export interface AssistantDeleteResponse {
|
|
3
|
+
/** Assistant id */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** Object type */
|
|
6
|
+
object?: string;
|
|
7
|
+
/** Delete success flag */
|
|
8
|
+
deleted?: boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=assistant-delete-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-delete-response.d.ts","sourceRoot":"","sources":["../../src/types/assistant-delete-response.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,MAAM,WAAW,uBAAuB;IACtC,mBAAmB;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AssistantResponse } from './assistant-response';
|
|
2
|
+
/** OpenAI assistant list response */
|
|
3
|
+
export interface AssistantListResponse {
|
|
4
|
+
/** Object type */
|
|
5
|
+
object?: string;
|
|
6
|
+
/** Assistant list */
|
|
7
|
+
data?: AssistantResponse[];
|
|
8
|
+
/** Whether more data exists */
|
|
9
|
+
has_more?: boolean;
|
|
10
|
+
/** First item id */
|
|
11
|
+
first_id?: string;
|
|
12
|
+
/** Last item id */
|
|
13
|
+
last_id?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=assistant-list-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-list-response.d.ts","sourceRoot":"","sources":["../../src/types/assistant-list-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,qCAAqC;AACrC,MAAM,WAAW,qBAAqB;IACpC,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,IAAI,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** 助手响应 */
|
|
2
|
+
export interface AssistantResponse {
|
|
3
|
+
/** 助手ID */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** 对象类型 */
|
|
6
|
+
object?: string;
|
|
7
|
+
/** 模型ID */
|
|
8
|
+
model?: string;
|
|
9
|
+
/** 助手名称 */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** 助手描述 */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** 系统指令 */
|
|
14
|
+
instructions?: string;
|
|
15
|
+
/** 工具列表 */
|
|
16
|
+
tools?: unknown[];
|
|
17
|
+
/** 元数据 */
|
|
18
|
+
metadata?: Record<string, string>;
|
|
19
|
+
/** 温度参数 */
|
|
20
|
+
temperature?: number;
|
|
21
|
+
/** 创建时间(Unix时间戳) */
|
|
22
|
+
created_at?: number;
|
|
23
|
+
/** 工具资源 */
|
|
24
|
+
tool_resources?: Record<string, unknown>;
|
|
25
|
+
/** 响应格式 */
|
|
26
|
+
response_format?: unknown;
|
|
27
|
+
/** Top P参数 */
|
|
28
|
+
top_p?: number;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=assistant-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-response.d.ts","sourceRoot":"","sources":["../../src/types/assistant-response.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,MAAM,WAAW,iBAAiB;IAChC,WAAW;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW;IACX,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW;IACX,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,WAAW;IACX,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/types/attachment.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,MAAM,WAAW,UAAU;IACzB,WAAW;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAClC,WAAW;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-parameters.d.ts","sourceRoot":"","sources":["../../src/types/audio-parameters.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,MAAM,WAAW,eAAe;IAC9B,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Audio response data */
|
|
2
|
+
export interface Audio {
|
|
3
|
+
/** Unique identifier for this audio response */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** Base64 encoded audio bytes */
|
|
6
|
+
data?: string;
|
|
7
|
+
/** Transcript of the audio */
|
|
8
|
+
transcript?: string;
|
|
9
|
+
/** The Unix timestamp (in seconds) for when this audio response was created */
|
|
10
|
+
expires_at?: number;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=audio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/types/audio.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,MAAM,WAAW,KAAK;IACpB,gDAAgD;IAChD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Batch creation request */
|
|
2
|
+
export interface BatchCreateRequest {
|
|
3
|
+
/** 端点类型: /v1/chat/completions, /v1/embeddings, /v1/completions */
|
|
4
|
+
endpoint: string;
|
|
5
|
+
/** 元数据 */
|
|
6
|
+
metadata?: Record<string, string>;
|
|
7
|
+
/** 输入文件ID */
|
|
8
|
+
input_file_id: string;
|
|
9
|
+
/** 完成窗口时间(小时) */
|
|
10
|
+
completion_window?: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=batch-create-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-create-request.d.ts","sourceRoot":"","sources":["../../src/types/batch-create-request.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,aAAa;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BatchResponse } from './batch-response';
|
|
2
|
+
/** OpenAI batch list response */
|
|
3
|
+
export interface BatchListResponse {
|
|
4
|
+
/** Object type */
|
|
5
|
+
object?: string;
|
|
6
|
+
/** Batch list */
|
|
7
|
+
data?: BatchResponse[];
|
|
8
|
+
/** Whether more data exists */
|
|
9
|
+
has_more?: boolean;
|
|
10
|
+
/** First item id */
|
|
11
|
+
first_id?: string;
|
|
12
|
+
/** Last item id */
|
|
13
|
+
last_id?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=batch-list-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-list-response.d.ts","sourceRoot":"","sources":["../../src/types/batch-list-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,iCAAiC;AACjC,MAAM,WAAW,iBAAiB;IAChC,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Errors } from './errors';
|
|
2
|
+
import { RequestCounts } from './request-counts';
|
|
3
|
+
/** 批量任务响应 */
|
|
4
|
+
export interface BatchResponse {
|
|
5
|
+
/** 批量任务ID */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** 对象类型 */
|
|
8
|
+
object?: string;
|
|
9
|
+
/** 端点类型 */
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
/** 错误信息 */
|
|
12
|
+
errors?: Errors;
|
|
13
|
+
/** 状态: validating, in_progress, finalizing, completed, expired, cancelling, cancelled, failed */
|
|
14
|
+
status?: string;
|
|
15
|
+
/** 元数据 */
|
|
16
|
+
metadata?: Record<string, string>;
|
|
17
|
+
/** 输入文件ID */
|
|
18
|
+
input_file_id?: string;
|
|
19
|
+
/** 输出文件ID */
|
|
20
|
+
output_file_id?: string;
|
|
21
|
+
/** 错误文件ID */
|
|
22
|
+
error_file_id?: string;
|
|
23
|
+
/** 创建时间 */
|
|
24
|
+
created_at?: number;
|
|
25
|
+
/** 完成窗口 */
|
|
26
|
+
completion_window?: string;
|
|
27
|
+
/** 过期时间 */
|
|
28
|
+
expires_at?: number;
|
|
29
|
+
/** 开始时间 */
|
|
30
|
+
started_at?: number;
|
|
31
|
+
/** 完成时间 */
|
|
32
|
+
completed_at?: number;
|
|
33
|
+
/** 失败时间 */
|
|
34
|
+
failed_at?: number;
|
|
35
|
+
/** 过期时间 */
|
|
36
|
+
expired_at?: number;
|
|
37
|
+
/** 取消时间 */
|
|
38
|
+
cancelled_at?: number;
|
|
39
|
+
/** 请求统计 */
|
|
40
|
+
request_counts?: RequestCounts;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=batch-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-response.d.ts","sourceRoot":"","sources":["../../src/types/batch-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,aAAa;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,aAAa;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW;IACX,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW;IACX,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-response-response.d.ts","sourceRoot":"","sources":["../../src/types/cancel-response-response.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Categories */
|
|
2
|
+
export interface Categories {
|
|
3
|
+
/** Content that expresses, incites, or promotes hate based on protected characteristics */
|
|
4
|
+
hate?: boolean;
|
|
5
|
+
/** Content meant to arouse sexual excitement */
|
|
6
|
+
sexual?: boolean;
|
|
7
|
+
/** Content that depicts death, violence, or physical injury */
|
|
8
|
+
violence?: boolean;
|
|
9
|
+
/** Hateful content that also includes violence or serious harm */
|
|
10
|
+
'hate/threatening'?: boolean;
|
|
11
|
+
/** Content that promotes, encourages, or depicts acts of self-harm */
|
|
12
|
+
'self-harm'?: boolean;
|
|
13
|
+
/** Sexual content that includes minors */
|
|
14
|
+
'sexual/minors'?: boolean;
|
|
15
|
+
/** Violent content that depicts death, violence, or serious physical injury */
|
|
16
|
+
'violence/graphic'?: boolean;
|
|
17
|
+
/** Content that promotes or encourages illegal acts */
|
|
18
|
+
'illegal-act'?: boolean;
|
|
19
|
+
/** Content that provides instructions on how to make or use illegal items */
|
|
20
|
+
'illegal-act/instruction'?: boolean;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/types/categories.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,MAAM,WAAW,UAAU;IACzB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6EAA6E;IAC7E,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Category scores */
|
|
2
|
+
export interface CategoryScores {
|
|
3
|
+
/** Score for hate category */
|
|
4
|
+
hate?: number;
|
|
5
|
+
/** Score for sexual category */
|
|
6
|
+
sexual?: number;
|
|
7
|
+
/** Score for violence category */
|
|
8
|
+
violence?: number;
|
|
9
|
+
/** Score for hate/threatening category */
|
|
10
|
+
'hate/threatening'?: number;
|
|
11
|
+
/** Score for self-harm category */
|
|
12
|
+
'self-harm'?: number;
|
|
13
|
+
/** Score for sexual/minors category */
|
|
14
|
+
'sexual/minors'?: number;
|
|
15
|
+
/** Score for violence/graphic category */
|
|
16
|
+
'violence/graphic'?: number;
|
|
17
|
+
/** Score for illegal-act category */
|
|
18
|
+
'illegal-act'?: number;
|
|
19
|
+
/** Score for illegal-act/instruction category */
|
|
20
|
+
'illegal-act/instruction'?: number;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=category-scores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category-scores.d.ts","sourceRoot":"","sources":["../../src/types/category-scores.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion-delete-response.d.ts","sourceRoot":"","sources":["../../src/types/chat-completion-delete-response.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,WAAW,4BAA4B;IAC3C,aAAa;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChatCompletionResponse } from './chat-completion-response';
|
|
2
|
+
/** OpenAI标准聊天完成列表 */
|
|
3
|
+
export interface ChatCompletionList {
|
|
4
|
+
/** 对象类型 */
|
|
5
|
+
object?: string;
|
|
6
|
+
/** 聊天完成列表 */
|
|
7
|
+
data?: ChatCompletionResponse[];
|
|
8
|
+
/** 是否有更多数据 */
|
|
9
|
+
has_more?: boolean;
|
|
10
|
+
/** 第一条记录ID */
|
|
11
|
+
first_id?: string;
|
|
12
|
+
/** 最后一条记录ID */
|
|
13
|
+
last_id?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=chat-completion-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion-list.d.ts","sourceRoot":"","sources":["../../src/types/chat-completion-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,qBAAqB;AACrB,MAAM,WAAW,kBAAkB;IACjC,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa;IACb,IAAI,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAChC,cAAc;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AudioParameters } from './audio-parameters';
|
|
2
|
+
import { ChatMessage } from './chat-message';
|
|
3
|
+
import { ResponseFormat } from './response-format';
|
|
4
|
+
import { StreamOptions } from './stream-options';
|
|
5
|
+
import { Thinking } from './thinking';
|
|
6
|
+
import { Tool } from './tool';
|
|
7
|
+
/** Chat completion request */
|
|
8
|
+
export interface ChatCompletionRequest {
|
|
9
|
+
/** 模型ID或接入点ID */
|
|
10
|
+
model: string;
|
|
11
|
+
/** 消息列表 */
|
|
12
|
+
messages: ChatMessage[];
|
|
13
|
+
/** 采样温度,取值范围[0, 2] */
|
|
14
|
+
temperature?: number;
|
|
15
|
+
/** 生成的对话回复数量 */
|
|
16
|
+
n?: number;
|
|
17
|
+
/** 是否流式返回 */
|
|
18
|
+
stream?: boolean;
|
|
19
|
+
/** 停止生成的字符串列表,最多4个 */
|
|
20
|
+
stop?: string[];
|
|
21
|
+
/** 用户标识 */
|
|
22
|
+
user?: string;
|
|
23
|
+
/** 待调用工具列表 */
|
|
24
|
+
tools?: Tool[];
|
|
25
|
+
/** 控制模型返回是否包含待调用的工具 */
|
|
26
|
+
toolChoice?: unknown;
|
|
27
|
+
/** 随机种子 */
|
|
28
|
+
seed?: number;
|
|
29
|
+
/** 流式响应选项 */
|
|
30
|
+
streamOptions?: StreamOptions;
|
|
31
|
+
/** 响应模态列表 */
|
|
32
|
+
modalities?: string[];
|
|
33
|
+
/** 音频输出参数 */
|
|
34
|
+
audio?: AudioParameters;
|
|
35
|
+
/** 是否存储输出 */
|
|
36
|
+
store?: boolean;
|
|
37
|
+
/** 元数据 */
|
|
38
|
+
metadata?: Record<string, string>;
|
|
39
|
+
/** 思考模式配置 */
|
|
40
|
+
thinking?: Thinking;
|
|
41
|
+
/** 核采样概率阈值,取值范围[0, 1] */
|
|
42
|
+
top_p?: number;
|
|
43
|
+
/** 模型回答最大长度(单位token) */
|
|
44
|
+
max_tokens?: number;
|
|
45
|
+
/** 控制模型输出的最大长度(包括思维链) */
|
|
46
|
+
max_completion_tokens?: number;
|
|
47
|
+
/** 存在惩罚系数,取值范围[-2.0, 2.0] */
|
|
48
|
+
presence_penalty?: number;
|
|
49
|
+
/** 频率惩罚系数,取值范围[-2.0, 2.0] */
|
|
50
|
+
frequency_penalty?: number;
|
|
51
|
+
/** 调整指定token出现的概率 */
|
|
52
|
+
logit_bias?: Record<string, number>;
|
|
53
|
+
/** 指定模型回答格式 */
|
|
54
|
+
response_format?: ResponseFormat;
|
|
55
|
+
/** 控制是否使用TPM保障包 */
|
|
56
|
+
service_tier?: 'auto' | 'default';
|
|
57
|
+
/** 限制思考的工作量 */
|
|
58
|
+
reasoning_effort?: 'minimal' | 'low' | 'medium' | 'high';
|
|
59
|
+
/** 是否允许返回多个待调用的工具 */
|
|
60
|
+
parallel_tool_calls?: boolean;
|
|
61
|
+
/** 是否返回输出tokens的对数概率 */
|
|
62
|
+
logprobs?: boolean;
|
|
63
|
+
/** 每个位置最可能返回的token数量,取值范围[0, 20] */
|
|
64
|
+
top_logprobs?: number;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=chat-completion-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion-request.d.ts","sourceRoot":"","sources":["../../src/types/chat-completion-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,8BAA8B;AAC9B,MAAM,WAAW,qBAAqB;IACpC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW;IACX,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,aAAa;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc;IACd,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,uBAAuB;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa;IACb,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa;IACb,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,aAAa;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EA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