> ## 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/stats
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /agents/spans/stats:
    post:
      tags:
        - Agents
      summary: GenAI Spans統計
      description: エージェントのスパンに対するチャート用の集約をクエリします。
      operationId: genai_spans_stats_agents_spans_stats_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSpanStatsReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSpanStatsRes'
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    AgentSpanStatsReq:
      description: GenAI エージェント スパンに対して、チャート表示用の集約をリクエストします。
      properties:
        bucket_by:
          anyOf:
            - discriminator:
                mapping:
                  number:
                    $ref: '#/components/schemas/AgentSpanStatsNumericBucketSpec'
                  time:
                    $ref: '#/components/schemas/AgentSpanStatsTimeBucketSpec'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/AgentSpanStatsTimeBucketSpec'
                - $ref: '#/components/schemas/AgentSpanStatsNumericBucketSpec'
            - type: 'null'
          title: Bucket By
        end:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: End
        granularity:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          title: Granularity
        group_by:
          items:
            $ref: '#/components/schemas/AgentGroupByRef'
          title: Group By
          type: array
        group_filters:
          items:
            $ref: '#/components/schemas/AgentSpanGroupFilter'
          title: Group Filters
          type: array
        group_limit:
          default: 50
          maximum: 1000
          minimum: 1
          title: Group Limit
          type: integer
        metrics:
          items:
            $ref: '#/components/schemas/AgentSpanStatsMetricSpec'
          title: Metrics
          type: array
        project_id:
          title: Project Id
          type: string
        query:
          anyOf:
            - $ref: '#/components/schemas/Query'
            - type: 'null'
        start:
          format: date-time
          title: Start
          type: string
        timezone:
          default: UTC
          title: Timezone
          type: string
      required:
        - project_id
        - start
      title: AgentSpanStatsReq
      type: object
    AgentSpanStatsRes:
      description: チャート表示用のエージェント スパン統計行を含むレスポンスです。
      properties:
        bucket_type:
          default: time
          enum:
            - time
            - number
          title: Bucket Type
          type: string
        columns:
          items:
            $ref: '#/components/schemas/AgentSpanStatsColumn'
          title: Columns
          type: array
        end:
          format: date-time
          title: End
          type: string
        granularity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Granularity
        rows:
          items:
            additionalProperties:
              anyOf:
                - format: date-time
                  type: string
                - type: string
                - type: integer
                - type: number
                - type: boolean
                - type: 'null'
            type: object
          title: Rows
          type: array
        start:
          format: date-time
          title: Start
          type: string
        timezone:
          title: Timezone
          type: string
      required:
        - start
        - end
        - timezone
      title: AgentSpanStatsRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AgentSpanStatsNumericBucketSpec:
      description: 1 つの数値スパンまたはグループ化された値の範囲ごとに統計行をバケット化します。
      properties:
        alias:
          default: value
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          title: Alias
          type: string
        bins:
          default: 24
          maximum: 200
          minimum: 1
          title: Bins
          type: integer
        group_by:
          items:
            $ref: '#/components/schemas/AgentGroupByRef'
          title: Group By
          type: array
        max:
          anyOf:
            - type: number
            - type: 'null'
          title: Max
        measure:
          anyOf:
            - $ref: '#/components/schemas/AgentSpanMeasureSpec'
            - type: 'null'
        min:
          anyOf:
            - type: number
            - type: 'null'
          title: Min
        type:
          const: number
          default: number
          title: Type
          type: string
        value:
          anyOf:
            - $ref: '#/components/schemas/AgentSpanValueRef'
            - type: 'null'
      title: AgentSpanStatsNumericBucketSpec
      type: object
    AgentSpanStatsTimeBucketSpec:
      description: started_at の時間間隔ごとに統計行をバケット化します。
      properties:
        type:
          const: time
          default: time
          title: Type
          type: string
      title: AgentSpanStatsTimeBucketSpec
      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
    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
    AgentSpanStatsMetricSpec:
      description: 一致した各スパンから抽出し、チャート行に集約するメトリクスです。
      properties:
        aggregations:
          items:
            enum:
              - sum
              - avg
              - min
              - max
              - count
              - count_distinct
              - count_true
              - count_false
            type: string
          title: Aggregations
          type: array
        alias:
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          title: Alias
          type: string
        percentiles:
          items:
            type: number
          title: Percentiles
          type: array
        value:
          $ref: '#/components/schemas/AgentSpanValueRef'
        value_type:
          enum:
            - datetime
            - number
            - boolean
            - string
          title: Value Type
          type: string
      required:
        - alias
        - value_type
        - value
      title: AgentSpanStatsMetricSpec
      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
    AgentSpanStatsColumn:
      description: エージェント スパン統計の結果行に含まれる 1 つの列を記述するメタデータです。
      properties:
        aggregation:
          anyOf:
            - type: string
            - type: 'null'
          title: Aggregation
        metric:
          anyOf:
            - type: string
            - type: 'null'
          title: Metric
        name:
          title: Name
          type: string
        role:
          enum:
            - time
            - bucket
            - group
            - metric
          title: Role
          type: string
        value_type:
          enum:
            - datetime
            - number
            - boolean
            - string
          title: Value Type
          type: string
      required:
        - name
        - role
        - value_type
      title: AgentSpanStatsColumn
      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
    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
    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
    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
    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
    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

````