Serverless.ToolAssistedChat
Tool assisted chat completions
Given a list of messages forming a conversation, the model generates a response. Additionally, the model can utilize built-in tools for tool calls, enhancing its capability to provide more comprehensive and actionable responses.
post/serverless/tools/v1/chat/completions
Request
- Base URLhttps://api.friendli.ai
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
X-Friendli-Teamstring nullable
ID of team to run requests as (optional parameter).
Request body
Example request
{
"messages": [
{
"content": "What is 3 + 6?",
"role": "user"
}
],
"model": "meta-llama/Llama-3.1-8B-Instruct",
"tools": [
{
"type": "math:calculator"
}
]
}Response
Successfully generated a tool assisted chat response.
Example response
{
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}Changes
No recorded changes to this operation across all 1 revision of this API.