~/bend-docscommunity

openai.bend fails

raw source on the hub · import 0xbfb6718181103ac566eb0ff5308d47ac/openai.bend as Openai

An unofficial OpenAI SDK for Bend, with typed requests, streaming, and tool calling.

4 imports
import Base
import ./json.bend as J
import ./transport.bend as T
import ./docs.bend as Docs

Types

type Client source · line 14 · raw

Data

type Request source · line 17 · raw

Data

type Error source · line 20 · raw

Data

type Stream source · line 23 · raw

Type

type Step source · line 26 · raw

Type

type FrameKind source · line 98 · raw

Data

type Usage source · line 185 · raw

Data

type FunctionCall source · line 188 · raw

Data

type Response source · line 191 · raw

Data

Definitions

def repository source · line 8 · raw

String

def version source · line 11 · raw

String

def text_request source · line 31 · raw

@model:String -> @input:String -> Request

def params source · line 34 · raw

@request:Request -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def envelope source · line 39 · raw

@client:Client -> @id:String -> @stream:Bool -> @body:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> @operation:String -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def opened source · line 44 · raw

@result:Result<&1, &1, String, 0xbfb6718181103ac566eb0ff5308d47ac/transport.Connection> -> @id:String -> Result<&1, &1, Error, Stream>

def open_raw source · line 49 · raw

@+client:Client -> @+id:String -> @stream:Bool -> @body:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> IO(Result<&1, &1, Error, Stream>)

def create source · line 56 · raw

@client:Client -> @id:String -> @request:Request -> IO(Result<&1, &1, Error, Stream>)

def stream source · line 59 · raw

@client:Client -> @id:String -> @request:Request -> IO(Result<&1, &1, Error, Stream>)

def close source · line 62 · raw

@stream:Stream -> IO(Unit)

def field source · line 66 · raw

@+frame:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> @key:String -> String

def value_or_null source · line 69 · raw

@value:Maybe<&2, 0xbfb6718181103ac566eb0ff5308d47ac/json.Json> -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def json_field source · line 74 · raw

@frame:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> @key:String -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def fail source · line 77 · raw

@connection:0xbfb6718181103ac566eb0ff5308d47ac/transport.Connection -> @code:String -> @message:String -> IO(Step)

def finish source · line 82 · raw

@ok:Bool -> @connection:0xbfb6718181103ac566eb0ff5308d47ac/transport.Connection -> IO(Step)

def terminal_type source · line 90 · raw

@+name:String -> Bool

def status source · line 93 · raw

@value:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> String

def select_kind source · line 106 · raw

@ok:Bool -> @yes:FrameKind -> @no:FrameKind -> FrameKind

def frame_kind source · line 111 · raw

@+kind:String -> FrameKind

def step_kind source · line 116 · raw

@kind:FrameKind -> @connection:0xbfb6718181103ac566eb0ff5308d47ac/transport.Connection -> @id:String -> @terminal:Bool -> @+frame:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> IO(Step)

def step_id source · line 131 · raw

@ok:Bool -> @connection:0xbfb6718181103ac566eb0ff5308d47ac/transport.Connection -> @id:String -> @terminal:Bool -> @+frame:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> IO(Step)

def received source · line 136 · raw

@result:0xbfb6718181103ac566eb0ff5308d47ac/transport.Read -> @+id:String -> @terminal:Bool -> IO(Step)

def next source · line 141 · raw

@stream:Stream -> IO(Step)

def cancelled source · line 148 · raw

@kind:Bool -> @value:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> Result<&1, &1, String, Bool>

def cancel_read source · line 153 · raw

@result:0xbfb6718181103ac566eb0ff5308d47ac/transport.Read -> IO(Result<&1, &1, String, Bool>)

def cancel_open source · line 161 · raw

@result:Result<&1, &1, String, 0xbfb6718181103ac566eb0ff5308d47ac/transport.Connection> -> IO(Result<&1, &1, String, Bool>)

def cancel source · line 169 · raw

@+client:Client -> @id:String -> IO(Result<&1, &1, String, Bool>)

def function_tool source · line 176 · raw

@name:String -> @description:String -> @schema:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def function_output source · line 179 · raw

@call_id:String -> @output:String -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def json_schema source · line 182 · raw

@name:String -> @schema:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> 0xbfb6718181103ac566eb0ff5308d47ac/json.Json

def array source · line 194 · raw

@value:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> List<&2, 0xbfb6718181103ac566eb0ff5308d47ac/json.Json>

def content_piece source · line 199 · raw

@kind:Bool -> @item:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> String

def content_text source · line 204 · raw

@items:List<&2, 0xbfb6718181103ac566eb0ff5308d47ac/json.Json> -> String

def output_text source · line 209 · raw

@items:List<&2, 0xbfb6718181103ac566eb0ff5308d47ac/json.Json> -> String

def call_piece source · line 214 · raw

@kind:Bool -> @+item:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> @rest:List<&2, FunctionCall> -> List<&2, FunctionCall>

def function_calls source · line 219 · raw

@items:List<&2, 0xbfb6718181103ac566eb0ff5308d47ac/json.Json> -> List<&2, FunctionCall>

def usage source · line 224 · raw

@value:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> Maybe<&2, Usage>

def response source · line 230 · raw

@+raw:0xbfb6718181103ac566eb0ff5308d47ac/json.Json -> Response