Netter assistant API

The assistant API from Netter — 2 operation(s) for assistant.

OpenAPI Specification

netter-assistant-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DMI Backend actions assistant API
  version: 0.1.0
tags:
- name: assistant
paths:
  /api/v1/assistant/chats:
    post:
      tags:
      - assistant
      summary: Create Assistant Chat
      description: Start a new assistant chat (one row per 'New chat' click).
      operationId: create_assistant_chat_api_v1_assistant_chats_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatRead'
  /api/v1/assistant/chats/{chat_id}/message:
    post:
      tags:
      - assistant
      summary: Assistant Chat Message
      description: Send a message to the assistant — dispatches an agent turn.
      operationId: assistant_chat_message_api_v1_assistant_chats__chat_id__message_post
      parameters:
      - name: chat_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Chat Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssistantMessageRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssistantTurnResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ChatStatus:
      type: string
      enum:
      - idle
      - generating
      title: ChatStatus
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssistantMessageRequest:
      properties:
        content:
          type: string
          maxLength: 10000
          minLength: 1
          title: Content
        tagged_entities:
          items:
            $ref: '#/components/schemas/TaggedEntity'
          type: array
          maxItems: 10
          title: Tagged Entities
        referenced_database_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 10
          title: Referenced Database Ids
        attachments:
          items:
            additionalProperties:
              type: string
            type: object
          type: array
          maxItems: 10
          title: Attachments
      type: object
      required:
      - content
      title: AssistantMessageRequest
    TaggedEntity:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
      type: object
      required:
      - id
      - name
      title: TaggedEntity
    AssistantTurnResponse:
      properties:
        status:
          type: string
          const: generating
          title: Status
          default: generating
      type: object
      title: AssistantTurnResponse
    ChatRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        company_id:
          type: string
          format: uuid
          title: Company Id
        user_id:
          type: string
          format: uuid
          title: User Id
        dashboard_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Dashboard Id
        project_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Project Id
        chat_type:
          type: string
          title: Chat Type
        title:
          type: string
          title: Title
        status:
          $ref: '#/components/schemas/ChatStatus'
        generation_token:
          type: integer
          title: Generation Token
          default: 0
        is_suppressed:
          type: boolean
          title: Is Suppressed
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - company_id
      - user_id
      - dashboard_id
      - chat_type
      - title
      - status
      - is_suppressed
      - created_at
      - updated_at
      title: ChatRead