> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# スレッドクエリストリーム



## OpenAPI

````yaml /ja/weave/reference/service-api/openapi.json post /threads/stream_query
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /threads/stream_query:
    post:
      tags:
        - Threads
      summary: スレッドクエリストリーム
      operationId: threads_query_stream_threads_stream_query_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThreadsQueryReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
      security:
        - HTTPBasic: []
        - HTTPBearer: []
components:
  schemas:
    ThreadsQueryReq:
      additionalProperties: false
      description: |-
        turn call のみを基に集約した統計情報でスレッドをクエリします。

        turn call は、スレッドコンテキストの直接の子です（call.id == turn_id の場合）。
        これにより、ネストされた実装の詳細をすべて含めるのではなく、会話レベルで意味のある統計情報を取得できます。
      properties:
        filter:
          anyOf:
            - $ref: '#/components/schemas/ThreadsQueryFilter'
            - type: 'null'
          description: スレッドのクエリに対するフィルター条件
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 返すスレッドの最大数
          title: Limit
        offset:
          anyOf:
            - type: integer
            - type: 'null'
          description: スキップするスレッド数
          title: Offset
        project_id:
          description: プロジェクトのID
          examples:
            - my_entity/my_project
          title: Project Id
          type: string
        sort_by:
          anyOf:
            - items:
                $ref: '#/components/schemas/SortBy'
              type: array
            - type: 'null'
          description: >-
            スレッドの並べ替え条件。サポートされるフィールド: 'thread_id', 'turn_count', 'start_time',
            'last_updated', 'p50_turn_duration_ms', 'p99_turn_duration_ms'。
          examples:
            - - direction: desc
                field: last_updated
          title: Sort By
      required:
        - project_id
      title: ThreadsQueryReq
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ThreadsQueryFilter:
      additionalProperties: false
      properties:
        after_datetime:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: このタイムスタンプより後の start_time を持つスレッドのみを含めます
          examples:
            - '2024-01-01T00:00:00Z'
          title: After Datetime
        before_datetime:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: このタイムスタンプより前の last_updated を持つスレッドのみを含めます
          examples:
            - '2024-12-31T23:59:59Z'
          title: Before Datetime
        thread_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: この一覧に含まれる thread_ids を持つスレッドのみを含めます
          examples:
            - - thread_1
              - thread_2
              - my_thread_id
          title: Thread Ids
      title: ThreadsQueryFilter
      type: object
    SortBy:
      additionalProperties: false
      properties:
        direction:
          enum:
            - asc
            - desc
          title: Direction
          type: string
        field:
          title: Field
          type: string
      required:
        - field
        - direction
      title: SortBy
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBasic:
      scheme: basic
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````