bend-kit-llm
Search uses release 0.13.0.1 · 134 definitions
Definitions (134)
- type ApiAnthropic: POST {base}/v1/messages.
- type Role
- type Msg
- type Reqsystem: "" for none.
- type Replystop: the API's reason, as "end_turn" or "stop".
- type ErrErrNet: the request did not complete, or Hairpin's breaker admitted no attempt.
- type Clientheaders go on every request.
- def str
- def kv
- def num
- def obj
- def when
- def role
- def msg
- def msgs
- def sys
- def bodyThe request body for api.
- type LeafA JSON leaf: its path, as "content.0.text", and its text.
- def path
- def push.arr
- def push.obj
- def flatThe leaves under the stack's values, last first.
- def doc.of
- def docEvery non-null leaf of a JSON text in document order, keyed by its path, as ("content.0.text", "Hi").
- def lookThe first value at path k, or "".
- def count
- def dots
- def blockIs p the text of a content block, "content.<i>.text"?
- def blocksThe text blocks of an Anthropic message, joined.
- def reply.of
- def reply.got
- def reply.copy
- def replyA 2xx response body as a Reply.
- type EvA text piece, the end, an error, or an event with no text.
- def ev.text
- def ev.doc
- def ev.anthropic
- def ev.openai
- def evWhat one SSE event of api means.
- def ok
- def again.statusStatuses a later try may clear: 408, 409, 429, and 5xx, which holds Anthropic's 529.
- def again.errA refused connect or a timeout may clear.
- def again.of
- def verdictAgain when another try may help; otherwise settled, as Hairpin.judge would settle it.
- def againHairpin's judge for every call.
- def body.ok
- def body.ofThe 2xx body, or why there is none.
- def url
- def new
- def json
- def anthropicbase https://api.anthropic.com, 10 min steps, 2 retries.
- def openaibase https://api.openai.com/v1, 10 min steps, 2 retries.
- def baseAnother base URL, as for a provider that serves the same API.
- def headerA header on every request, as anthropic-beta.
- def timeout
- def retry
- def close
- def call.done
- def call.budget
- def callPOST body to the API with n retries on a budget of n + 1; the 2xx body comes back.
- def raw.got
- def raw.copy
- def raw.of
- def raw.done
- def send.rawAny request body, as for tools or images, and the reply as JSON.
- def send.of
- def send.done
- def sendOne whole reply.
- type Stream
- def open.res
- def open.judge
- def drainA refused stream's error body, at most f more pieces, then the stream closed.
- def start.refused
- def start.ok
- def start.res
- def start
- def stream.of
- def stream.done
- def open.budget
- def stream.rawAny request body that asks for SSE, as for tools.
- def streamThe reply as it is written: read it with next.
- def stream.closeClose a stream.
- type RnThe reader after the next event, or the stream's result.
- def event.read
- def event.loopf: pieces left to read before the stream counts as stalled.
- def event.done
- def eventThe next SSE event, or None when the stream ends.
- def next.ev
- def next.of
- def next.loopf: events left to skip.
- def nextThe next piece of reply text, or None at the end.
- type Messagename: the event type, "message" when the stream sets none.
- type StThe event so far: its type, its data lines each ended by LF, the last event ID, and the last retry in ms.
- type Readerbuf from pos: bytes not yet read as lines.
- type Next
- def readerponytail: a leading U+FEFF is not dropped; the LLM APIs never send one.
- def feed.at
- def feedDrops the lines already read, then adds chunk.
- def retryThe last retry field, in ms.
- def eolThe first CR or LF at or after i, or the end.