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

# GenAI Spansクエリ

> エージェントのスパンを、生の行またはグループ化された集約としてクエリします。



## OpenAPI

````yaml /ja/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: GenAI Spansクエリ
      description: エージェントのスパンを、生の行またはグループ化された集約としてクエリします。
      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: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    AgentSpansQueryReq:
      description: >-
        project のエージェント スパンをクエリするためのリクエストです。


        `group_by` が空（または省略されている）場合は、生のスパン行をレスポンスの `spans` フィールドで返します。`group_by`
        が空でない場合は、集約されたグループ行をレスポンスの `groups` フィールドで返します。
      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'
        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: >-
        スパン クエリのレスポンスです。


        リクエストで `group_by` が指定されているかどうかに応じて、`spans` または `groups`
        のどちらか一方のみが設定されます。
      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
      title: AgentSpansQueryRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AgentSpanValueRef:
      description: スパン フィールド、または型付きカスタム属性マップの値への参照です。
      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: >-
        スパンのグループ化基準となるフィールドまたは map-key への参照です。


        `source="field"` は、サーバー側で許可リストに登録されたセマンティックなスパン
        フィールド（`agent.name`）または直接のスパン列（`agent_name`）を対象にします。`source="column"`
        は既存の呼び出し元向けにも受け付けられます。

        その他の source は、型付きカスタム属性 Map 列内のキーを対象とし、任意のユーザー定義キーを受け付けます。
      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: 返される各スパングループについて計算する 1 つのカスタム属性分布。
      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: グループ化された 1 つのスパン メジャーに対する範囲フィルター。
      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: グループまたは bucket 内のスパンに対して計算される1つの集約値です。
      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
    AgentSortBy:
      description: エージェント クエリ endpoints 用のソート指定。
      properties:
        direction:
          default: desc
          enum:
            - asc
            - desc
          title: Direction
          type: string
        field:
          title: Field
          type: string
      required:
        - field
      title: AgentSortBy
      type: object
    AgentSpanGroupRow:
      description: |-
        グループ化された span クエリのレスポンス内の1行です。

        `group_keys` は、各 group_by 参照の alias をこの行の値にマッピングします。
        残りのフィールドは、各グループごとに計算される固定の集約結果一式です。
      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
      title: AgentSpanGroupRow
      type: object
    AgentSpanSchema:
      description: クエリ API から返される、正規化されたエージェント スパンです。
      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
        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_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
      title: AgentSpanSchema
      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
    AndOperation:
      description: |-
        論理 AND。すべての条件が true と評価される必要があります。

        例:
            ```
            {
                "$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/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: |-
        論理 OR。少なくとも 1 つの条件が true である必要があります。

        例:
            ```
            {
                "$or": [
                    {"$eq": [{"$getField": "op_name"}, {"$literal": "a"}]},
                    {"$eq": [{"$getField": "op_name"}, {"$literal": "b"}]}
                ]
            }
            ```
      properties:
        $or:
          items:
            anyOf:
              - $ref: '#/components/schemas/LiteralOperation'
              - $ref: '#/components/schemas/GetFieldOperator'
              - $ref: '#/components/schemas/ConvertOperation'
              - $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: |-
        論理NOT。条件を反転します。

        例:
            ```
            {
                "$not": [
                    {"$eq": [{"$getField": "op_name"}, {"$literal": "debug"}]}
                ]
            }
            ```
      properties:
        $not:
          maxItems: 1
          minItems: 1
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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: |-
        2 つのオペランドが等しいかどうかを確認します。

        例:
            ```
            {
                "$eq": [{"$getField": "op_name"}, {"$literal": "predict"}]
            }
            ```
      properties:
        $eq:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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/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: |-
        より大きいことを比較します。

        例:
            ```
            {
                "$gt": [{"$getField": "summary.usage.tokens"}, {"$literal": 100}]
            }
            ```
      properties:
        $gt:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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/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: |-
        より小さいことを比較します。

        例:
            ```
            {
                "$lt": [{"$getField": "summary.usage.tokens"}, {"$literal": 100}]
            }
            ```
      properties:
        $lt:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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/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: |-
        以上であることを比較します。

        例:
            ```
            {
                "$gte": [{"$getField": "summary.usage.tokens"}, {"$literal": 100}]
            }
            ```
      properties:
        $gte:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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/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: |-
        以下または等しい比較です。

        例:
            ```
            {
                "$lte": [{"$getField": "summary.usage.tokens"}, {"$literal": 100}]
            }
            ```
      properties:
        $lte:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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/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: |-
        メンバーシップチェックです。

        左オペランドが第 2 オペランドとして指定されたリストに含まれている場合は true を返します。

        例:
            ```
            {
                "$in": [
                    {"$getField": "op_name"},
                    [{"$literal": "predict"}, {"$literal": "generate"}]
                ]
            }
            ```
      properties:
        $in:
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - $ref: '#/components/schemas/LiteralOperation'
                - $ref: '#/components/schemas/GetFieldOperator'
                - $ref: '#/components/schemas/ConvertOperation'
                - $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/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: |-
        大文字と小文字を区別しない部分文字列一致。

        MongoDB の一部ではありません。Weave 固有の拡張です。

        例:
            ```
            {
                "$contains": {
                    "input": {"$getField": "display_name"},
                    "substr": {"$literal": "llm"},
                    "case_insensitive": true
                }
            }
            ```
      properties:
        $contains:
          $ref: '#/components/schemas/ContainsSpec'
      required:
        - $contains
      title: ContainsOperation
      type: object
    AgentSpanGroupDistributionItem:
      description: 1 つのスパン グループ/カスタム属性ペアに対する分布データ。
      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
      title: AgentSpanGroupDistributionItem
      type: object
    AgentConversationMessagePreview:
      description: >-
        グループ化された会話行に対する、先頭または末尾メッセージの切り詰められたスニペットです。


        `role` はチャット タイムラインのメッセージ タイプ（例:
        "user_message"、"assistant_message"）であり、クライアントは完全なチャット
        ビューと一貫したスタイルで表示できます。`text` は、トリミングされ長さ上限が適用されたプレビュー コンテンツです。
      properties:
        role:
          default: ''
          title: Role
          type: string
        text:
          default: ''
          title: Text
          type: string
      title: AgentConversationMessagePreview
      type: object
    NormalizedMessage:
      description: >-
        任意の provider 形式から正規化された単一のメッセージです。


        ClickHouse の ``Tuple(role String, content String, finish_reason
        String)`` にマップされます。


        - role: メッセージの role（user、assistant、tool、system）

        - content: 単純なメッセージではプレーンテキスト、マルチモーダル/構造化メッセージでは JSON にシリアライズされた parts
        配列

        - finish_reason: メッセージごとの終了理由（output メッセージのみ）
      properties:
        content:
          title: Content
          type: string
        finish_reason:
          default: ''
          title: Finish Reason
          type: string
        role:
          default: ''
          title: Role
          type: string
      required:
        - content
      title: NormalizedMessage
      type: object
    LiteralOperation:
      description: |-
        クエリ言語における定数値を表します。

        標準的な JSON シリアライズ可能な任意の値を指定できます。

        例:
            ```
            {"$literal": "predict"}
            ```
      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: |-
        トレースされた call のフィールドにアクセスします。

        ネストされたフィールドへのアクセスでは、たとえば `summary.usage.tokens` のようにドット記法をサポートします。

        `CallSchema` に存在するフィールドでのみ機能します。これには次が含まれます。
        - `op_name`、`trace_id`、`started_at` などのトップレベルのフィールド
        - `inputs.input_name`、`summary.usage.tokens` などのネストされたフィールド

        例:
            ```
            {"$getField": "op_name"}
            ```
      properties:
        $getField:
          title: $Getfield
          type: string
      required:
        - $getField
      title: GetFieldOperator
      type: object
    ConvertOperation:
      description: |-
        入力値を特定のタイプ（例: `int`、`bool`、`string`）に変換します。

        例:
            ```
            {
                "$convert": {
                    "input": {"$getField": "inputs.value"},
                    "to": "int"
                }
            }
            ```
      properties:
        $convert:
          $ref: '#/components/schemas/ConvertSpec'
      required:
        - $convert
      title: ConvertOperation
      type: object
    ContainsSpec:
      description: |-
        `$contains` operation の仕様。

        - `input`: 検索対象の文字列。
        - `substr`: 検索する部分文字列。
        - `case_insensitive`: true の場合、一致で大文字と小文字を区別しません。
      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/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/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: スパン グループ内のカスタム属性に対する 1 つの数値ヒストグラム ビン。
      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: スパン グループ内の 1 つのカテゴリ別カスタム属性値カウント。
      properties:
        count:
          title: Count
          type: integer
        value:
          title: Value
          type: string
      required:
        - value
        - count
      title: AgentSpanGroupDistributionValue
      type: object
    ConvertSpec:
      description: |-
        `$convert` の変換の詳細を指定します。

        - `input`: 変換するオペランド。
        - `to`: 変換先のタイプ。
      properties:
        input:
          anyOf:
            - $ref: '#/components/schemas/LiteralOperation'
            - $ref: '#/components/schemas/GetFieldOperator'
            - $ref: '#/components/schemas/ConvertOperation'
            - $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

````