Class ConversationCallableFunctionsInternal

Holds the callable functions of a Conversation.

This class is used internally by the library and is not meant to be instantiated by consumers of the library.

Hierarchy

  • ConversationCallableFunctions

Constructors

  • Parameters

    • pluginService: ConversationPluginService<ConversationPlugin<string, any, any>[]>
    • options: {
          functions?: ({ name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; ... 10 more ...; additionalProperties?: boolean | ... 1 more ... | undefined; } | undefined; })[];
      } = {}
      • Optional functions?: ({ name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; ... 10 more ...; additionalProperties?: boolean | ... 1 more ... | undefined; } | undefined; })[]

    Returns ConversationCallableFunctions

Properties

addCallableFunctionEvents: EventManager<AddCallableFunctionListener> = ...
functions: CallableFunction[]
pluginService: ConversationPluginService<ConversationPlugin<string, any, any>[]>
removeCallableFunctionEvents: EventManager<RemoveCallableFunctionListener> = ...

Methods

  • Adds a function to the conversation. This function can be "called" by the assistant, generating a function call message.

    Parameters

    • fn: {
          description?: string;
          id?: string;
          name: string;
          parameters?: {
              $comment?: string;
              additionalProperties?: boolean | JsonSchema;
              default?: any;
              deprecated?: boolean;
              description?: string;
              examples?: any[];
              maxProperties?: number;
              minProperties?: number;
              patternProperties?: Record<string, JsonSchema>;
              properties?: Record<string, JsonSchema>;
              readOnly?: boolean;
              required?: string[];
              title?: string;
              type: "object";
              unevaluatedProperties?: boolean;
              writeOnly?: boolean;
          };
      } | CallableFunction

      The function to add to the conversation.

    Returns void

  • Adds a listener function that is called whenever a callableFunction is added to the conversation.

    Parameters

    Returns (() => void)

    A function that removes the listener from the list of listeners.

      • (): void
      • Returns void

  • Adds a listener function that is called whenever a callableFunction is removed to the conversation.

    Parameters

    Returns (() => void)

    A function that removes the listener from the list of listeners.

      • (): void
      • Returns void

  • Adds a listener function that is called only once whenever a callableFunction is added to the conversation.

    Parameters

    Returns (() => void)

    A function that removes the listener from the list of listeners.

      • (): void
      • Returns void

  • Adds a listener function that is called only once whenever a callableFunction is removed to the conversation.

    Parameters

    Returns (() => void)

    A function that removes the listener from the list of listeners.

      • (): void
      • Returns void

  • Removes a callable function from the conversation.

    Parameters

    • idOrFn: string | {
          description?: string;
          id?: string;
          name: string;
          parameters?: {
              $comment?: string;
              additionalProperties?: boolean | JsonSchema;
              default?: any;
              deprecated?: boolean;
              description?: string;
              examples?: any[];
              maxProperties?: number;
              minProperties?: number;
              patternProperties?: Record<string, JsonSchema>;
              properties?: Record<string, JsonSchema>;
              readOnly?: boolean;
              required?: string[];
              title?: string;
              type: "object";
              unevaluatedProperties?: boolean;
              writeOnly?: boolean;
          };
      } | CallableFunction

      Either the ID of the function, the function itself, or the function model.

    Returns void

  • Internal

    Serializes the ConversationCallableFunctions to JSON.

    Returns {
        functions?: ({ name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; ... 10 more ...; additionalProperties?: boolean | ... 1 more ... | undefined; } | undefined; })[];
    }

    A JSON representation of the ConversationCallableFunctions instance.

    This method is used internally by the library and is not meant to be used by consumers of the library.

    • Optional functions?: ({ name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; ... 10 more ...; additionalProperties?: boolean | ... 1 more ... | undefined; } | undefined; })[]

Generated using TypeDoc