Return to Roc packages
Documentation
Chat
▶
Client
Message
ChatRequestBody
ChatResponseBody
initClient
buildHttpRequest
decodeResponse
decodeTopMessageChoice
decodeErrorResponse
updateMessageList
encodeRequestBody
appendSystemMessage
appendUserMessage
appendAssistantMessage
Client
▶
Client
defaultModel
defaultUrl
init
setModel
setUrl
setRequestTimeout
setProviderOrder
setTemperature
setTopP
setTopK
setFrequencyPenalty
setPresencePenalty
setRepetitionPenalty
setMinP
setTopA
setSeed
setMaxTokens
setModels
setRoute
setTools
Prompt
▶
Client
PromptRequestBody
PromptResponseBody
initClient
buildHttpRequest
buildRequestBody
encodeRequestBody
decodeResponse
decodeTopTextChoice
decodeErrorResponse
formatLLamaPrompt
formatLLamaPromptWithHistory
updateLLamaConversationHistory
Tools
▶
Tool
ToolCall
handleToolCalls
dispatchToolCalls
buildTool
Toolkit.FileSystem
▶
listDirectory
listFileTree
readFileContents
writeFileContents
Toolkit.OpenWeatherMap
▶
geocoding
currentWeather
Toolkit.Roc
▶
roc
rocCheck
rocTest
rocStart
Toolkit.Serper
▶
serper
Toolkit.UtcTime
▶
utcNow
Toolkit.Wikipedia
▶
wikipediaSearch
wikipediaParse
Toolkit.WolframAlpha
▶
wolframShortAnswer
Toolkit.WorldTimeApi
▶
currentTime
(press
s
)
Chat
.
Client
: Client.Client
Chat
.
Message
Chat
.
ChatRequestBody
Chat
.
ChatResponseBody
Chat
.
initClient
Chat
.
buildHttpRequest
: Client, List Message, { toolChoice ? ToolChoice } -> RequestObject
Chat
.
decodeResponse
: List U8 -> Result ChatResponseBody
Chat
.
decodeTopMessageChoice
: List U8 -> Result Message [ ApiError ApiError, DecodingError, NoChoices, BadJson Str ]
Chat
.
decodeErrorResponse
Chat
.
updateMessageList
: Result HttpResponse , List Message -> List Message
Chat
.
encodeRequestBody
: ChatRequestBody -> List U8
Chat
.
appendSystemMessage
: List Message, Str, { cached ? Bool } -> List Message
Chat
.
appendUserMessage
: List Message, Str, { cached ? Bool } -> List Message
Chat
.
appendAssistantMessage
: List Message, Str, { cached ? Bool } -> List Message
Client
.
Client
Client
.
defaultModel
Client
.
defaultUrl
Client
.
init
: { apiKey : Str, model ? Str, url ? Str, requestTimeout ? TimeoutConfig, providerOrder ? List Str, temperature ? F32, topP ? F32, topK ? U64, frequencyPenalty ? F32, presencePenalty ? F32, repetitionPenalty ? F32, minP ? F32, topA ? F32, seed ? U64, maxTokens ? U64, models ? List Str, route ? [ UseFallback, NoFallback ], tools ? List Tool } -> Client
Client
.
setModel
: Client, Str -> Client
Client
.
setUrl
: Client, Str -> Client
Client
.
setRequestTimeout
: Client, TimeoutConfig -> Client
Client
.
setProviderOrder
: Client, List Str -> Client
Client
.
setTemperature
: Client, F32 -> Client
Client
.
setTopP
: Client, F32 -> Client
Client
.
setTopK
: Client, U64 -> Client
Client
.
setFrequencyPenalty
: Client, F32 -> Client
Client
.
setPresencePenalty
: Client, F32 -> Client
Client
.
setRepetitionPenalty
: Client, F32 -> Client
Client
.
setMinP
: Client, F32 -> Client
Client
.
setTopA
: Client, F32 -> Client
Client
.
setSeed
: Client, U64 -> Client
Client
.
setMaxTokens
: Client, U64 -> Client
Client
.
setModels
: Client, List Str -> Client
Client
.
setRoute
: Client, [ UseFallback, NoFallback ] -> Client
Client
.
setTools
: Client, List Tool -> Client
Prompt
.
Client
: Client.Client
Prompt
.
PromptRequestBody
Prompt
.
PromptResponseBody
Prompt
.
initClient
Prompt
.
buildHttpRequest
: Client, Str -> RequestObject
Prompt
.
buildRequestBody
: Client, Str -> PromptRequestBody
Prompt
.
encodeRequestBody
: PromptRequestBody -> List U8
Prompt
.
decodeResponse
: List U8 -> Result PromptResponseBody
Prompt
.
decodeTopTextChoice
: List U8 -> Result Str [ ApiError ApiError, DecodingError, NoChoices, BadJson Str ]
Prompt
.
decodeErrorResponse
Prompt
.
formatLLamaPrompt
: { prompt : Str, sysMessage ? Str } -> Str
Prompt
.
formatLLamaPromptWithHistory
: Str, Str -> Str
Prompt
.
updateLLamaConversationHistory
: { promptStr : Str, botReply : Str, conversationHistory ? Str } -> Str
Tools
.
Tool
Tools
.
ToolCall
Tools
.
handleToolCalls
: List Message, Client, Dict Str (Str -> Task Str ), { maxModelCalls ? U32 } -> Task (List Message)
Tools
.
dispatchToolCalls
: List ToolCall, Dict Str (Str -> Task Str ) -> Task (List Message)
Tools
.
buildTool
: Str, Str, List { name : Str, type : Str, description : Str, required : Bool } -> Tool
Toolkit.FileSystem
.
listDirectory
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.FileSystem
.
listFileTree
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.FileSystem
.
readFileContents
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.FileSystem
.
writeFileContents
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.OpenWeatherMap
.
geocoding
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.OpenWeatherMap
.
currentWeather
: { name : Str, handler : Str -> Task Str , tool : Tool }
Toolkit.Roc
.
roc
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.Roc
.
rocCheck
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.Roc
.
rocTest
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.Roc
.
rocStart
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.Serper
.
serper
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.UtcTime
.
utcNow
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.Wikipedia
.
wikipediaSearch
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.Wikipedia
.
wikipediaParse
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.WolframAlpha
.
wolframShortAnswer
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Toolkit.WorldTimeApi
.
currentTime
: { name : Str, handler : Str -> Task Str *, tool : Tool }
Exposed Modules
LLM docs
Chat
Client
Prompt
Tools
Toolkit.FileSystem
Toolkit.OpenWeatherMap
Toolkit.Roc
Toolkit.Serper
Toolkit.UtcTime
Toolkit.Wikipedia
Toolkit.WolframAlpha
Toolkit.WorldTimeApi