export type GetApiV1VideosLogsLogIdContentArgs = {log_id: string, token?: string | undefined, range?: string | undefined, 'if-range'?: string | undefined}; export type GetApiV1VideosLogsLogIdContentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Video log content * * GET /v1/videos/logs/{log_id}/content */ export const getApiV1VideosLogsLogIdContent = async (args: GetApiV1VideosLogsLogIdContentArgs, options?: GetApiV1VideosLogsLogIdContentOptions) => { const {baseUrl = "https://api.llmgateway.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "video/mp4") if (args.token != null) query.append("token", String(args.token)) if (args.range != null) headers.set("range", String(args.range)) if (args['if-range'] != null) headers.set("if-range", String(args['if-range'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/videos/logs/${encodeURIComponent(String(args.log_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() };