98cef508a6
* Updated apt-packages source for devcontainer Switched the devcontainer's package source to a different repository to align with updated dependencies and package availability. The previous source from 'rocker-org' is replaced with 'devcontainers-contrib', which may offer more recent or relevant development tools. * Subject: Centralize prettier ignores and refine config Body: Centralized all prettier ignore rules by removing individual `.prettierignore` files in subprojects and updating the root `.prettierignore` to include previously ignored patterns, ensuring consistency across the workspace. Additionally, the prettier configuration was refined by making the file pattern for `.config.js` files consistent and adjusting quote styles for better readability. All lint scripts across the project were updated to respect the centralized ignore path, enhancing maintainability. The consolidation simplifies the process of managing ignore rules as the project scales, ensuring developers can focus on writing code without worrying about divergent formatting standards. These changes also align with introducing comprehensive linting across multiple environments to keep the codebase clean and consistent. This adjustment is a foundational step towards a more streamlined and unified code base, making it easier for new contributors to adhere to established coding standards and reducing the cognitive load associated with managing multiple configuration files across the project. * unset package json changes --------- Co-authored-by: Francisco Bischoff <franzbischoff@gmail.com> Co-authored-by: Francisco Bischoff <984592+franzbischoff@users.noreply.github.com> |
||
---|---|---|
.. | ||
scripts | ||
src | ||
.gitignore | ||
index.html | ||
jsconfig.json | ||
package.json | ||
README.md | ||
vite.config.js | ||
yarn.lock |
AnythingLLM Embedded Chat Widget
Warning
The use of the AnythingLLM embed is currently in beta. Please request a feature or report a bug via a Github Issue if you have any issues.
Warning
The core AnythingLLM team publishes a pre-built version of the script that is bundled with the main application. You can find it at the frontend URL
/embed/anythingllm-chat-widget.min.js
. You should only be working in this repo if you are wanting to build your own custom embed.
This folder of AnythingLLM contains the source code for how the embedded version of AnythingLLM works to provide a public facing interface of your workspace.
The AnythingLLM Embedded chat widget allows you to expose a workspace and its embedded knowledge base as a chat bubble via a <script>
or <iframe>
element that you can embed in a website or HTML.
Security
- Users will not be able to view or read context snippets like they can in the core AnythingLLM application
- Users are assigned a random session ID that they use to persist a chat session.
- Recommended You can limit both the number of chats an embedding can process and per-session.
by using the AnythingLLM embedded chat widget you are responsible for securing and configuration of the embed as to not allow excessive chat model abuse of your instance
Developer Setup
cd embed
from the root of the repoyarn
to install all dev and script dependenciesyarn dev
to boot up an example HTML page to use the chat embed widget.
While in development mode (yarn dev
) the script will rebuild on any changes to files in the src
directory. Ensure that the required keys for the development embed are accurate and set.
yarn build
will compile and minify your build of the script. You can then host and link your built script wherever you like.
Integrations & Embed Types
<script>
tag HTML embed
The primary way of embedding a workspace as a chat widget is via a simple <script>
<!--
An example of a script tag embed
REQUIRED data attributes:
data-embed-id // The unique id of your embed with its default settings
data-base-api-url // The URL of your anythingLLM instance backend
-->
<script
data-embed-id="5fc05aaf-2f2c-4c84-87a3-367a4692c1ee"
data-base-api-url="http://localhost:3001/api/embed"
src="http://localhost:3000/embed/anythingllm-chat-widget.min.js"
></script>
<script>
Customization Options
LLM Overrides
-
data-prompt
— Override the chat window with a custom system prompt. This is not visible to the user. If undefined it will use the embeds attached workspace system prompt. -
data-model
— Override the chat model used for responses. This must be a valid model string for your AnythingLLM LLM provider. If unset it will use the embeds attached workspace model selection or the system setting. -
data-temperature
— Override the chat model temperature. This must be a valid value for your AnythingLLM LLM provider. If unset it will use the embeds attached workspace model temperature or the system setting.
Style Overrides
-
data-chat-icon
— The chat bubble icon show when chat is closed. Options areplus
,chatCircle
,support
,search2
,search
,magic
. -
data-button-color
— The chat bubble background color shown when chat is closed. Value must be hex color code. -
data-user-bg-color
— The background color of the user chat bubbles when chatting. Value must be hex color code. -
data-assistant-bg-color
— The background color of the assistant response chat bubbles when chatting. Value must be hex color code. -
data-brand-image-url
— URL to image that will be show at the top of the chat when chat is open. -
data-greeting
— Default text message to be shown when chat is opened and no previous message history is found. -
data-no-sponsor
— Setting this attribute to anything will hide the custom or default sponsor at the bottom of an open chat window. -
data-sponsor-link
— A clickable link in the sponsor section in the footer of an open chat window. -
data-sponsor-text
— The text displays in sponsor text in the footer of an open chat window. -
data-position
- Adjust the positioning of the embed chat widget and open chat button. Defaultbottom-right
. Options arebottom-right
,bottom-left
,top-right
,top-left
. -
data-assistant-name
- Set the chat assistant name that appears above each chat message. DefaultAnythingLLM Chat Assistant
-
data-assistant-icon
- Set the icon of the chat assistant. -
data-window-height
- Set the chat window height. must include CSS suffix:px
,%
,rem
-
data-window-width
- Set the chat window width. must include CSS suffix:px
,%
,rem
-
data-text-size
- Set the text size of the chats in pixels.
Behavior Overrides
-
data-open-on-load
— Once loaded, open the chat as default. It can still be closed by the user. -
data-support-email
— Shows a support email that the user can used to draft an email via the "three dot" menu in the top right. Option will not appear if it is not set.
<iframe>
tag HTML embed
work in progress
<iframe>
Customization Options
work in progress