Passer au contenu principal
POST
/
agents
/
conversations
/
chat
Chat de la conversation Genai
curl --request POST \
  --url https://api.example.com/agents/conversations/chat \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "conversation_id": "<string>",
  "project_id": "<string>",
  "include_feedback": false,
  "limit": 50,
  "offset": 0
}
'
{
  "conversation_id": "<string>",
  "feedback": [
    {}
  ],
  "has_more": false,
  "limit": 50,
  "offset": 0,
  "total_turns": 0,
  "turns": [
    {
      "trace_id": "<string>",
      "feedback": [
        {}
      ],
      "messages": [
        {
          "agent_handoff": {},
          "agent_name": "<string>",
          "agent_start": {
            "model": "<string>",
            "system_instructions": "<string>",
            "tool_definitions": "<string>"
          },
          "assistant_message": {
            "text": "<string>",
            "content_refs": [
              "<string>"
            ],
            "duration_ms": 123,
            "input_tokens": 123,
            "model": "<string>",
            "output_tokens": 123,
            "reasoning_content": "<string>",
            "reasoning_tokens": 123
          },
          "context_compacted": {
            "compaction_items_after": 123,
            "compaction_items_before": 123,
            "compaction_summary": "<string>"
          },
          "feedback": [
            {}
          ],
          "span_id": "<string>",
          "started_at": "2023-11-07T05:31:56Z",
          "tool_call": {
            "content_refs": [
              "<string>"
            ],
            "duration_ms": 123,
            "tool_arguments": "<string>",
            "tool_name": "<string>",
            "tool_result": "<string>"
          },
          "user_message": {
            "text": "<string>",
            "content_refs": [
              "<string>"
            ]
          }
        }
      ],
      "provider": "<string>",
      "root_span_name": "<string>",
      "total_duration_ms": 123
    }
  ]
}

Autorisations

Authorization
string
header
requis

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’obtenir la vue de chat sur plusieurs tours de conversation pour une conversation.

conversation_id
string
requis
project_id
string
requis
include_feedback
boolean
défaut:false
limit
integer
défaut:50

Nombre maximum de tours de conversation à renvoyer.

Plage requise: 0 <= x <= 50
offset
integer
défaut:0

Nombre de tours les plus récents à ignorer. Les résultats sont renvoyés par ordre chronologique dans la page sélectionnée.

Plage requise: x >= 0

Réponse

Réponse réussie

Vue de chat sur plusieurs tours de conversation : liste ordonnée des réponses de chat par tour.

Chaque entrée de turns correspond à un trace_id, que Weave considère comme un tour de conversation. Il ne s’agit pas nécessairement d’un span invoke_agent : un tour peut contenir zéro, une ou plusieurs invocations d’agent. Le frontend peut afficher des séparateurs de numéro de tour entre les entrées tout en réutilisant le rendu AgentTraceChatRes pour chaque tour individuel.

conversation_id
string
requis
feedback
Feedback · object[] | null
has_more
boolean
défaut:false
limit
integer
défaut:50
offset
integer
défaut:0
total_turns
integer
défaut:0
turns
AgentTraceChatRes · object[]