> ## 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検索



## OpenAPI

````yaml /ja/weave/reference/service-api/openapi.json post /agents/search
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /agents/search:
    post:
      tags:
        - Agents
      summary: GenAI検索
      operationId: genai_search_agents_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSearchReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSearchRes'
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    AgentSearchReq:
      description: >-
        内容および/またはスパンレベルのフィルターで `messages` 表をクエリします。


        `messages` 表をスキャンし（一度出現した各メッセージにつき 1 行で、スパンからの MV
        によって生成されます）、一致するスパンレベルのヒットを返します。全文検索では `query`
        を設定します。構造化取得（たとえばトレース内のすべてのメッセージ）では `query`
        を空のままにし、以下のフィルターを使用します。呼び出し元はレスポンス形式に合わせて会話ごとにグループ化します。
      properties:
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
        limit:
          default: 20
          maximum: 1000
          minimum: 0
          title: Limit
          type: integer
        offset:
          default: 0
          minimum: 0
          title: Offset
          type: integer
        project_id:
          title: Project Id
          type: string
        provider_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Name
        query:
          default: ''
          title: Query
          type: string
        request_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Model
        roles:
          anyOf:
            - items:
                enum:
                  - ''
                  - user
                  - assistant
                  - system
                  - tool
                  - tool_call
                  - tool_result
                type: string
              type: array
            - type: 'null'
          title: Roles
        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
        trace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Trace Id
        truncate_content:
          default: true
          title: Truncate Content
          type: boolean
      required:
        - project_id
      title: AgentSearchReq
      type: object
    AgentSearchRes:
      description: エージェント メッセージに対する全文検索のレスポンス。
      properties:
        results:
          items:
            $ref: '#/components/schemas/AgentSearchConversationResult'
          title: Results
          type: array
        total_conversations:
          default: 0
          title: Total Conversations
          type: integer
      required:
        - results
      title: AgentSearchRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AgentSearchConversationResult:
      description: 検索クエリに一致したメッセージを含む会話。
      properties:
        agent_name:
          title: Agent Name
          type: string
        conversation_id:
          title: Conversation Id
          type: string
        conversation_name:
          title: Conversation Name
          type: string
        last_activity:
          format: date-time
          title: Last Activity
          type: string
        matched_messages:
          items:
            $ref: '#/components/schemas/AgentSearchMatchedMessage'
          title: Matched Messages
          type: array
      required:
        - conversation_id
        - conversation_name
        - agent_name
        - matched_messages
        - last_activity
      title: AgentSearchConversationResult
      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
    AgentSearchMatchedMessage:
      description: 検索クエリに一致した単一のメッセージ。
      properties:
        content_digest:
          title: Content Digest
          type: string
        content_preview:
          title: Content Preview
          type: string
        role:
          enum:
            - ''
            - user
            - assistant
            - system
            - tool
            - tool_call
            - tool_result
          title: Role
          type: string
        span_id:
          title: Span Id
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        trace_id:
          title: Trace Id
          type: string
      required:
        - span_id
        - trace_id
        - role
        - content_preview
        - content_digest
        - started_at
      title: AgentSearchMatchedMessage
      type: object

````