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

# Recherche Genai



## OpenAPI

````yaml /fr/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: Recherche 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: Réponse réussie
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erreur de validation
components:
  schemas:
    AgentSearchReq:
      description: >-
        Interrogez la table `messages` par contenu et/ou à l’aide de filtres au
        niveau des spans.


        Analyse la table `messages` (une ligne par occurrence de message,
        alimentée par une

        vue matérialisée issue des spans) et renvoie les correspondances au
        niveau des spans. La recherche en texte intégral renseigne

        `query` ; la récupération structurée (par ex. tous les messages d’une
        trace) laisse `query`

        vide et utilise les filtres ci-dessous. L’appelant regroupe par
        conversation pour la

        structure de la réponse.
      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: Réponse à une recherche en texte intégral dans les messages d’agent.
      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: >-
        Une conversation contenant des messages correspondant à la requête de
        recherche.
      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: Un message unique correspondant à la requête de recherche.
      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

````