ToolJet/docs/versioned_docs/version-3.5.0-LTS/widgets/chat/csa.md

32 lines
3 KiB
Markdown
Raw Normal View History

[docs]: AI Release (#11965) * [docs]: Add Marketplace Plugin Anthropic * [docs]: Add Marketplace Plugin Gemini * Update Operations * Update Operation * [docs]: Add Marketplace Plugin Hugging Face * Update Intro Pata * Update Intro Para * Add Model Example and Info on Inference API * Update intro para * Update Model Example * Grammatical Improvements * Grammatical Updates * Grammar * Update example * [docs]: Add Marketplace Plugin Mistral AI * Update models * [docs]: Add Marketplace Plugin Qdrant * Update Models in Beta * Update Models in V3 * [docs]: Add Marketplace Plugin Cohere * [docs]: Add Marketplace OpenAI Embedding * Update model in beta * Update model LTS * [docs]:AI Whitelist info in setups * update: ecs and cloud run * [docs] added chromadb * [docs] updated digital-ocean * [docs] updated k8s * Made changes in the docs for adding chromadb * [dos]: ToolJet AI license update * fix: formatting * fix: formatting * [docs]: Add Chat Component * Update Example and Add Info Box * [docs]: updated pinecone plugin * Update SS * [docs]: ToolJet AI * Update available model link * Fix typo * Add advanced parameters table * [docs] added AI_GATEWAY_URL * [fix] indentation * update: AI credits * fix: typo * Chat Component Properties * update: improved doc * CSA and Replicate to LTS * [docs] updated kubernetes and helm for Chromadb * [docs]: Add Marketplace Plugin Qdrant * [docs]: Add Marketplace Plugin Qdrant * Add Markdown * [docs]: Add Marketplace Plugin Weviate DB * Update qdrant beta * Update qdrant LTS * Update sidebars.js * Update sidebars.js * Update marketplace_overview beta * Update marketplace_overview.md * Update marketplace_overview.md * Update Response * formatting updates * Parameter Definition Updates * Update intro qdrant.md Beta * Update intro qdrant.md LTS * update local host * update: added to beta * fix: fomatting * fix: formatting * fix: doc * fix: review * update pritesh feedback * fix: typo * Mansukha Feedback Updates * Remove required and optional emoji * fix: updates * fix: updates * fix: review * minor update in the markdown docs * fix: plans * update: added screenshots * update: added docs to beta * add minor changes --------- Co-authored-by: Akshat Virmani <akshatvirmani93@gmail.com> Co-authored-by: PriteshKiri <pritesh.d.kiri@gmail.com> Co-authored-by: Souvik <psouvik260@gmail.com> Co-authored-by: Adish M <adish.madhu@gmail.com> Co-authored-by: Pritesh Kiri <77957844+PriteshKiri@users.noreply.github.com> Co-authored-by: Vaishnavi Joshi <vj.codes29@gmail.com> Co-authored-by: Karan Rathod <karan.altcampus@gmail.com>
2025-02-11 07:32:43 +00:00
---
id: csa
title: Component Specific Actions & Exposed Variables
---
This guide covers component-specific actions for the **Chat Component** and its exposed variables. To learn how to build a chatbot, refer to the [Chat Component Overview](/docs/widgets/chat/) guide. For more information on Chat Component Properties, check out the [Properties](/docs/widgets/chat/properties) guide.
## Component Specific Actions (CSA)
| <div style={{ width:'170px' }}> Action </div> | <div style={{ width:'200px' }}> Description </div> | How to Access |
|--------|-------------|---------------|
| sendMessage( ) | Sends a message in the chat. | Employ a RunJS query (for e.g. `components.chat1.sendMessage({message: "Hey! How can I help you?", type: "response"})`) or trigger it using an event. |
| clearHistory( ) | Clear chat history. | Employ a RunJS query (for e.g. `components.chat1.clearHistory()`) or trigger it using an event. |
| deleteMessage( ) | Delete a message using the MessageID | Employ a RunJS query (for e.g. `components.chat1.deleteMessage(MessageID)`) or trigger it using an event. |
| downloadChat( ) | Download the chat in JSON format. | Employ a RunJS query (for e.g. `components.chat1.downloadChat()`) or trigger it using an event. |
| setHistory( ) | Sets the chat history. | Employ a RunJS query (for e.g. `components.chat1.setHistory(History Object)`) or trigger it using an event. |
| appendHistory( ) | Appends chat history. | Employ a RunJS query (for e.g. `components.chat1.appendHistory(Message Object)`) or trigger it using an event. |
| setResponderAvatar( ) | Sets Responder's Avatar. | Employ a RunJS query (for e.g. `components.chat1.setResponderAvatar(Image URL)`) or trigger it using an event. |
| setUserAvatar( ) | Sets User's Avatar. | Employ a RunJS query (for e.g. `components.chat1.setUserAvatar(Image URL)`) or trigger it using an event. |
## Exposed Variables
| Variable | <div style={{ width:'200px' }}> Description </div> | How to Access |
|----------|-------------|---------------|
| history | Access the chat history. | Accessible dynamically with JS (for e.g., `{{components.chat1.history}}`). |
| isHistoryLoading | Indicates if the history is loading. | Accessible dynamically with JS (for e.g., `{{components.chat1.isHistoryLoading}}`). |
| isResponseLoading | Indicates if the response is loading. | Accessible dynamically with JS (for e.g., `{{components.chat1.isResponseLoading}}`). |
| isInputDisabled | Indicates if the input is disabled. | Accessible dynamically with JS (for e.g., `{{components.chat1.isInputDisabled}}`). |
| isVisible | Indicates if the component is visible. | Accessible dynamically with JS (for e.g., `{{components.chat1.isVisible}}`). |
| lastMessage | Holds the last message object of type message in the array. | Accessible dynamically with JS (for e.g., `{{components.chat1.lastMessage}}`). |
| lastResponse | Holds the last message object of type response in the array. | Accessible dynamically with JS (for e.g., `{{components.chat1.lastResponse}}`). |