> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dados.rio/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Unified History

> Obtém o histórico unificado de alterações (system prompts e configurações)
para um tipo de agente.

Args:
    agent_type: Tipo do agente
    limit: Limite de resultados (1-200)
    db: Sessão do banco de dados

Returns:
    UnifiedHistoryResponse: Histórico unificado de alterações



## OpenAPI

````yaml https://services.staging.app.dados.rio/eai-agent/openapi.json get /api/v1/unified-history
openapi: 3.1.0
info:
  title: Agentic Search API
  description: >-
    API que gerencia os fluxos e ferramentas dos agentes de IA da Prefeitura do
    Rio de Janeiro
  version: 0.1.0
servers:
  - url: https://services.staging.app.dados.rio/eai-agent
    description: Staging
security: []
paths:
  /api/v1/unified-history:
    get:
      tags:
        - Unified History
      summary: Get Unified History
      description: >-
        Obtém o histórico unificado de alterações (system prompts e
        configurações)

        para um tipo de agente.


        Args:
            agent_type: Tipo do agente
            limit: Limite de resultados (1-200)
            db: Sessão do banco de dados

        Returns:
            UnifiedHistoryResponse: Histórico unificado de alterações
      operationId: get_unified_history_api_v1_unified_history_get
      parameters:
        - name: agent_type
          in: query
          required: false
          schema:
            type: string
            title: Agent Type
            description: Tipo do agente
            default: agentic_search
          description: Tipo do agente
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Limite de resultados
            default: 50
            title: Limit
          description: Limite de resultados
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnifiedHistoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UnifiedHistoryResponse:
      properties:
        agent_type:
          type: string
          title: Agent Type
          description: Tipo do agente
        total_items:
          type: integer
          title: Total Items
          description: Total de itens retornados
        items:
          items:
            $ref: '#/components/schemas/UnifiedHistoryItem'
          type: array
          title: Items
          description: Lista de itens do histórico
      type: object
      required:
        - agent_type
        - total_items
        - items
      title: UnifiedHistoryResponse
      description: Resposta do histórico unificado.
      example:
        agent_type: agentic_search
        items:
          - author: admin
            change_type: both
            config:
              config_id: def456
              is_active: true
              metadata: {}
              model_name: gpt-4
              tools:
                - google_search
                - public_services
            created_at: '2023-05-16T14:30:15.123456'
            is_active: true
            metadata:
              author: admin
              reason: Melhoria completa
            preview: >-
              System Prompt: Você é EAí, assistente oficial... | Config: Tools:
              google_search, public_services...
            prompt:
              content_preview: Você é EAí, assistente oficial...
              is_active: true
              metadata: {}
              prompt_id: abc123
            reason: Melhoria completa do sistema
            version_id: f47ac10b-58cc-4372-a567-0e02b2c3d479
            version_number: 3
        total_items: 3
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UnifiedHistoryItem:
      properties:
        version_id:
          type: string
          title: Version Id
          description: ID único da versão
        version_number:
          type: integer
          title: Version Number
          description: Número sequencial da versão
        change_type:
          type: string
          title: Change Type
          description: 'Tipo da alteração: ''prompt'', ''config'', ''both'''
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Data de criação da versão
        author:
          anyOf:
            - type: string
            - type: 'null'
          title: Author
          description: Autor da alteração
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Motivo da alteração
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Descrição detalhada
        preview:
          type: string
          title: Preview
          description: Preview unificado da alteração
        is_active:
          type: boolean
          title: Is Active
          description: Se esta versão está atualmente ativa
          default: false
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Metadados da versão
        prompt:
          anyOf:
            - $ref: '#/components/schemas/PromptInfo'
            - type: 'null'
          description: Informações do prompt se aplicável
        config:
          anyOf:
            - $ref: '#/components/schemas/ConfigInfo'
            - type: 'null'
          description: Informações da config se aplicável
      type: object
      required:
        - version_id
        - version_number
        - change_type
        - preview
      title: UnifiedHistoryItem
      description: Item do histórico unificado.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PromptInfo:
      properties:
        prompt_id:
          type: string
          title: Prompt Id
          description: ID do prompt
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
          description: Conteúdo completo do prompt
        content_preview:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Preview
          description: Preview do conteúdo
        is_active:
          type: boolean
          title: Is Active
          description: Se o prompt está ativo
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Metadados do prompt
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Data de criação do prompt
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: Data de atualização do prompt
      type: object
      required:
        - prompt_id
        - is_active
      title: PromptInfo
      description: Informações do system prompt em uma versão.
    ConfigInfo:
      properties:
        config_id:
          type: string
          title: Config Id
          description: ID da configuração
        memory_blocks:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Memory Blocks
          description: Blocos de memória
        tools:
          items:
            type: string
          type: array
          title: Tools
          description: Ferramentas
        model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Name
          description: Nome do modelo
        embedding_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Name
          description: Nome do embedding
        is_active:
          type: boolean
          title: Is Active
          description: Se a configuração está ativa
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Metadados da configuração
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Data de criação da configuração
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: Data de atualização da configuração
      type: object
      required:
        - config_id
        - is_active
      title: ConfigInfo
      description: Informações da configuração em uma versão.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````