This is the codebase for the search widget, which provides a modal for users to converse with an assistant.
The Search modal can be opened via hotkey or by clicking on the floating UI.
For a detailed example of how to set up the Widget, you can refer to the contents of search-widget/index.html
.
To get started developing the search widget, you will first need to install the dependencies:
In order to make authenticated requests to the search widget while in local development mode, you will need to configure reCAPTCHA according to the reCAPTCHA configuration guide.
This guide assumes that all commands are run from the root of the search-widget folder.
cd RunLLM/src/search-widget
To install the dependencies, run:
yarn install
You can build the widget's bundle by running:
yarn build
You will need to configure your widget in the src/search-widget/index.html
file according to the steps provided in the Installation and Configuration section.
Once you have your configuration set up accordingly, you can serve the widget by running:
npx serve
The npx serve
command will serve the index.html file located at the root of the search-widget directory.
Note: Running npx serve
creates an HTTP server. If you wish to serve an HTML file other than index.html
, this will require some additional configuration. Please refer to the documentation on npm for the serve package for more details.
After you are happy with your changes, you will need to publish a new verision of the npm package.
From the root of the search-widget
directory, run the following command:
yarn publish
This command will prompt you for the new package version number. You can either provide a new number here, or press enter to omit. If you provide the new version number, this command will update package.json and commit the change.
Running yarn publish requires that you are a part of the runllm npm organization. Please contact @agiron123 for help with this if you are not currently a member.
After your changes are published, you can check here to ensure that your newly published version is present.
After testing your changes and verifying that everything is working properly, you can deploy the changes to production by tagging the version as stable.
To do so, you will need to tag the npm package version as 'stable'. You can achieve this by running the following command:
yarn tag add @runllm/search-widget@<version_number> stable
For more information on the yarn tag command, you can refer to the documentation.