메인 콘텐츠로 건너뛰기
POST
/
agents
/
conversations
/
chat
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
}
'
import requests

url = "https://api.example.com/agents/conversations/chat"

payload = {
"conversation_id": "<string>",
"project_id": "<string>",
"include_feedback": False,
"limit": 50,
"offset": 0
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
project_id: '<string>',
include_feedback: false,
limit: 50,
offset: 0
})
};

fetch('https://api.example.com/agents/conversations/chat', 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/conversations/chat",
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([
'conversation_id' => '<string>',
'project_id' => '<string>',
'include_feedback' => false,
'limit' => 50,
'offset' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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/conversations/chat"

payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"include_feedback\": false,\n \"limit\": 50,\n \"offset\": 0\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Basic <encoded-value>")
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/conversations/chat")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"include_feedback\": false,\n \"limit\": 50,\n \"offset\": 0\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/agents/conversations/chat")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"include_feedback\": false,\n \"limit\": 50,\n \"offset\": 0\n}"

response = http.request(request)
puts response.read_body
{
  "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
    }
  ]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

인증

Authorization
string
header
필수

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

본문

application/json

대화의 multi-turn 채팅 뷰를 조회하기 위한 요청입니다.

conversation_id
string
필수
project_id
string
필수
include_feedback
boolean
기본값:false
limit
integer
기본값:50

반환할 대화 턴의 최대 개수입니다.

필수 범위: 0 <= x <= 50
offset
integer
기본값:0

건너뛸 가장 최근 턴의 개수입니다. 결과는 선택한 페이지 내에서 시간순으로 반환됩니다.

필수 범위: x >= 0

응답

성공 응답

Multi-turn 채팅 뷰: 턴별 채팅 responses의 정렬된 목록입니다.

turns의 각 항목은 하나의 trace_id에 해당하며, Weave는 이를 하나의 대화 턴으로 처리합니다. 이는 반드시 하나의 invoke_agent span인 것은 아닙니다. 하나의 턴에는 에이전트 호출이 0개, 1개 또는 여러 개 포함될 수 있습니다. 프런트엔드는 항목 사이에 턴 번호 구분선을 렌더링하면서도 각 개별 턴에 대해 AgentTraceChatRes 렌더링을 계속 재사용할 수 있습니다.

conversation_id
string
필수
feedback
Feedback · object[] | null
has_more
boolean
기본값:false
limit
integer
기본값:50
offset
integer
기본값:0
total_turns
integer
기본값:0
turns
AgentTraceChatRes · object[]