Requête sur les spans Genai
curl --request POST \
--url https://api.example.com/agents/spans/query \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"custom_attr_columns": [
{
"key": "<string>",
"source": "field"
}
],
"group_by": [
{
"key": "<string>",
"alias": "<string>",
"source": "field"
}
],
"group_distributions": [
{
"alias": "<string>",
"value": {
"key": "<string>",
"source": "field"
},
"bins": 12,
"top_n": 5
}
],
"group_filters": [
{
"measure": {
"alias": "<string>",
"filter": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"value": {
"key": "<string>",
"source": "field"
}
},
"group_by": [
{
"key": "<string>",
"alias": "<string>",
"source": "field"
}
],
"max": 123,
"min": 123
}
],
"include_details": false,
"limit": 100,
"measures": [
{
"alias": "<string>",
"filter": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"value": {
"key": "<string>",
"source": "field"
}
}
],
"offset": 0,
"query": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"sort_by": [
{
"field": "<string>",
"direction": "desc"
}
],
"started_after": "2023-11-07T05:31:56Z",
"started_before": "2023-11-07T05:31:56Z"
}
'{
"groups": [
{
"agent_names": [
"<string>"
],
"agent_versions": [
"<string>"
],
"conversation_count": 0,
"conversation_names": [
"<string>"
],
"distributions": {},
"error_count": 0,
"first_message": {
"role": "",
"text": ""
},
"first_seen": "2023-11-07T05:31:56Z",
"group_keys": {},
"invocation_count": 0,
"last_message": {
"role": "",
"text": ""
},
"last_seen": "2023-11-07T05:31:56Z",
"metrics": {},
"provider_names": [
"<string>"
],
"request_models": [
"<string>"
],
"span_count": 0,
"total_cache_creation_input_tokens": 0,
"total_cache_read_input_tokens": 0,
"total_duration_ms": 0,
"total_input_tokens": 0,
"total_output_tokens": 0,
"total_reasoning_tokens": 0
}
],
"spans": [
{
"project_id": "<string>",
"span_id": "<string>",
"trace_id": "<string>",
"agent_description": "<string>",
"agent_id": "<string>",
"agent_name": "<string>",
"agent_version": "<string>",
"artifact_refs": [
"<string>"
],
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"compaction_items_after": 123,
"compaction_items_before": 123,
"compaction_summary": "<string>",
"content_refs": [
"<string>"
],
"conversation_id": "<string>",
"conversation_name": "<string>",
"custom_attrs_bool": {},
"custom_attrs_float": {},
"custom_attrs_int": {},
"custom_attrs_string": {},
"ended_at": "2023-11-07T05:31:56Z",
"error_type": "<string>",
"finish_reasons": [
"<string>"
],
"input_messages": [
{
"content": "<string>",
"finish_reason": "",
"role": ""
}
],
"input_tokens": 123,
"object_refs": [
"<string>"
],
"operation_name": "<string>",
"output_messages": [
{
"content": "<string>",
"finish_reason": "",
"role": ""
}
],
"output_tokens": 123,
"output_type": "<string>",
"parent_span_id": "<string>",
"provider_name": "<string>",
"raw_span_dump": "<string>",
"reasoning_content": "<string>",
"reasoning_tokens": 123,
"request_choice_count": 123,
"request_frequency_penalty": 123,
"request_max_tokens": 123,
"request_model": "<string>",
"request_presence_penalty": 123,
"request_seed": 123,
"request_stop_sequences": [
"<string>"
],
"request_temperature": 123,
"request_top_p": 123,
"response_id": "<string>",
"response_model": "<string>",
"server_address": "<string>",
"server_port": 123,
"span_name": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"status_message": "<string>",
"system_instructions": [
"<string>"
],
"tool_call_arguments": "<string>",
"tool_call_id": "<string>",
"tool_call_result": "<string>",
"tool_definitions": "<string>",
"tool_description": "<string>",
"tool_name": "<string>",
"tool_type": "<string>",
"wb_run_id": "<string>",
"wb_run_step": 123,
"wb_run_step_end": 123,
"wb_user_id": "<string>"
}
],
"total_count": 0
}Requête sur les spans Genai
Interroger les spans d’agent, soit sous forme de lignes brutes, soit sous forme d’agrégats regroupés.
POST
/
agents
/
spans
/
query
Requête sur les spans Genai
curl --request POST \
--url https://api.example.com/agents/spans/query \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"custom_attr_columns": [
{
"key": "<string>",
"source": "field"
}
],
"group_by": [
{
"key": "<string>",
"alias": "<string>",
"source": "field"
}
],
"group_distributions": [
{
"alias": "<string>",
"value": {
"key": "<string>",
"source": "field"
},
"bins": 12,
"top_n": 5
}
],
"group_filters": [
{
"measure": {
"alias": "<string>",
"filter": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"value": {
"key": "<string>",
"source": "field"
}
},
"group_by": [
{
"key": "<string>",
"alias": "<string>",
"source": "field"
}
],
"max": 123,
"min": 123
}
],
"include_details": false,
"limit": 100,
"measures": [
{
"alias": "<string>",
"filter": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"value": {
"key": "<string>",
"source": "field"
}
}
],
"offset": 0,
"query": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"sort_by": [
{
"field": "<string>",
"direction": "desc"
}
],
"started_after": "2023-11-07T05:31:56Z",
"started_before": "2023-11-07T05:31:56Z"
}
'{
"groups": [
{
"agent_names": [
"<string>"
],
"agent_versions": [
"<string>"
],
"conversation_count": 0,
"conversation_names": [
"<string>"
],
"distributions": {},
"error_count": 0,
"first_message": {
"role": "",
"text": ""
},
"first_seen": "2023-11-07T05:31:56Z",
"group_keys": {},
"invocation_count": 0,
"last_message": {
"role": "",
"text": ""
},
"last_seen": "2023-11-07T05:31:56Z",
"metrics": {},
"provider_names": [
"<string>"
],
"request_models": [
"<string>"
],
"span_count": 0,
"total_cache_creation_input_tokens": 0,
"total_cache_read_input_tokens": 0,
"total_duration_ms": 0,
"total_input_tokens": 0,
"total_output_tokens": 0,
"total_reasoning_tokens": 0
}
],
"spans": [
{
"project_id": "<string>",
"span_id": "<string>",
"trace_id": "<string>",
"agent_description": "<string>",
"agent_id": "<string>",
"agent_name": "<string>",
"agent_version": "<string>",
"artifact_refs": [
"<string>"
],
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"compaction_items_after": 123,
"compaction_items_before": 123,
"compaction_summary": "<string>",
"content_refs": [
"<string>"
],
"conversation_id": "<string>",
"conversation_name": "<string>",
"custom_attrs_bool": {},
"custom_attrs_float": {},
"custom_attrs_int": {},
"custom_attrs_string": {},
"ended_at": "2023-11-07T05:31:56Z",
"error_type": "<string>",
"finish_reasons": [
"<string>"
],
"input_messages": [
{
"content": "<string>",
"finish_reason": "",
"role": ""
}
],
"input_tokens": 123,
"object_refs": [
"<string>"
],
"operation_name": "<string>",
"output_messages": [
{
"content": "<string>",
"finish_reason": "",
"role": ""
}
],
"output_tokens": 123,
"output_type": "<string>",
"parent_span_id": "<string>",
"provider_name": "<string>",
"raw_span_dump": "<string>",
"reasoning_content": "<string>",
"reasoning_tokens": 123,
"request_choice_count": 123,
"request_frequency_penalty": 123,
"request_max_tokens": 123,
"request_model": "<string>",
"request_presence_penalty": 123,
"request_seed": 123,
"request_stop_sequences": [
"<string>"
],
"request_temperature": 123,
"request_top_p": 123,
"response_id": "<string>",
"response_model": "<string>",
"server_address": "<string>",
"server_port": 123,
"span_name": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"status_message": "<string>",
"system_instructions": [
"<string>"
],
"tool_call_arguments": "<string>",
"tool_call_id": "<string>",
"tool_call_result": "<string>",
"tool_definitions": "<string>",
"tool_description": "<string>",
"tool_name": "<string>",
"tool_type": "<string>",
"wb_run_id": "<string>",
"wb_run_step": 123,
"wb_run_step_end": 123,
"wb_user_id": "<string>"
}
],
"total_count": 0
}Autorisations
HTTPBasicHTTPBearer
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Corps
application/json
Requête permettant d'interroger les spans d'agent pour un projet.
Lorsque group_by est vide (ou omis), renvoie des lignes de span brutes dans le champ spans de la réponse. Lorsque group_by n'est pas vide, renvoie des lignes de groupe agrégées dans le champ groups de la réponse.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum array length:
20Show child attributes
Show child attributes
Show child attributes
Show child attributes
Plage requise:
0 <= x <= 10000Show child attributes
Show child attributes
Plage requise:
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?
⌘I