export type ModelProvider = 'openai' | 'azure' | 'anthropic' | 'bedrock' | 'cohere' | 'vertex' | 'vllm' | 'mistral' | 'ollama' | 'groq' | 'sgl' | 'parasail' | 'perplexity' | 'replicate' | 'cerebras' | 'deepseek' | 'gemini' | 'openrouter' | 'elevenlabs' | 'huggingface' | 'nebius' | 'xai' | 'runway' | 'fireworks'; export type GetApiV1ContainersContainerIdFilesFileIdContentArgs = {container_id: string, file_id: string, provider: ModelProvider}; export type GetApiV1ContainersContainerIdFilesFileIdContentOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download file content from a container * * GET /v1/containers/{container_id}/files/{file_id}/content * * Also accepts auth: BasicAuth, VirtualKeyAuth, ApiKeyAuth */ export const getApiV1ContainersContainerIdFilesFileIdContent = async (args: GetApiV1ContainersContainerIdFilesFileIdContentArgs, options?: GetApiV1ContainersContainerIdFilesFileIdContentOptions) => { const {baseUrl = "http://localhost:8080", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (args.provider != null) query.append("provider", String(args.provider)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/containers/${encodeURIComponent(String(args.container_id))}/files/${encodeURIComponent(String(args.file_id))}/content${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };