> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-locadex-parallel-t9n-main-cs60c8p4o6ik99tylxgp3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Requête de spans GenAI

> Interroger les spans d’agent, soit sous forme de lignes brutes, soit sous forme d’agrégats regroupés.



## OpenAPI

````yaml fr/weave/reference/service-api/openapi.json POST /agents/spans/query
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /agents/spans/query:
    post:
      tags:
        - Agents
      summary: Requête sur les spans Genai
      description: >-
        Interroger les spans d’agent, soit sous forme de lignes brutes, soit
        sous forme d’agrégats regroupés.
      operationId: genai_spans_query_agents_spans_query_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSpansQueryReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSpansQueryRes'
          description: Réponse réussie
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erreur de validation
components:
  schemas:
    AgentSpansQueryReq:
      description: >-
        Requête permettant d'interroger les spans d'agent pour un projet.


        Lorsque `group_by` est vide (ou omis), renvoie des lignes de span brutes
        dans le champ `spans` de la réponse. Lorsque `group_by` n'est pas vide,
        renvoie des lignes de groupe agrégées dans le champ `groups` de la
        réponse.
      properties:
        custom_attr_columns:
          items:
            $ref: '#/components/schemas/AgentSpanValueRef'
          title: Custom Attr Columns
          type: array
        group_by:
          anyOf:
            - items:
                $ref: '#/components/schemas/AgentGroupByRef'
              type: array
            - type: 'null'
          title: Group By
        group_distributions:
          items:
            $ref: '#/components/schemas/AgentSpanGroupDistributionSpec'
          maxItems: 20
          title: Group Distributions
          type: array
        group_filters:
          items:
            $ref: '#/components/schemas/AgentSpanGroupFilter'
          title: Group Filters
          type: array
        include_costs:
          default: false
          title: Include Costs
          type: boolean
        include_details:
          default: false
          title: Include Details
          type: boolean
        limit:
          default: 100
          maximum: 10000
          minimum: 0
          title: Limit
          type: integer
        measures:
          items:
            $ref: '#/components/schemas/AgentSpanMeasureSpec'
          title: Measures
          type: array
        offset:
          default: 0
          minimum: 0
          title: Offset
          type: integer
        project_id:
          title: Project Id
          type: string
        query:
          anyOf:
            - $ref: '#/components/schemas/Query'
            - type: 'null'
        signal_filters:
          anyOf:
            - $ref: '#/components/schemas/AgentSignalFilter'
            - type: 'null'
        sort_by:
          anyOf:
            - items:
                $ref: '#/components/schemas/AgentSortBy'
              type: array
            - type: 'null'
          title: Sort By
        started_after:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Started After
        started_before:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Started Before
      required:
        - project_id
      title: AgentSpansQueryReq
      type: object
    AgentSpansQueryRes:
      description: >-
        Réponse à une requête sur des spans.


        Un seul des champs `spans` ou `groups` sera renseigné, selon que la
        requête spécifie `group_by` ou non.
      properties:
        groups:
          items:
            $ref: '#/components/schemas/AgentSpanGroupRow'
          title: Groups
          type: array
        spans:
          items:
            $ref: '#/components/schemas/AgentSpanSchema'
          title: Spans
          type: array
        total_count:
          default: 0
          title: Total Count
          type: integer
      required:
        - spans
        - groups
        - total_count
      title: AgentSpansQueryRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AgentSpanValueRef:
      description: >-
        Référence à un champ de span ou à une valeur dans un mappage typé
        d'attributs personnalisés.
      properties:
        key:
          title: Key
          type: string
        source:
          default: field
          enum:
            - field
            - derived
            - custom_attrs_string
            - custom_attrs_int
            - custom_attrs_float
            - custom_attrs_bool
          title: Source
          type: string
      required:
        - key
      title: AgentSpanValueRef
      type: object
    AgentGroupByRef:
      description: >-
        Référence à un champ ou à une clé de map selon lequel les spans doivent
        être regroupés.


        `source="field"` cible un champ sémantique de span (`agent.name`) ou une
        colonne

        de span directe (`agent_name`), autorisés côté serveur.
        `source="column"` est

        accepté pour les appelants existants.

        Les autres sources ciblent des clés à l’intérieur des colonnes Map
        d’attributs personnalisés typés,

        qui acceptent des clés arbitraires définies par l’utilisateur.
      properties:
        alias:
          anyOf:
            - type: string
            - type: 'null'
          title: Alias
        key:
          title: Key
          type: string
        source:
          default: field
          enum:
            - field
            - column
            - custom_attrs_string
            - custom_attrs_int
            - custom_attrs_float
            - custom_attrs_bool
          title: Source
          type: string
      required:
        - key
      title: AgentGroupByRef
      type: object
    AgentSpanGroupDistributionSpec:
      description: >-
        Une distribution d’attribut personnalisé à calculer pour chaque groupe
        de spans renvoyé.
      properties:
        alias:
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          title: Alias
          type: string
        bins:
          default: 12
          maximum: 50
          minimum: 1
          title: Bins
          type: integer
        top_n:
          default: 5
          maximum: 20
          minimum: 1
          title: Top N
          type: integer
        value:
          $ref: '#/components/schemas/AgentSpanValueRef'
      required:
        - alias
        - value
      title: AgentSpanGroupDistributionSpec
      type: object
    AgentSpanGroupFilter:
      description: Filtre de plage sur une mesure de span groupée.
      properties:
        group_by:
          items:
            $ref: '#/components/schemas/AgentGroupByRef'
          title: Group By
          type: array
        max:
          anyOf:
            - type: number
            - format: date-time
              type: string
            - type: 'null'
          title: Max
        measure:
          $ref: '#/components/schemas/AgentSpanMeasureSpec'
        min:
          anyOf:
            - type: number
            - format: date-time
              type: string
            - type: 'null'
          title: Min
      required:
        - measure
      title: AgentSpanGroupFilter
      type: object
    AgentSpanMeasureSpec:
      description: Une mesure agrégée calculée sur les spans d'un groupe ou d'un bucket.
      properties:
        aggregation:
          enum:
            - sum
            - avg
            - min
            - max
            - count
            - count_distinct
            - count_true
            - count_false
          title: Aggregation
          type: string
        alias:
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          title: Alias
          type: string
        filter:
          anyOf:
            - $ref: '#/components/schemas/Query'
            - type: 'null'
        value:
          anyOf:
            - $ref: '#/components/schemas/AgentSpanValueRef'
            - type: 'null'
        value_type:
          anyOf:
            - enum:
                - datetime
                - number
                - boolean
                - string
              type: string
            - type: 'null'
          title: Value Type
      required:
        - alias
        - aggregation
      title: AgentSpanMeasureSpec
      type: object
    Query:
      additionalProperties: false
      properties:
        $expr:
          anyOf:
            - $ref: '#/components/schemas/AndOperation'
            - $ref: '#/components/schemas/OrOperation'
            - $ref: '#/components/schemas/NotOperation'
            - $ref: '#/components/schemas/EqOperation'
            - $ref: '#/components/schemas/GtOperation'
            - $ref: '#/components/schemas/LtOperation'
            - $ref: '#/components/schemas/GteOperation'
            - $ref: '#/components/schemas/LteOperation'
            - $ref: '#/components/schemas/InOperation'
            - $ref: '#/components/schemas/ContainsOperation'
          title: $Expr
      required:
        - $expr
      title: Query
      type: object
    AgentSignalFilter:
      properties:
        ratings:
          items:
            $ref: '#/components/schemas/RatingCondition'
          title: Ratings
          type: array
        tags:
          items:
            type: string
          title: Tags
          type: array
      title: AgentSignalFilter
      type: object
    AgentSortBy:
      description: Spécification de tri pour les points de terminaison de requête d’agent.
      properties:
        direction:
          default: desc
          enum:
            - asc
            - desc
          title: Direction
          type: string
        field:
          title: Field
          type: string
      required:
        - field
      title: AgentSortBy
      type: object
    AgentSpanGroupRow:
      description: >-
        Une ligne unique dans une réponse de requête de spans groupés.


        `group_keys` associe l'alias de chaque référence `group_by` à sa valeur
        pour cette ligne.

        Les champs restants constituent un ensemble fixe d'agrégats calculés
        pour chaque groupe.
      properties:
        agent_names:
          items:
            type: string
          title: Agent Names
          type: array
        agent_versions:
          items:
            type: string
          title: Agent Versions
          type: array
        conversation_count:
          default: 0
          title: Conversation Count
          type: integer
        conversation_names:
          items:
            type: string
          title: Conversation Names
          type: array
        distributions:
          additionalProperties:
            $ref: '#/components/schemas/AgentSpanGroupDistributionItem'
          title: Distributions
          type: object
        error_count:
          default: 0
          title: Error Count
          type: integer
        first_message:
          anyOf:
            - $ref: '#/components/schemas/AgentConversationMessagePreview'
            - type: 'null'
        first_seen:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: First Seen
        group_keys:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
              - type: 'null'
          title: Group Keys
          type: object
        invocation_count:
          default: 0
          title: Invocation Count
          type: integer
        last_message:
          anyOf:
            - $ref: '#/components/schemas/AgentConversationMessagePreview'
            - type: 'null'
        last_seen:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Seen
        metrics:
          additionalProperties:
            anyOf:
              - format: date-time
                type: string
              - type: string
              - type: integer
              - type: number
              - type: boolean
              - type: 'null'
          title: Metrics
          type: object
        provider_names:
          items:
            type: string
          title: Provider Names
          type: array
        request_models:
          items:
            type: string
          title: Request Models
          type: array
        span_count:
          default: 0
          title: Span Count
          type: integer
        total_cache_creation_input_tokens:
          default: 0
          title: Total Cache Creation Input Tokens
          type: integer
        total_cache_read_input_tokens:
          default: 0
          title: Total Cache Read Input Tokens
          type: integer
        total_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Cost Usd
        total_duration_ms:
          default: 0
          title: Total Duration Ms
          type: integer
        total_input_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Input Cost Usd
        total_input_tokens:
          default: 0
          title: Total Input Tokens
          type: integer
        total_output_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Output Cost Usd
        total_output_tokens:
          default: 0
          title: Total Output Tokens
          type: integer
        total_reasoning_tokens:
          default: 0
          title: Total Reasoning Tokens
          type: integer
      required:
        - group_keys
        - span_count
        - invocation_count
        - conversation_count
        - total_input_tokens
        - total_cache_creation_input_tokens
        - total_cache_read_input_tokens
        - total_output_tokens
        - total_reasoning_tokens
        - total_duration_ms
        - error_count
        - total_cost_usd
        - total_input_cost_usd
        - total_output_cost_usd
        - agent_names
        - agent_versions
        - provider_names
        - request_models
        - conversation_names
        - first_seen
        - last_seen
        - first_message
        - last_message
        - metrics
        - distributions
      title: AgentSpanGroupRow
      type: object
    AgentSpanSchema:
      description: Un span d'agent normalisé renvoyé par les API de requête.
      properties:
        agent_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Description
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
        agent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Version
        artifact_refs:
          items:
            type: string
          title: Artifact Refs
          type: array
        cache_creation_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Cache Creation Cost Usd
        cache_creation_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Creation Input Tokens
        cache_read_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Cache Read Cost Usd
        cache_read_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Read Input Tokens
        compaction_items_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compaction Items After
        compaction_items_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compaction Items Before
        compaction_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Compaction Summary
        content_refs:
          items:
            type: string
          title: Content Refs
          type: array
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
        conversation_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Name
        custom_attrs_bool:
          additionalProperties:
            type: boolean
          title: Custom Attrs Bool
          type: object
        custom_attrs_float:
          additionalProperties:
            type: number
          title: Custom Attrs Float
          type: object
        custom_attrs_int:
          additionalProperties:
            type: integer
          title: Custom Attrs Int
          type: object
        custom_attrs_string:
          additionalProperties:
            type: string
          title: Custom Attrs String
          type: object
        ended_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Ended At
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
        eval_evaluation_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Evaluation Name
        eval_example_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Example Id
        eval_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Kind
        eval_predict_and_score_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Predict And Score Call Id
        eval_row_digest:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Row Digest
        eval_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Run Id
        eval_trial_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Eval Trial Index
        finish_reasons:
          items:
            type: string
          title: Finish Reasons
          type: array
        input_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Input Cost Usd
        input_messages:
          items:
            $ref: '#/components/schemas/NormalizedMessage'
          title: Input Messages
          type: array
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
        object_refs:
          items:
            type: string
          title: Object Refs
          type: array
        operation_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Operation Name
        output_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Output Cost Usd
        output_messages:
          items:
            $ref: '#/components/schemas/NormalizedMessage'
          title: Output Messages
          type: array
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
        output_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Type
        parent_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Call Id
        parent_call_trace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Call Trace Id
        parent_span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Span Id
        project_id:
          title: Project Id
          type: string
        provider_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Name
        raw_span_dump:
          anyOf:
            - type: string
            - type: 'null'
          title: Raw Span Dump
        reasoning_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Content
        reasoning_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reasoning Tokens
        request_choice_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Request Choice Count
        request_frequency_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Request Frequency Penalty
        request_max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Request Max Tokens
        request_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Model
        request_presence_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Request Presence Penalty
        request_seed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Request Seed
        request_stop_sequences:
          items:
            type: string
          title: Request Stop Sequences
          type: array
        request_temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Request Temperature
        request_top_p:
          anyOf:
            - type: number
            - type: 'null'
          title: Request Top P
        response_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Id
        response_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Model
        server_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Server Address
        server_port:
          anyOf:
            - type: integer
            - type: 'null'
          title: Server Port
        span_id:
          title: Span Id
          type: string
        span_kind:
          anyOf:
            - enum:
                - UNSPECIFIED
                - INTERNAL
                - SERVER
                - CLIENT
                - PRODUCER
                - CONSUMER
              type: string
            - type: 'null'
          title: Span Kind
        span_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Span Name
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Started At
        status_code:
          anyOf:
            - enum:
                - UNSET
                - OK
                - ERROR
              type: string
            - type: 'null'
          title: Status Code
        status_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Message
        system_instructions:
          items:
            type: string
          title: System Instructions
          type: array
        tool_call_arguments:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Arguments
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        tool_call_result:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Result
        tool_definitions:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Definitions
        tool_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Description
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        tool_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Type
        total_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Cost Usd
        trace_id:
          title: Trace Id
          type: string
        wb_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Wb Run Id
        wb_run_step:
          anyOf:
            - type: integer
            - type: 'null'
          title: Wb Run Step
        wb_run_step_end:
          anyOf:
            - type: integer
            - type: 'null'
          title: Wb Run Step End
        wb_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Wb User Id
      required:
        - project_id
        - trace_id
        - span_id
        - parent_span_id
        - span_name
        - span_kind
        - started_at
        - ended_at
        - status_code
        - status_message
        - operation_name
        - provider_name
        - agent_name
        - agent_id
        - agent_description
        - agent_version
        - eval_run_id
        - eval_predict_and_score_call_id
        - eval_kind
        - eval_row_digest
        - eval_example_id
        - eval_trial_index
        - eval_evaluation_name
        - parent_call_id
        - parent_call_trace_id
        - request_model
        - response_model
        - response_id
        - input_tokens
        - output_tokens
        - reasoning_tokens
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_cost_usd
        - output_cost_usd
        - cache_read_cost_usd
        - cache_creation_cost_usd
        - total_cost_usd
        - reasoning_content
        - conversation_id
        - conversation_name
        - tool_name
        - tool_type
        - tool_call_id
        - tool_description
        - tool_definitions
        - finish_reasons
        - error_type
        - request_temperature
        - request_max_tokens
        - request_top_p
        - request_frequency_penalty
        - request_presence_penalty
        - request_seed
        - request_stop_sequences
        - request_choice_count
        - output_type
        - input_messages
        - output_messages
        - system_instructions
        - tool_call_arguments
        - tool_call_result
        - compaction_summary
        - compaction_items_before
        - compaction_items_after
        - content_refs
        - artifact_refs
        - object_refs
        - custom_attrs_string
        - custom_attrs_int
        - custom_attrs_float
        - custom_attrs_bool
        - server_address
        - server_port
        - wb_user_id
        - wb_run_id
        - wb_run_step
        - wb_run_step_end
        - raw_span_dump
      title: AgentSpanSchema
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        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
    AndOperation:
      description: |-
        ET logique. Toutes les conditions doivent être évaluées à true.

        Exemple :
            ```
            {
                "$and": [
                    {"$eq": [{"$getField": "op_name"}, {"$literal": "predict"}]},
                    {"$gt": [{"$getField": "summary.usage.tokens"}, {"$literal": 1000}]}
                ]
            }
            ```
      properties:
        $and:
          items:
            anyOf:
              - $ref: '#/components/schemas/LiteralOperation'
              - $ref: '#/components/schemas/GetFieldOperator'
              - $ref: '#/components/schemas/ConvertOperation'
              - $ref: '#/components/schemas/SizeOperation'
              - $ref: '#/components/schemas/AndOperation'
              - $ref: '#/components/schemas/OrOperation'
              - $ref: '#/components/schemas/NotOperation'
              - $ref: '#/components/schemas/EqOperation'
              - $ref: '#/components/schemas/GtOperation'
              - $ref: '#/components/schemas/LtOperation'
              - $ref: '#/components/schemas/GteOperation'
              - $ref: '#/components/schemas/LteOperation'
              - $ref: '#/components/schemas/InOperation'
              - $ref: '#/components/schemas/ContainsOperation'
          title: $And
          type: array
      required:
        - $and
      title: AndOperation
      type: object
    OrOperation:
      description: "OU logique. Au moins une condition doit être vraie.\n\nExemple\_:\n    ```\n    {\n        \"$or\": [\n            {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"a\"}]},\n            {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"b\"}]}\n        ]\n    }\n    ```"
      properties:
        $or:
          items:
            anyOf:
              - $ref: '#/components/schemas/LiteralOperation'
              - $ref: '#/components/schemas/GetFieldOperator'
              - $ref: '#/components/schemas/ConvertOperation'
              - $ref: '#/components/schemas/SizeOperation'
              - $ref: '#/components/schemas/AndOperation'
              - $ref: '#/components/schemas/OrOperation'
              - $ref: '#/components/schemas/NotOperation'
              - $ref: '#/components/schemas/EqOperation'
              - $ref: '#/components/schemas/GtOperation'
              - $ref: '#/components/schemas/LtOperation'
              - $ref: '#/components/schemas/GteOperation'
              - $ref: '#/components/schemas/LteOperation'
              - $ref: '#/components/schemas/InOperation'
              - $ref: '#/components/schemas/ContainsOperation'
          title: $Or
          type: array
      required:
        - $or
      title: OrOperation
      type: object
    NotOperation:
      description: "NON logique. Inverse la condition.\n\nExemple\_:\n    ```\n    {\n        \"$not\": [\n            {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"debug\"}]}\n        ]\n    }\n    ```"
      properties:
        $not:
          maxItems: 1
          minItems: 1
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
          title: $Not
          type: array
      required:
        - $not
      title: NotOperation
      type: object
    EqOperation:
      description: "Vérifie l'égalité entre deux opérandes.\n\nExemple\_:\n    ```\n    {\n        \"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"predict\"}]\n    }\n    ```"
      properties:
        $eq:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
          title: $Eq
          type: array
      required:
        - $eq
      title: EqOperation
      type: object
    GtOperation:
      description: "Comparaison «\_supérieur à\_».\n\nExemple\_:\n    ```\n    {\n        \"$gt\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 100}]\n    }\n    ```"
      properties:
        $gt:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
          title: $Gt
          type: array
      required:
        - $gt
      title: GtOperation
      type: object
    LtOperation:
      description: "Comparaison «\_inférieur à\_».\n\nExemple\_:\n    ```\n    {\n        \"$lt\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 100}]\n    }\n    ```"
      properties:
        $lt:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
          title: $Lt
          type: array
      required:
        - $lt
      title: LtOperation
      type: object
    GteOperation:
      description: "Comparaison «\_supérieur ou égal à\_».\n\nExemple\_:\n    ```\n    {\n        \"$gte\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 100}]\n    }\n    ```"
      properties:
        $gte:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
          title: $Gte
          type: array
      required:
        - $gte
      title: GteOperation
      type: object
    LteOperation:
      description: "Comparaison inférieure ou égale.\n\nExemple\_:\n    ```\n    {\n        \"$lte\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 100}]\n    }\n    ```"
      properties:
        $lte:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
          title: $Lte
          type: array
      required:
        - $lte
      title: LteOperation
      type: object
    InOperation:
      description: "Vérification d'appartenance.\n\nRenvoie true si l'opérande de gauche figure dans la liste fournie comme second opérande.\n\nExemple\_:\n    ```\n    {\n        \"$in\": [\n            {\"$getField\": \"op_name\"},\n            [{\"$literal\": \"predict\"}, {\"$literal\": \"generate\"}]\n        ]\n    }\n    ```"
      properties:
        $in:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $ref: '#/components/schemas/SizeOperation'
                - $ref: '#/components/schemas/AndOperation'
                - $ref: '#/components/schemas/OrOperation'
                - $ref: '#/components/schemas/NotOperation'
                - $ref: '#/components/schemas/EqOperation'
                - $ref: '#/components/schemas/GtOperation'
                - $ref: '#/components/schemas/LtOperation'
                - $ref: '#/components/schemas/GteOperation'
                - $ref: '#/components/schemas/LteOperation'
                - $ref: '#/components/schemas/InOperation'
                - $ref: '#/components/schemas/ContainsOperation'
            - items:
                anyOf:
                  - $ref: '#/components/schemas/LiteralOperation'
                  - $ref: '#/components/schemas/GetFieldOperator'
                  - $ref: '#/components/schemas/ConvertOperation'
                  - $ref: '#/components/schemas/SizeOperation'
                  - $ref: '#/components/schemas/AndOperation'
                  - $ref: '#/components/schemas/OrOperation'
                  - $ref: '#/components/schemas/NotOperation'
                  - $ref: '#/components/schemas/EqOperation'
                  - $ref: '#/components/schemas/GtOperation'
                  - $ref: '#/components/schemas/LtOperation'
                  - $ref: '#/components/schemas/GteOperation'
                  - $ref: '#/components/schemas/LteOperation'
                  - $ref: '#/components/schemas/InOperation'
                  - $ref: '#/components/schemas/ContainsOperation'
              type: array
          title: $In
          type: array
      required:
        - $in
      title: InOperation
      type: object
    ContainsOperation:
      description: "Correspondance de sous-chaîne insensible à la casse.\n\nNe fait pas partie de MongoDB. Ajout spécifique à Weave.\n\nExemple\_:\n    ```\n    {\n        \"$contains\": {\n            \"input\": {\"$getField\": \"display_name\"},\n            \"substr\": {\"$literal\": \"llm\"},\n            \"case_insensitive\": true\n        }\n    }\n    ```"
      properties:
        $contains:
          $ref: '#/components/schemas/ContainsSpec'
      required:
        - $contains
      title: ContainsOperation
      type: object
    RatingCondition:
      properties:
        op:
          enum:
            - gte
            - gt
            - lte
            - lt
            - eq
          title: Op
          type: string
        scorer_key:
          title: Scorer Key
          type: string
        value:
          title: Value
          type: number
      required:
        - scorer_key
        - op
        - value
      title: RatingCondition
      type: object
    AgentSpanGroupDistributionItem:
      description: >-
        Données de distribution pour une paire groupe de spans/attribut
        personnalisé.
      properties:
        alias:
          title: Alias
          type: string
        bins:
          items:
            $ref: '#/components/schemas/AgentSpanGroupDistributionBin'
          title: Bins
          type: array
        key:
          title: Key
          type: string
        missing_count:
          default: 0
          title: Missing Count
          type: integer
        other_count:
          default: 0
          title: Other Count
          type: integer
        present_count:
          default: 0
          title: Present Count
          type: integer
        source:
          enum:
            - custom_attrs_string
            - custom_attrs_int
            - custom_attrs_float
            - custom_attrs_bool
          title: Source
          type: string
        total_count:
          default: 0
          title: Total Count
          type: integer
        value_type:
          enum:
            - string
            - int
            - float
            - bool
          title: Value Type
          type: string
        values:
          items:
            $ref: '#/components/schemas/AgentSpanGroupDistributionValue'
          title: Values
          type: array
      required:
        - alias
        - source
        - key
        - value_type
        - total_count
        - present_count
        - missing_count
        - other_count
        - bins
        - values
      title: AgentSpanGroupDistributionItem
      type: object
    AgentConversationMessagePreview:
      description: "Extrait tronqué du premier ou du dernier message pour une ligne de conversation groupée.\n\n`role` est le type de message de la chronologie du chat (par ex. \"user_message\",\n\"assistant_message\") afin que les clients puissent le styliser de manière cohérente avec la vue de\nchat complète\_; `text` est le contenu d’aperçu tronqué et limité en longueur."
      properties:
        role:
          enum:
            - user_message
            - assistant_message
          title: Role
          type: string
        text:
          default: ''
          title: Text
          type: string
      required:
        - role
        - text
      title: AgentConversationMessagePreview
      type: object
    NormalizedMessage:
      description: "Un message unique normalisé à partir de n'importe quel format de fournisseur.\n\nCorrespond au `Tuple(role String, content String, finish_reason String)` de ClickHouse.\n\n- role\_: rôle du message (utilisateur, assistant, outil, system)\n- content\_: texte brut pour les messages simples, ou tableau de parties sérialisé en JSON\n  pour les messages multimodaux/structurés\n- finish_reason\_: motif de fin du message (messages de sortie uniquement)\n\nLe schéma JSON de sérialisation marque les champs ayant une valeur par défaut comme requis. Dans le document OpenAPI public, cette classe apparaît uniquement comme élément de message AgentSpanSchema. La validation lors de l’ingestion reste inchangée."
      properties:
        content:
          title: Content
          type: string
        finish_reason:
          default: ''
          title: Finish Reason
          type: string
        role:
          default: ''
          title: Role
          type: string
      required:
        - role
        - content
        - finish_reason
      title: NormalizedMessage
      type: object
    LiteralOperation:
      description: "Représente une valeur constante dans le langage de requête.\n\nIl peut s'agir de n'importe quelle valeur standard sérialisable en JSON.\n\nExemple\_:\n    ```\n    {\"$literal\": \"predict\"}\n    ```"
      properties:
        $literal:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - additionalProperties:
                $ref: '#/components/schemas/LiteralOperation'
              type: object
            - items:
                $ref: '#/components/schemas/LiteralOperation'
              type: array
            - type: 'null'
          title: $Literal
      required:
        - $literal
      title: LiteralOperation
      type: object
    GetFieldOperator:
      description: "Accède à un champ de l'appel tracé.\n\nPrend en charge la notation par points pour l'accès aux champs imbriqués, par ex. `summary.usage.tokens`.\n\nFonctionne uniquement avec les champs présents dans `CallSchema`, notamment\_:\n- Les champs de premier niveau comme `op_name`, `trace_id`, `started_at`\n- Les champs imbriqués comme `inputs.input_name`, `summary.usage.tokens`, etc.\n\nExemple\_:\n    ```\n    {\"$getField\": \"op_name\"}\n    ```"
      properties:
        $getField:
          title: $Getfield
          type: string
      required:
        - $getField
      title: GetFieldOperator
      type: object
    ConvertOperation:
      description: "Convertit la valeur d'entrée dans un type spécifique (par ex. `int`, `bool`, `string`).\n\nExemple\_:\n    ```\n    {\n        \"$convert\": {\n            \"input\": {\"$getField\": \"inputs.value\"},\n            \"to\": \"int\"\n        }\n    }\n    ```"
      properties:
        $convert:
          $ref: '#/components/schemas/ConvertSpec'
      required:
        - $convert
      title: ConvertOperation
      type: object
    SizeOperation:
      description: "Renvoyer le nombre d’éléments d’une collection ou de caractères d’une chaîne.\n\nExemple\_:\n    ```\n    {\"$size\": {\"$getField\": \"scorer_tags\"}}\n    ```"
      properties:
        $size:
          anyOf:
            - $ref: '#/components/schemas/LiteralOperation'
            - $ref: '#/components/schemas/GetFieldOperator'
            - $ref: '#/components/schemas/ConvertOperation'
            - $ref: '#/components/schemas/SizeOperation'
            - $ref: '#/components/schemas/AndOperation'
            - $ref: '#/components/schemas/OrOperation'
            - $ref: '#/components/schemas/NotOperation'
            - $ref: '#/components/schemas/EqOperation'
            - $ref: '#/components/schemas/GtOperation'
            - $ref: '#/components/schemas/LtOperation'
            - $ref: '#/components/schemas/GteOperation'
            - $ref: '#/components/schemas/LteOperation'
            - $ref: '#/components/schemas/InOperation'
            - $ref: '#/components/schemas/ContainsOperation'
          title: $Size
      required:
        - $size
      title: SizeOperation
      type: object
    ContainsSpec:
      description: "Spécification de l’opération `$contains`.\n\n- `input`\_: la chaîne à rechercher.\n- `substr`\_: la sous-chaîne à rechercher.\n- `case_insensitive`\_: si la valeur est true, la correspondance est insensible à la casse."
      properties:
        case_insensitive:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Case Insensitive
        input:
          anyOf:
            - $ref: '#/components/schemas/LiteralOperation'
            - $ref: '#/components/schemas/GetFieldOperator'
            - $ref: '#/components/schemas/ConvertOperation'
            - $ref: '#/components/schemas/SizeOperation'
            - $ref: '#/components/schemas/AndOperation'
            - $ref: '#/components/schemas/OrOperation'
            - $ref: '#/components/schemas/NotOperation'
            - $ref: '#/components/schemas/EqOperation'
            - $ref: '#/components/schemas/GtOperation'
            - $ref: '#/components/schemas/LtOperation'
            - $ref: '#/components/schemas/GteOperation'
            - $ref: '#/components/schemas/LteOperation'
            - $ref: '#/components/schemas/InOperation'
            - $ref: '#/components/schemas/ContainsOperation'
          title: Input
        substr:
          anyOf:
            - $ref: '#/components/schemas/LiteralOperation'
            - $ref: '#/components/schemas/GetFieldOperator'
            - $ref: '#/components/schemas/ConvertOperation'
            - $ref: '#/components/schemas/SizeOperation'
            - $ref: '#/components/schemas/AndOperation'
            - $ref: '#/components/schemas/OrOperation'
            - $ref: '#/components/schemas/NotOperation'
            - $ref: '#/components/schemas/EqOperation'
            - $ref: '#/components/schemas/GtOperation'
            - $ref: '#/components/schemas/LtOperation'
            - $ref: '#/components/schemas/GteOperation'
            - $ref: '#/components/schemas/LteOperation'
            - $ref: '#/components/schemas/InOperation'
            - $ref: '#/components/schemas/ContainsOperation'
          title: Substr
      required:
        - input
        - substr
      title: ContainsSpec
      type: object
    AgentSpanGroupDistributionBin:
      description: >-
        Un compartiment d’histogramme numérique pour un attribut personnalisé
        dans un groupe de spans.
      properties:
        count:
          title: Count
          type: integer
        index:
          title: Index
          type: integer
        max:
          title: Max
          type: number
        min:
          title: Min
          type: number
      required:
        - index
        - min
        - max
        - count
      title: AgentSpanGroupDistributionBin
      type: object
    AgentSpanGroupDistributionValue:
      description: >-
        Nombre de valeurs d’un attribut personnalisé catégoriel dans un groupe
        de spans.
      properties:
        count:
          title: Count
          type: integer
        value:
          title: Value
          type: string
      required:
        - value
        - count
      title: AgentSpanGroupDistributionValue
      type: object
    ConvertSpec:
      description: "Spécifie les détails de conversion pour `$convert`.\n\n- `input`\_: l'opérande à convertir.\n- `to`\_: le type de destination."
      properties:
        input:
          anyOf:
            - $ref: '#/components/schemas/LiteralOperation'
            - $ref: '#/components/schemas/GetFieldOperator'
            - $ref: '#/components/schemas/ConvertOperation'
            - $ref: '#/components/schemas/SizeOperation'
            - $ref: '#/components/schemas/AndOperation'
            - $ref: '#/components/schemas/OrOperation'
            - $ref: '#/components/schemas/NotOperation'
            - $ref: '#/components/schemas/EqOperation'
            - $ref: '#/components/schemas/GtOperation'
            - $ref: '#/components/schemas/LtOperation'
            - $ref: '#/components/schemas/GteOperation'
            - $ref: '#/components/schemas/LteOperation'
            - $ref: '#/components/schemas/InOperation'
            - $ref: '#/components/schemas/ContainsOperation'
          title: Input
        to:
          enum:
            - double
            - string
            - int
            - bool
            - exists
          title: To
          type: string
      required:
        - input
        - to
      title: ConvertSpec
      type: object

````