Class Intelligence

Represents an intelligence service that can be used by a Brick to process and respond to messages.

Remarks

Currently, only OpenAI and custom functions are supported.

Hierarchy

  • Intelligence

Constructors

Properties

Methods

Constructors

Properties

functions?: {
    methods: {
        [key: string]: ((payload) => Promise<any>);
    };
    schema: ChatCompletionFunctions[];
}

The functions to use for the intelligence service

Type declaration

  • methods: {
        [key: string]: ((payload) => Promise<any>);
    }
    • [key: string]: ((payload) => Promise<any>)
        • (payload): Promise<any>
        • Parameters

          • payload: any

          Returns Promise<any>

  • schema: ChatCompletionFunctions[]
instance: OpenAIApi | ((payload) => Promise<any>)

The instance of the intelligence service

Type declaration

    • (payload): Promise<any>
    • Parameters

      • payload: any

      Returns Promise<any>

model: string

The model to use for the AI

The type of intelligence service to use

system: string

The system message to use in the chat

Methods

  • Sends a message to the intelligence service and gets a response.

    Parameters

    • question: any

      The question to ask the intelligence service.

    • Optional context: [{
          content: string;
          role: ChatCompletionRequestMessageRoleEnum;
      }]

      The context for the question.

    Returns Promise<any>

    The response from the intelligence service.

  • Requests an image from the intelligence service (if supported).

    Parameters

    • prompt: string

      The prompt for the image.

    • size: CreateImageRequestSizeEnum = '256x256'

      The size of the image.

    Returns Promise<any>

    The image from the intelligence service.