Genai Search
curl --request POST \
--url https://api.example.com/agents/search \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"query": "",
"trace_id": "<string>",
"roles": [],
"conversation_id": "<string>",
"agent_name": "<string>",
"provider_name": "<string>",
"request_model": "<string>",
"truncate_content": true,
"started_after": "2023-11-07T05:31:56Z",
"started_before": "2023-11-07T05:31:56Z",
"limit": 20,
"offset": 0
}
'import requests
url = "https://api.example.com/agents/search"
payload = {
"project_id": "<string>",
"query": "",
"trace_id": "<string>",
"roles": [],
"conversation_id": "<string>",
"agent_name": "<string>",
"provider_name": "<string>",
"request_model": "<string>",
"truncate_content": True,
"started_after": "2023-11-07T05:31:56Z",
"started_before": "2023-11-07T05:31:56Z",
"limit": 20,
"offset": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '<string>',
query: '',
trace_id: '<string>',
roles: [],
conversation_id: '<string>',
agent_name: '<string>',
provider_name: '<string>',
request_model: '<string>',
truncate_content: true,
started_after: '2023-11-07T05:31:56Z',
started_before: '2023-11-07T05:31:56Z',
limit: 20,
offset: 0
})
};
fetch('https://api.example.com/agents/search', 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.example.com/agents/search",
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([
'project_id' => '<string>',
'query' => '',
'trace_id' => '<string>',
'roles' => [
],
'conversation_id' => '<string>',
'agent_name' => '<string>',
'provider_name' => '<string>',
'request_model' => '<string>',
'truncate_content' => true,
'started_after' => '2023-11-07T05:31:56Z',
'started_before' => '2023-11-07T05:31:56Z',
'limit' => 20,
'offset' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/agents/search"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"query\": \"\",\n \"trace_id\": \"<string>\",\n \"roles\": [],\n \"conversation_id\": \"<string>\",\n \"agent_name\": \"<string>\",\n \"provider_name\": \"<string>\",\n \"request_model\": \"<string>\",\n \"truncate_content\": true,\n \"started_after\": \"2023-11-07T05:31:56Z\",\n \"started_before\": \"2023-11-07T05:31:56Z\",\n \"limit\": 20,\n \"offset\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/agents/search")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"query\": \"\",\n \"trace_id\": \"<string>\",\n \"roles\": [],\n \"conversation_id\": \"<string>\",\n \"agent_name\": \"<string>\",\n \"provider_name\": \"<string>\",\n \"request_model\": \"<string>\",\n \"truncate_content\": true,\n \"started_after\": \"2023-11-07T05:31:56Z\",\n \"started_before\": \"2023-11-07T05:31:56Z\",\n \"limit\": 20,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"query\": \"\",\n \"trace_id\": \"<string>\",\n \"roles\": [],\n \"conversation_id\": \"<string>\",\n \"agent_name\": \"<string>\",\n \"provider_name\": \"<string>\",\n \"request_model\": \"<string>\",\n \"truncate_content\": true,\n \"started_after\": \"2023-11-07T05:31:56Z\",\n \"started_before\": \"2023-11-07T05:31:56Z\",\n \"limit\": 20,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"conversation_id": "<string>",
"conversation_name": "<string>",
"agent_name": "<string>",
"matched_messages": [
{
"span_id": "<string>",
"trace_id": "<string>",
"content_preview": "<string>",
"content_digest": "<string>",
"started_at": "2023-11-07T05:31:56Z"
}
],
"last_activity": "2023-11-07T05:31:56Z"
}
],
"total_conversations": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Genai Search
POST
/
agents
/
search
Genai Search
curl --request POST \
--url https://api.example.com/agents/search \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"query": "",
"trace_id": "<string>",
"roles": [],
"conversation_id": "<string>",
"agent_name": "<string>",
"provider_name": "<string>",
"request_model": "<string>",
"truncate_content": true,
"started_after": "2023-11-07T05:31:56Z",
"started_before": "2023-11-07T05:31:56Z",
"limit": 20,
"offset": 0
}
'import requests
url = "https://api.example.com/agents/search"
payload = {
"project_id": "<string>",
"query": "",
"trace_id": "<string>",
"roles": [],
"conversation_id": "<string>",
"agent_name": "<string>",
"provider_name": "<string>",
"request_model": "<string>",
"truncate_content": True,
"started_after": "2023-11-07T05:31:56Z",
"started_before": "2023-11-07T05:31:56Z",
"limit": 20,
"offset": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '<string>',
query: '',
trace_id: '<string>',
roles: [],
conversation_id: '<string>',
agent_name: '<string>',
provider_name: '<string>',
request_model: '<string>',
truncate_content: true,
started_after: '2023-11-07T05:31:56Z',
started_before: '2023-11-07T05:31:56Z',
limit: 20,
offset: 0
})
};
fetch('https://api.example.com/agents/search', 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.example.com/agents/search",
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([
'project_id' => '<string>',
'query' => '',
'trace_id' => '<string>',
'roles' => [
],
'conversation_id' => '<string>',
'agent_name' => '<string>',
'provider_name' => '<string>',
'request_model' => '<string>',
'truncate_content' => true,
'started_after' => '2023-11-07T05:31:56Z',
'started_before' => '2023-11-07T05:31:56Z',
'limit' => 20,
'offset' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/agents/search"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"query\": \"\",\n \"trace_id\": \"<string>\",\n \"roles\": [],\n \"conversation_id\": \"<string>\",\n \"agent_name\": \"<string>\",\n \"provider_name\": \"<string>\",\n \"request_model\": \"<string>\",\n \"truncate_content\": true,\n \"started_after\": \"2023-11-07T05:31:56Z\",\n \"started_before\": \"2023-11-07T05:31:56Z\",\n \"limit\": 20,\n \"offset\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/agents/search")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"query\": \"\",\n \"trace_id\": \"<string>\",\n \"roles\": [],\n \"conversation_id\": \"<string>\",\n \"agent_name\": \"<string>\",\n \"provider_name\": \"<string>\",\n \"request_model\": \"<string>\",\n \"truncate_content\": true,\n \"started_after\": \"2023-11-07T05:31:56Z\",\n \"started_before\": \"2023-11-07T05:31:56Z\",\n \"limit\": 20,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"query\": \"\",\n \"trace_id\": \"<string>\",\n \"roles\": [],\n \"conversation_id\": \"<string>\",\n \"agent_name\": \"<string>\",\n \"provider_name\": \"<string>\",\n \"request_model\": \"<string>\",\n \"truncate_content\": true,\n \"started_after\": \"2023-11-07T05:31:56Z\",\n \"started_before\": \"2023-11-07T05:31:56Z\",\n \"limit\": 20,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"conversation_id": "<string>",
"conversation_name": "<string>",
"agent_name": "<string>",
"matched_messages": [
{
"span_id": "<string>",
"trace_id": "<string>",
"content_preview": "<string>",
"content_digest": "<string>",
"started_at": "2023-11-07T05:31:56Z"
}
],
"last_activity": "2023-11-07T05:31:56Z"
}
],
"total_conversations": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
Query the messages table by content and/or span-level filters.
Scans the messages table (one row per message occurrence, populated by an
MV from spans) and returns matching span-level hits. Full-text search sets
query; structured retrieval (e.g. all messages in a trace) leaves query
empty and uses the filters below. The caller groups by conversation for the
response shape.
Available options:
, user, assistant, system, tool, tool_call, tool_result Required range:
0 <= x <= 1000Required range:
x >= 0Was this page helpful?
⌘I