def ev.anthropic

bend-kit-llm@0.13.0.1 · llm.bend:228

import bend-kit-llm@0.13.0.1/llm.bend as Llm
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

228def ev.anthropic(+name: String, data: Bytes.Bytes) -> Ev:
229  +d = ev.doc(doc(data))
230  Bool.pick(Ev, String.eq(name, "content_block_delta"), ev.text(look(d, "delta.text")),
231    Bool.pick(Ev, String.eq(name, "message_stop"), EEnd{},
232      Bool.pick(Ev, String.eq(name, "error"), EFail{ErrApi{200, look(d, "error.message")}}, ESkip{})))

Uses (10)

Used by (1)