basePath: /
definitions:
  ErrorResponse:
    properties:
      error:
        example: Invalid request
        type: string
      message:
        example: Detailed error message
        type: string
    type: object
  SystemInfoResponse:
    properties:
      arch:
        example: amd64
        type: string
      go_version:
        example: go1.20.0
        type: string
      os:
        example: linux
        type: string
      version:
        example: 1.0.0
        type: string
    type: object
  TestExecutionRequest:
    properties:
      api_key:
        description: Optional token to override global.VoiceflowAPIKey
        type: string
      suite:
        $ref: '#/definitions/TestSuiteRequest'
      voiceflow_subdomain:
        description: Optional subdomain to override global.VoiceflowSubdomain
        type: string
    required:
    - suite
    type: object
  TestExecutionResponse:
    properties:
      error:
        type: string
      id:
        example: 123e4567-e89b-12d3-a456-426614174000
        type: string
      logs:
        items:
          type: string
        type: array
      started_at:
        example: "2023-01-01T00:00:00Z"
        type: string
      status:
        example: running
        type: string
    type: object
  TestRequest:
    properties:
      id:
        example: test_1
        type: string
      test:
        $ref: '#/definitions/tests.Test'
    required:
    - id
    - test
    type: object
  TestStatusResponse:
    properties:
      completed_at:
        example: "2023-01-01T00:05:00Z"
        type: string
      error:
        type: string
      id:
        example: 123e4567-e89b-12d3-a456-426614174000
        type: string
      logs:
        items:
          type: string
        type: array
      started_at:
        example: "2023-01-01T00:00:00Z"
        type: string
      status:
        example: completed
        type: string
    type: object
  TestSuiteRequest:
    properties:
      description:
        example: Suite used as an example
        type: string
      environment_name:
        example: production
        type: string
      name:
        example: Example Suite
        type: string
      new_session_per_test:
        example: false
        type: boolean
      tests:
        items:
          $ref: '#/definitions/TestRequest'
        type: array
    required:
    - environment_name
    - name
    - tests
    type: object
  tests.Agent:
    properties:
      validate:
        items:
          $ref: '#/definitions/tests.Validation'
        type: array
    type: object
  tests.AgentTest:
    properties:
      goal:
        type: string
      maxSteps:
        type: integer
      openAIConfig:
        $ref: '#/definitions/tests.OpenAIConfig'
      persona:
        type: string
      userInformation:
        items:
          $ref: '#/definitions/tests.UserInfo'
        type: array
      voiceflowAgentTargetConfig:
        $ref: '#/definitions/tests.VoiceflowAgentTargetConfig'
      voiceflowAgentTesterConfig:
        $ref: '#/definitions/tests.VoiceflowAgentTesterConfig'
    type: object
  tests.IntentEntity:
    properties:
      name:
        type: string
      value:
        type: string
    type: object
  tests.IntentRequest:
    properties:
      entities:
        items:
          $ref: '#/definitions/tests.IntentEntity'
        type: array
      name:
        type: string
    type: object
  tests.Interaction:
    properties:
      agent:
        $ref: '#/definitions/tests.Agent'
      id:
        type: string
      user:
        $ref: '#/definitions/tests.User'
      variables:
        additionalProperties: true
        description: Variables to set in the agent state
        type: object
    type: object
  tests.OpenAIConfig:
    properties:
      model:
        type: string
      temperature:
        type: number
    type: object
  tests.SimilarityConfig:
    properties:
      model:
        type: string
      provider:
        type: string
      similarityThreshold:
        type: number
      temperature:
        type: number
      top_k:
        type: integer
      top_p:
        type: number
    type: object
  tests.Test:
    properties:
      agent:
        $ref: '#/definitions/tests.AgentTest'
      description:
        type: string
      interactions:
        items:
          $ref: '#/definitions/tests.Interaction'
        type: array
      name:
        type: string
    type: object
  tests.User:
    properties:
      event:
        type: string
      intent:
        $ref: '#/definitions/tests.IntentRequest'
      text:
        type: string
      type:
        type: string
      value:
        description: Used for button label
        type: string
    type: object
  tests.UserInfo:
    properties:
      name:
        type: string
      value:
        type: string
    type: object
  tests.Validation:
    properties:
      id:
        type: string
      similarityConfig:
        $ref: '#/definitions/tests.SimilarityConfig'
      type:
        type: string
      value:
        type: string
      values:
        items:
          type: string
        type: array
      variableConfig:
        $ref: '#/definitions/tests.VariableConfig'
    type: object
  tests.VariableConfig:
    properties:
      jsonPath:
        type: string
      name:
        type: string
    type: object
  tests.VoiceflowAgentTargetConfig:
    properties:
      variables:
        additionalProperties: true
        type: object
    type: object
  tests.VoiceflowAgentTesterConfig:
    properties:
      apiKey:
        type: string
      environmentName:
        type: string
      variables:
        additionalProperties: true
        type: object
    type: object
host: localhost:8080
info:
  contact:
    email: support@swagger.io
    name: API Support
    url: http://www.swagger.io/support
  description: API server for Voiceflow CLI test execution and management
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Voiceflow CLI API
  version: "1.0"
paths:
  /api/v1/system/info:
    get:
      consumes:
      - application/json
      description: Get information about the API server system
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/SystemInfoResponse'
      summary: Get system information
      tags:
      - system
  /api/v1/tests/cancel/{id}:
    post:
      consumes:
      - application/json
      description: Cancel a test execution that is currently running
      parameters:
      - description: Test execution ID
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/TestStatusResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        "409":
          description: Conflict
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: Cancel a running test execution
      tags:
      - tests
  /api/v1/tests/execute:
    post:
      consumes:
      - application/json
      description: Execute a Voiceflow test suite from request data and return execution
        ID
      parameters:
      - description: Test execution request with embedded suite and tests
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/TestExecutionRequest'
      produces:
      - application/json
      responses:
        "202":
          description: Accepted
          schema:
            $ref: '#/definitions/TestExecutionResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: Execute a test suite
      tags:
      - tests
  /api/v1/tests/status/{id}:
    get:
      consumes:
      - application/json
      description: Get the status and logs of a test execution
      parameters:
      - description: Test execution ID
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/TestStatusResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: Get test execution status
      tags:
      - tests
  /health:
    get:
      consumes:
      - application/json
      description: Check if the API server is running
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties:
              type: string
            type: object
      summary: Health check endpoint
      tags:
      - system
swagger: "2.0"
