> ## 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.

# Flux de requête des threads



## OpenAPI

````yaml /fr/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: Flux de requête des threads
      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: Réponse réussie
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erreur de validation
      security:
        - HTTPBasic: []
        - HTTPBearer: []
components:
  schemas:
    ThreadsQueryReq:
      additionalProperties: false
      description: >-
        Interroger les threads avec des statistiques agrégées fondées uniquement
        sur les appels de tour.


        Les appels de tour sont les enfants immédiats des contextes de thread
        (où call.id == turn_id).

        Cela fournit des statistiques pertinentes au niveau de la conversation,
        plutôt que d’inclure tous

        les détails d’implémentation imbriqués.
      properties:
        filter:
          anyOf:
            - $ref: '#/components/schemas/ThreadsQueryFilter'
            - type: 'null'
          description: Critères de filtrage pour la requête sur les threads
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: Nombre maximal de threads à renvoyer
          title: Limit
        offset:
          anyOf:
            - type: integer
            - type: 'null'
          description: Nombre de threads à ignorer
          title: Offset
        project_id:
          description: L’ID du projet
          examples:
            - my_entity/my_project
          title: Project Id
          type: string
        sort_by:
          anyOf:
            - items:
                $ref: '#/components/schemas/SortBy'
              type: array
            - type: 'null'
          description: >-
            Critères de tri pour les threads. Champs pris en charge :
            '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: >-
            Inclure uniquement les threads dont `start_time` est postérieur à
            cet horodatage
          examples:
            - '2024-01-01T00:00:00Z'
          title: After Datetime
        before_datetime:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Inclure uniquement les threads dont `last_updated` est antérieur à
            cet horodatage
          examples:
            - '2024-12-31T23:59:59Z'
          title: Before Datetime
        thread_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            Inclure uniquement les threads dont les `thread_ids` figurent dans
            cette liste
          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

````