curl --request POST \
--url https://api.trieve.ai/api/message/get_tool_function_params \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TR-Dataset: <tr-dataset>' \
--data '
{
"image_url": "https://example.com/jacket.jpg",
"tool_function": {
"description": "Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.",
"name": "get_filters",
"parameters": [
{
"description": "Whether or not the user is looking for jackets.",
"name": "jackets",
"parameter_type": "boolean"
},
{
"description": "Whether or not the user is looking for shirts.",
"name": "shirts",
"parameter_type": "boolean"
}
]
},
"user_message_text": "Get filters for the following message: \n\nI am looking for a jacket."
}
'import requests
url = "https://api.trieve.ai/api/message/get_tool_function_params"
payload = {
"image_url": "https://example.com/jacket.jpg",
"tool_function": {
"description": "Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.",
"name": "get_filters",
"parameters": [
{
"description": "Whether or not the user is looking for jackets.",
"name": "jackets",
"parameter_type": "boolean"
},
{
"description": "Whether or not the user is looking for shirts.",
"name": "shirts",
"parameter_type": "boolean"
}
]
},
"user_message_text": "Get filters for the following message:
I am looking for a jacket."
}
headers = {
"TR-Dataset": "<tr-dataset>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'TR-Dataset': '<tr-dataset>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
image_url: 'https://example.com/jacket.jpg',
tool_function: {
description: 'Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.',
name: 'get_filters',
parameters: [
{
description: 'Whether or not the user is looking for jackets.',
name: 'jackets',
parameter_type: 'boolean'
},
{
description: 'Whether or not the user is looking for shirts.',
name: 'shirts',
parameter_type: 'boolean'
}
]
},
user_message_text: 'Get filters for the following message: \n\nI am looking for a jacket.'
})
};
fetch('https://api.trieve.ai/api/message/get_tool_function_params', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trieve.ai/api/message/get_tool_function_params",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_url' => 'https://example.com/jacket.jpg',
'tool_function' => [
'description' => 'Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.',
'name' => 'get_filters',
'parameters' => [
[
'description' => 'Whether or not the user is looking for jackets.',
'name' => 'jackets',
'parameter_type' => 'boolean'
],
[
'description' => 'Whether or not the user is looking for shirts.',
'name' => 'shirts',
'parameter_type' => 'boolean'
]
]
],
'user_message_text' => 'Get filters for the following message:
I am looking for a jacket.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"TR-Dataset: <tr-dataset>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trieve.ai/api/message/get_tool_function_params"
payload := strings.NewReader("{\n \"image_url\": \"https://example.com/jacket.jpg\",\n \"tool_function\": {\n \"description\": \"Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.\",\n \"name\": \"get_filters\",\n \"parameters\": [\n {\n \"description\": \"Whether or not the user is looking for jackets.\",\n \"name\": \"jackets\",\n \"parameter_type\": \"boolean\"\n },\n {\n \"description\": \"Whether or not the user is looking for shirts.\",\n \"name\": \"shirts\",\n \"parameter_type\": \"boolean\"\n }\n ]\n },\n \"user_message_text\": \"Get filters for the following message: \\n\\nI am looking for a jacket.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TR-Dataset", "<tr-dataset>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trieve.ai/api/message/get_tool_function_params")
.header("TR-Dataset", "<tr-dataset>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"image_url\": \"https://example.com/jacket.jpg\",\n \"tool_function\": {\n \"description\": \"Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.\",\n \"name\": \"get_filters\",\n \"parameters\": [\n {\n \"description\": \"Whether or not the user is looking for jackets.\",\n \"name\": \"jackets\",\n \"parameter_type\": \"boolean\"\n },\n {\n \"description\": \"Whether or not the user is looking for shirts.\",\n \"name\": \"shirts\",\n \"parameter_type\": \"boolean\"\n }\n ]\n },\n \"user_message_text\": \"Get filters for the following message: \\n\\nI am looking for a jacket.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trieve.ai/api/message/get_tool_function_params")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TR-Dataset"] = '<tr-dataset>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_url\": \"https://example.com/jacket.jpg\",\n \"tool_function\": {\n \"description\": \"Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.\",\n \"name\": \"get_filters\",\n \"parameters\": [\n {\n \"description\": \"Whether or not the user is looking for jackets.\",\n \"name\": \"jackets\",\n \"parameter_type\": \"boolean\"\n },\n {\n \"description\": \"Whether or not the user is looking for shirts.\",\n \"name\": \"shirts\",\n \"parameter_type\": \"boolean\"\n }\n ]\n },\n \"user_message_text\": \"Get filters for the following message: \\n\\nI am looking for a jacket.\"\n}"
response = http.request(request)
puts response.read_body{
"parameters": {
"jackets": true,
"shirts": false
}
}{
"message": "Bad Request"
}Get tool function parameters
This endpoint will generate the parameters for a tool function based on the user’s message and image URL provided in the request body. The response will include the parameters for the tool function as a JSON object.
curl --request POST \
--url https://api.trieve.ai/api/message/get_tool_function_params \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TR-Dataset: <tr-dataset>' \
--data '
{
"image_url": "https://example.com/jacket.jpg",
"tool_function": {
"description": "Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.",
"name": "get_filters",
"parameters": [
{
"description": "Whether or not the user is looking for jackets.",
"name": "jackets",
"parameter_type": "boolean"
},
{
"description": "Whether or not the user is looking for shirts.",
"name": "shirts",
"parameter_type": "boolean"
}
]
},
"user_message_text": "Get filters for the following message: \n\nI am looking for a jacket."
}
'import requests
url = "https://api.trieve.ai/api/message/get_tool_function_params"
payload = {
"image_url": "https://example.com/jacket.jpg",
"tool_function": {
"description": "Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.",
"name": "get_filters",
"parameters": [
{
"description": "Whether or not the user is looking for jackets.",
"name": "jackets",
"parameter_type": "boolean"
},
{
"description": "Whether or not the user is looking for shirts.",
"name": "shirts",
"parameter_type": "boolean"
}
]
},
"user_message_text": "Get filters for the following message:
I am looking for a jacket."
}
headers = {
"TR-Dataset": "<tr-dataset>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'TR-Dataset': '<tr-dataset>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
image_url: 'https://example.com/jacket.jpg',
tool_function: {
description: 'Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.',
name: 'get_filters',
parameters: [
{
description: 'Whether or not the user is looking for jackets.',
name: 'jackets',
parameter_type: 'boolean'
},
{
description: 'Whether or not the user is looking for shirts.',
name: 'shirts',
parameter_type: 'boolean'
}
]
},
user_message_text: 'Get filters for the following message: \n\nI am looking for a jacket.'
})
};
fetch('https://api.trieve.ai/api/message/get_tool_function_params', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trieve.ai/api/message/get_tool_function_params",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_url' => 'https://example.com/jacket.jpg',
'tool_function' => [
'description' => 'Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.',
'name' => 'get_filters',
'parameters' => [
[
'description' => 'Whether or not the user is looking for jackets.',
'name' => 'jackets',
'parameter_type' => 'boolean'
],
[
'description' => 'Whether or not the user is looking for shirts.',
'name' => 'shirts',
'parameter_type' => 'boolean'
]
]
],
'user_message_text' => 'Get filters for the following message:
I am looking for a jacket.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"TR-Dataset: <tr-dataset>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trieve.ai/api/message/get_tool_function_params"
payload := strings.NewReader("{\n \"image_url\": \"https://example.com/jacket.jpg\",\n \"tool_function\": {\n \"description\": \"Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.\",\n \"name\": \"get_filters\",\n \"parameters\": [\n {\n \"description\": \"Whether or not the user is looking for jackets.\",\n \"name\": \"jackets\",\n \"parameter_type\": \"boolean\"\n },\n {\n \"description\": \"Whether or not the user is looking for shirts.\",\n \"name\": \"shirts\",\n \"parameter_type\": \"boolean\"\n }\n ]\n },\n \"user_message_text\": \"Get filters for the following message: \\n\\nI am looking for a jacket.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TR-Dataset", "<tr-dataset>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trieve.ai/api/message/get_tool_function_params")
.header("TR-Dataset", "<tr-dataset>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"image_url\": \"https://example.com/jacket.jpg\",\n \"tool_function\": {\n \"description\": \"Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.\",\n \"name\": \"get_filters\",\n \"parameters\": [\n {\n \"description\": \"Whether or not the user is looking for jackets.\",\n \"name\": \"jackets\",\n \"parameter_type\": \"boolean\"\n },\n {\n \"description\": \"Whether or not the user is looking for shirts.\",\n \"name\": \"shirts\",\n \"parameter_type\": \"boolean\"\n }\n ]\n },\n \"user_message_text\": \"Get filters for the following message: \\n\\nI am looking for a jacket.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trieve.ai/api/message/get_tool_function_params")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TR-Dataset"] = '<tr-dataset>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_url\": \"https://example.com/jacket.jpg\",\n \"tool_function\": {\n \"description\": \"Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.\",\n \"name\": \"get_filters\",\n \"parameters\": [\n {\n \"description\": \"Whether or not the user is looking for jackets.\",\n \"name\": \"jackets\",\n \"parameter_type\": \"boolean\"\n },\n {\n \"description\": \"Whether or not the user is looking for shirts.\",\n \"name\": \"shirts\",\n \"parameter_type\": \"boolean\"\n }\n ]\n },\n \"user_message_text\": \"Get filters for the following message: \\n\\nI am looking for a jacket.\"\n}"
response = http.request(request)
puts response.read_body{
"parameters": {
"jackets": true,
"shirts": false
}
}{
"message": "Bad Request"
}Authorizations
Headers
The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.
Body
JSON request payload to get the parameters for a tool function
Request payload for getting the parameters of a tool function
Function for a LLM tool call
Show child attributes
Show child attributes
{
"description": "Decide on which filters to apply to available catalog being used within the knowledge base to respond. Always get filters.",
"name": "get_filters",
"parameters": [
{
"description": "Whether or not the user is looking for jackets.",
"name": "jackets",
"parameter_type": "boolean"
},
{
"description": "Whether or not the user is looking for shirts.",
"name": "shirts",
"parameter_type": "boolean"
}
]
}
The base64 encoded audio input of the user message to attach to the topic and then generate an assistant message in response to.
Image URL to attach to the message to generate the parameters for the tool function.
Image URLs to attach to the message to generate the parameters for the tool function.
Model name to use for the completion. If not specified, this defaults to the dataset's model.
Temperature to use for the completion. If not specified, this defaults to the dataset's temperature.
Text of the user's message to the assistant which will be used to generate the parameters for the tool function.
Response
A JSON object containing the parameters for the tool function
Response body for getting the parameters of a tool function
Parameters for the tool function.
Was this page helpful?