response_helpers.ts

Declarations
#

2 declarations

view source

to_completion_response_text
#

response_helpers.ts view source

(completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { type: "claude"; value: any; } | { ...; } | { ...; }; } | null | undefined): string | null

Extracts the text content from a completion response

completion_response

type { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { type: "claude"; value: any; } | { ...; } | { ...; }; } | null | undefined

returns

string | null

to_completion_result
#

response_helpers.ts view source

(provider_name: "ollama" | "claude" | "chatgpt" | "gemini", model: string, api_response: unknown, progress_token?: (string & $brand<"Uuid">) | undefined): { completion_response: { ...; }; _meta?: { ...; } | undefined; }

Creates a standardized completion response message from provider-specific responses.

provider_name

type "ollama" | "claude" | "chatgpt" | "gemini"

model

type string

api_response

type unknown

progress_token?

type (string & $brand<"Uuid">) | undefined
optional

returns

{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }

Depends on
#

Imported by
#