For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Chat Controller

High-level controller for chat completions in custom elements.

UaiChatController provides a high-level API for performing chat completions from custom backoffice elements.

Import

Import
import { UaiChatController } from "@umbraco-ai/core";

Constructor

Constructor
new UaiChatController(host: UmbControllerHost)
Parameter
Type
Description

host

UmbControllerHost

The controller host (usually this in a Lit element)

Methods

complete

Performs a chat completion and returns the full response.

Signature
async complete(
    messages: UaiChatMessage[],
    options?: UaiChatOptions
): Promise<{ data?: UaiChatResult; error?: unknown }>
Parameter
Type
Description

messages

UaiChatMessage[]

The conversation messages

options

UaiChatOptions

Optional configuration

Returns: Promise resolving to { data?, error? }

Options

Complete Example

Last updated

Was this helpful?