メインコンテンツへスキップ
POST
/
threads
/
stream_query
スレッドクエリストリーム
curl --request POST \
  --url https://api.example.com/threads/stream_query \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "filter": {
    "after_datetime": "2024-01-01T00:00:00Z",
    "before_datetime": "2024-12-31T23:59:59Z",
    "thread_ids": [
      "thread_1",
      "thread_2",
      "my_thread_id"
    ]
  },
  "limit": 123,
  "offset": 123,
  "sort_by": [
    {
      "direction": "desc",
      "field": "last_updated"
    }
  ]
}
'
{
  "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

turn call のみを基に集約した統計情報でスレッドをクエリします。

turn call は、スレッドコンテキストの直接の子です(call.id == turn_id の場合)。 これにより、ネストされた実装の詳細をすべて含めるのではなく、会話レベルで意味のある統計情報を取得できます。

project_id
string
必須

プロジェクトのID

:

"my_entity/my_project"

filter
ThreadsQueryFilter · object

スレッドのクエリに対するフィルター条件

limit
integer | null

返すスレッドの最大数

offset
integer | null

スキップするスレッド数

sort_by
SortBy · object[] | null

スレッドの並べ替え条件。サポートされるフィールド: 'thread_id', 'turn_count', 'start_time', 'last_updated', 'p50_turn_duration_ms', 'p99_turn_duration_ms'。

:
[
  {
    "direction": "desc",
    "field": "last_updated"
  }
]

レスポンス

成功レスポンス