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

# フィードバック集計

> 型付き Scorer フィードバック（タグ、評価）を時間バケットごとに集計します。



## OpenAPI

````yaml /ja/weave/reference/service-api/openapi.json post /feedback/aggregate
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /feedback/aggregate:
    post:
      tags:
        - Feedback
      summary: フィードバック集計
      description: 型付き Scorer フィードバック（タグ、評価）を時間バケットごとに集計します。
      operationId: feedback_aggregate_feedback_aggregate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackAggregateReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackAggregateRes'
          description: 正常なレスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    FeedbackAggregateReq:
      additionalProperties: false
      description: 時間バケットおよびディメンションごとの集計スコアをクエリするためのクエリです。
      properties:
        after_ms:
          description: created_at の下限（この値を含む、エポックからのミリ秒）。
          minimum: 0
          title: After Ms
          type: integer
        before_ms:
          description: created_at の上限（この値を含まない、エポックからのミリ秒）。
          minimum: 0
          title: Before Ms
          type: integer
        feedback_types:
          description: feedback_type を接頭辞でフィルターします
          items:
            type: string
          title: Feedback Types
          type: array
        group_by:
          description: >-
            使用可能な値: ['scorer_id', 'span_agent_name', 'span_agent_version',
            'span_status_code']。
          items:
            enum:
              - scorer_id
              - span_agent_name
              - span_agent_version
              - span_status_code
            type: string
          title: Group By
          type: array
        monitor_ids:
          description: これらの monitor id でフィルターします（完全一致。接頭辞一致にするには末尾に '*' を付けます）。
          items:
            type: string
          title: Monitor Ids
          type: array
        project_id:
          examples:
            - entity/project
          title: Project Id
          type: string
        rating_max:
          anyOf:
            - maximum: 1
              minimum: 0
              type: number
            - type: 'null'
          description: rating がこの値以下の行のみを含めます
          title: Rating Max
        rating_min:
          anyOf:
            - maximum: 1
              minimum: 0
              type: number
            - type: 'null'
          description: rating がこの値以上の行のみを含めます
          title: Rating Min
        scorer_ids:
          description: これらの scorer id でフィルターします（完全一致。接頭辞一致にするには末尾に '*' を付けます）。
          items:
            type: string
          title: Scorer Ids
          type: array
        span_agent_names:
          description: span_agent_name がこれらのいずれかに一致するフィードバックにフィルターします（完全一致）。
          items:
            type: string
          title: Span Agent Names
          type: array
        span_types:
          description: span のタイプでフィルターします（turn または conversation）。
          items:
            enum:
              - agent_turn
              - agent_conversation
            type: string
          title: Span Types
          type: array
        tags:
          description: 指定されたタグのいずれかを含むフィードバックにフィルターします
          items:
            type: string
          title: Tags
          type: array
        time_bucket_seconds:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 時間バケットのサイズ（秒）です。たとえば 1 時間バケットの場合は 3600 です
          title: Time Bucket Seconds
      required:
        - project_id
        - after_ms
        - before_ms
      title: FeedbackAggregateReq
      type: object
    FeedbackAggregateRes:
      description: 集計された Scorer フィードバックの疎な時系列です（空のバケットは省略されます）。
      properties:
        after_ms:
          description: 解決後の下限（この値を含む、Unix エポックミリ秒、UTC）。
          title: After Ms
          type: integer
        before_ms:
          description: 解決後の上限（この値を含まない、Unix エポックミリ秒、UTC）。
          title: Before Ms
          type: integer
        buckets:
          items:
            $ref: '#/components/schemas/FeedbackAggregateBucket'
          title: Buckets
          type: array
        time_bucket_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          description: 使用された時間バケットのサイズ（秒）です。バケット化されていない場合は None です。
          title: Time Bucket Seconds
      required:
        - after_ms
        - before_ms
      title: FeedbackAggregateRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FeedbackAggregateBucket:
      description: 集計された Scorer フィードバックの 1 つの（時間バケット, group）行です。
      properties:
        group:
          additionalProperties:
            type: string
          description: 'この行の group-by ディメンション値です（例: {''scorer_id'': ''...''}）。'
          title: Group
          type: object
        rating_counts:
          additionalProperties:
            type: integer
          description: '各 rating キーを持つ行数です（例: ''_rating_''）。'
          title: Rating Counts
          type: object
        rating_sums:
          additionalProperties:
            type: number
          description: 各 rating キーの値の合計です。avg = sum/count はクライアント側で算出します。
          title: Rating Sums
          type: object
        scored_count:
          description: >-
            スコアを出力した行です（少なくとも 1 つのタグまたは rating）。何もスコア付けしなかった agent-monitor
            行は除外されます。スコア数の確認にはこれを使用します。
          title: Scored Count
          type: integer
        tag_counts:
          additionalProperties:
            type: integer
          description: 各 Scorer タグの件数です。
          title: Tag Counts
          type: object
        time_bucket_start_ms:
          anyOf:
            - type: integer
            - type: 'null'
          description: 時間バケットの開始時刻（Unix エポックミリ秒、UTC）です。バケット化されていない場合は None です。
          title: Time Bucket Start Ms
        total_count:
          description: この bucket/group 内のフィードバック行数です。
          title: Total Count
          type: integer
      required:
        - total_count
        - scored_count
      title: FeedbackAggregateBucket
      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

````