Learn how to use the chat API
The chat component enables dynamic, conversational interactions with OpenAI. This endpoint allows you to send messages and receive AI-generated responses in a natural dialogue format.
source
str: The source of the conversation. This parameter is optional.table
Optional[str]: The name of the table to query. Optional for PostgreSQL and ClickHouse sources.Returns a Dictionary containing:
type
: Always “chat”id
: Unique component identifierstate
: Dictionary containing:
messages
: List of conversation messagesconfig
: Dictionary containing:
source
: The source of the conversation (optional)data
: Pandas DataFrame converted to records format (optional)Implemented in services/openai.js
VITE_OPENAI_API_KEY
)Here’s a basic example of using the chat component:
For PostgreSQL sources, table_name
is required:
Similarly for ClickHouse sources, table_name
is required:
The chat component can be used with the selectbox component to allow the datasource to be changed interactively:
Learn how to use the chat API
The chat component enables dynamic, conversational interactions with OpenAI. This endpoint allows you to send messages and receive AI-generated responses in a natural dialogue format.
source
str: The source of the conversation. This parameter is optional.table
Optional[str]: The name of the table to query. Optional for PostgreSQL and ClickHouse sources.Returns a Dictionary containing:
type
: Always “chat”id
: Unique component identifierstate
: Dictionary containing:
messages
: List of conversation messagesconfig
: Dictionary containing:
source
: The source of the conversation (optional)data
: Pandas DataFrame converted to records format (optional)Implemented in services/openai.js
VITE_OPENAI_API_KEY
)Here’s a basic example of using the chat component:
For PostgreSQL sources, table_name
is required:
Similarly for ClickHouse sources, table_name
is required:
The chat component can be used with the selectbox component to allow the datasource to be changed interactively: