> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-bradley-turek-pfilter-operators-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Text-to-BeastMode

> Generate a Beast Mode calculation based on the given text input and data source schema.



## OpenAPI

````yaml /openapi/product/AI-Services.yaml post /api/ai/v1/text/beastmode
openapi: 3.1.0
info:
  title: AI Services
  description: >-
    Domo AI Services provide a consistent API to leverage Foundation Models to
    solve common problems such as natural language SQL generation (text-to-SQL),
    Summarization, Classification, Tool Calling and others.
  version: 2.3.3639_master
servers:
  - url: https://{subdomain}.domo.com
    variables:
      subdomain:
        description: The Domo instance subdomain.
        default: subdomain
security: []
tags:
  - name: AI Services - Classification
    description: Domo AI Service Classification APIs
  - name: AI Services - Data Extraction
    description: Domo AI Service Data Extraction APIs
  - name: AI Services - Embedding
    description: Domo AI Service Embedding APIs
  - name: AI Services - Image
    description: Domo AI Service Image APIs
  - name: AI Services - Messages
    description: Domo AI Service Messages APIs
  - name: AI Services - Sentiment Analysis
    description: Domo AI Service Sentiment Analysis APIs
  - name: AI Services - Text
    description: Domo AI Service Text APIs
paths:
  /api/ai/v1/text/beastmode:
    post:
      tags:
        - AI Services - Text
      summary: Text-to-BeastMode
      description: >-
        Generate a Beast Mode calculation based on the given text input and data
        source schema.
      operationId: textToBeastMode
      requestBody:
        description: Text to Beast Mode AI Service request.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToBeastModeRequest'
            examples:
              Basic:
                description: Basic Text-to-Beast-Mode request.
                value:
                  input: Count distinct products
                  dataSourceSchema:
                    dataSourceName: Store Sales
                    columns:
                      - type: STRING
                        name: product
                      - type: LONG
                        name: store
                      - type: LONG
                        name: amount
                      - type: DATETIME
                        name: timestamp
                      - type: STRING
                        name: region
              Non-default model:
                description: Text-to-Beast-Mode request with non-default model.
                value:
                  input: Count distinct products
                  model: 9f35cc70-47f0-46da-a3e9-92a76c574e41
                  dataSourceSchema:
                    dataSourceName: Store Sales
                    columns:
                      - type: STRING
                        name: product
                      - type: LONG
                        name: store
                      - type: LONG
                        name: amount
                      - type: DATETIME
                        name: timestamp
                      - type: STRING
                        name: region
        required: true
      responses:
        '200':
          description: >-
            TextAIResponse The generated calculation and model token usage
            information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextAIResponse'
              examples:
                Text-to-Beast-Mode Response:
                  description: Text-to-Beast-Mode Response
                  value:
                    prompt: >-
                      # MYSQL

                      #
                      {"dataSourceName":"Store_Sales","columns":[{"name":"product","type":"STRING"},{"name":"store","type":"LONG"},{"name":"amount","type":"LONG"},{"name":"timestamp","type":"DATETIME"},{"name":"region","type":"STRING"}]}

                      # Generate a query to answer the following:

                      # Count distinct products
                    output: COUNT(DISTINCT `product`)
                    modelId: domo.domo_ai.domogpt-medium-v1.2:anthropic
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: Conflict
      security:
        - domo-developer-token: []
components:
  schemas:
    TextToBeastModeRequest:
      type: object
      description: |-
        <p>
         Text-to-Beast-Mode AI Service Request.
         </p>

         <h2>Prompt Templates</h2>
         <p>
         A prompt template is a string that contains placeholders for parameters that will be replaced with parameter values before the prompt
         is submitted to the model.
         </p>
         <p>
         A default prompt template is set for each model configured for the Text-to-Beast-Mode AI Service. Individual requests can override the
         default template by including the <code>promptTemplate</code> parameter.
         </p>
         <h3>Prompt Template Parameters</h3>
         <p>
         The following request parameters are automatically injected into the prompt template if the associated placeholder is present:
         <ul>
          <li>input</li>
          <li>system</li>
          <li>dataSourceSchema</li>
         </ul>
         </p>
         <p>
         Models with built-in support for system prompts and chat message history do not need to include <em>system</em> or
         <em>chatContext</em> in the prompt template.
         </p>
         <p>
         Additional parameters can be provided in the <code>parameters</code> map as key-value pairs.
         </p>
         <h3>Prompt Template Examples</h3>
         <ul>
             <li>"${input}"</li>
             <li>"${system}\n${input}"</li>
         </ul>
      properties:
        input:
          type: string
          description: The input text.
        sessionId:
          type: string
          format: uuid
          description: >-
            The AI session ID. If provided, this request will be associated with
            the specified AI Session.
        dataSourceSchema:
          $ref: '#/components/schemas/AIDataSourceSchema'
          description: >-
            The data source schema and metadata to be included in the
            Text-to-Beast-Mode task prompt to generate a SQL
                 Calculation.
        promptTemplate:
          $ref: '#/components/schemas/ParameterizedPromptTemplate'
          description: >-
            The prompt template to use for the Text-to-Beast-Mode task. The
            default prompt template will be used if not
                 provided.
        parameters:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom parameters to inject into the prompt template if an
            associated placeholder is present.
        model:
          type: string
          description: >-
            The ID of the model to use for Text-to-Beast-Mode. The specified
            model must be configured for the
                 Text-to-Beast-Mode
                 AI Service by an Admin.
        modelConfiguration:
          type: object
          additionalProperties: {}
          description: >-
            Additional model-specific configuration parameter key-value pairs.
            e.g. temperature, max_tokens, etc.
        system:
          type: string
          description: >-
            The system message to use for the Text-to-SQL task. If not provided,
            the default system will be used. If
                 the model does not include built-in support for system prompts, this parameter may be included in the prompt
                 template using the "${system}" placeholder.
        temperature:
          type: number
          format: double
          description: >-
            Controls randomness in the model's output. Lower values make output
            more deterministic.
        maxTokens:
          type: integer
          format: int32
          description: The maximum number of tokens to generate in the response.
        disableValidation:
          type: boolean
          description: >-
            Whether to disable validation of the generated Beast Mode
            calculation.
        reasoningConfig:
          $ref: '#/components/schemas/ReasoningConfig'
          description: Configuration for reasoning behavior and effort level.
      required:
        - input
    TextAIResponse:
      type: object
      description: Response from a text AI Service.
      properties:
        prompt:
          type: string
          description: The formatted prompt that was used to generate the response.
        choices:
          type: array
          deprecated: true
          description: The list of choices generated by the model.
          items:
            $ref: '#/components/schemas/Choice'
        modelId:
          type: string
          description: The id of the model used to generate the response.
        sessionId:
          type: string
          format: uuid
          description: The id of the AI Session associated with this request.
        output:
          type: string
          description: The output of the model.
        modelProviderUsage:
          $ref: '#/components/schemas/ModelProviderUsage'
          description: The token usage from the model provider.
    AIDataSourceSchema:
      type: object
      description: The schema and additional metadata for a Data Source.
      properties:
        dataSourceId:
          type: string
          description: The unique identifier for the data source.
        dataSourceName:
          type: string
          description: The name of the data source.
        description:
          type: string
          description: A description of the data source.
        columns:
          type: array
          description: The columns in the data source.
          items:
            oneOf:
              - $ref: '#/components/schemas/AISchemaColumn'
              - $ref: '#/components/schemas/AISchemaCalculation'
    ParameterizedPromptTemplate:
      type: object
      description: |-
        <p>
         A prompt template string that contains placeholders for parameters that will be replaced with parameter values before the prompt
         is submitted to the model.
         </p>
         <p>
         <h3>Prompt Template Examples</h3>
         <ul>
             <li>"${input}"</li>
             <li>"${system}\n${input}"</li>
         </ul>
      properties:
        template:
          type: string
    ReasoningConfig:
      type: object
      properties:
        reasoningEffort:
          type: string
          enum:
            - NONE
            - LOW
            - MEDIUM
            - HIGH
    Choice:
      type: object
      description: A choice generated by a text AI model.
      properties:
        output:
          type: string
          description: The text model output.
    ModelProviderUsage:
      type: object
      properties:
        inputTokens:
          type: integer
          format: int64
        outputTokens:
          type: integer
          format: int64
        totalTokens:
          type: integer
          format: int64
        reasoningTokens:
          type: integer
          format: int64
    AISchemaColumn:
      type: object
      description: Data source column metadata.
      properties:
        name:
          type: string
          description: The name of the column.
          minLength: 1
        type:
          type: string
          description: The type of data in the column.
          minLength: 1
        displayName:
          type: string
          description: The column display name.
        description:
          type: string
          description: The column description.
        validValues:
          type: array
          deprecated: true
          description: Possible values for the column if only certain values are allowed.
          items:
            deprecated: true
          uniqueItems: true
        defaultValue:
          description: The default value for the column.
        synonyms:
          type: array
          description: Synonyms for the column name.
          items:
            type: string
          uniqueItems: true
        classification:
          type: string
          description: The classification for the data in the column.
        defaultAggregation:
          type: string
          description: The default aggregation for the column.
      required:
        - name
        - type
    AISchemaCalculation:
      allOf:
        - $ref: '#/components/schemas/AISchemaColumn'
        - type: object
          properties:
            templateId:
              type: integer
              format: int64
              description: The function template ID.
            formula:
              type: string
              description: The formula for the calculation.
            aggregatable:
              type: boolean
              description: Whether the calculation is able to be aggregated.
            legacyId:
              type: string
              description: The function template legacy ID.
      description: Data source column metadata for a calculation.
      required:
        - name
        - type
  securitySchemes:
    domo-developer-token:
      type: apiKey
      name: X-DOMO-Developer-Token
      in: header

````