Skip to main content

Workspace AI service

Workspace Lite and Enterprise deployments can use an AI service for UI generation tasks. These are separate from the custom agent integrations described here.

Set the AI service base URL in the deployment configuration. E.G. OpenBB Workspace Lite uses AI_API_URL. Requests originate in the user's browser, so the URL must be reachable from the browser. For shared deployments, use HTTPS and allow cross-origin requests from the Workspace origin.

Agent Rita is a reference implementation. Adding Agent Rita as a custom chat agent does not configure these UI features; the operator must also set the deployment's AI service URL.

Endpoints

EndpointRequestResponseWorkspace usage
POST /v1/generate/chat/titleJSON containing messagesJSON stringGenerate a chat title
POST /v1/generate/dashboard/titleJSON containing widgetsPlain textGenerate a dashboard name
POST /v1/enhance_promptJSON containing messages and optional Workspace contextPlain textRewrite a prompt without changing its intent
POST /v1/generate/widget_infoJSON containing widget_generation_requestJSON with title, description, category, and subcategoryGenerate widget metadata
POST /v1/generate/widget_info/fileMultipart form data containing fileJSON with title and descriptionGenerate uploaded-file metadata
POST /v1/generate/codeJSON containing the widget ID, prompt, language, and optional code or data contextJSON containing generated_code or an errorGenerate or modify table code

Authentication

Workspace includes the signed-in user's bearer token in these requests. Validate the token in the AI service or place the service behind an authenticated gateway. Do not log authorization headers or forwarded API keys.

Reference behavior

EndpointProcessing and fallback behavior
Chat titleUses the last five human messages, truncated to 500 characters each. Returns "New Chat" when no human message is available or generation fails.
Dashboard titleUses up to 20 widget names. Returns My Dashboard when no names are available or generation fails.
Prompt enhancementUses the latest human message and up to 30 widget names. Returns the original prompt when generation fails.
Widget metadataUses up to 3,000 characters of widget data. Falls back to metadata supplied in the request.
Uploaded-file metadataAccepts files up to 25 MB and reads up to 3,000 characters. Falls back to the filename.
Code generationSupports SQL and Python, with optional current code, SQL schema, and up to five sample rows. Returns a failure object when generation fails.

Requests that fail endpoint schema validation return 400. The uploaded-file endpoint returns 400 when the file is missing and 413 when it exceeds 25 MB. Model-provider failures return the endpoint-specific fallback response with status 200.

Workspace can request text code generation and provide semantic_models. Agent Rita's current code-generation route supports only sql and python, so it does not implement that variant.

See the Agent Rita source code for the reference route implementations.