To start building the "Chatbot" project, you're going to need:
- node (
18.20.0
was used for development) - npm (
10.5.0
was used for development)
For installing dependencies, make sure that the current directory
is the ansible_ai_connect_chatbot
sub-directory first:
cd (your_git_work_directory)/ansible-ai-connect-service/ansible_ai_connect_chatbot
and run
npm install
Runs the app in the development mode. In the developing mode,
the UI attempts to connect to the local chatbot service
http://localhost:8080/v1/query
. If you need to connect
to a different URL, edit useChatbot.ts
.
Builds bundled javascript/css files.
The bundled javascript/css files are copied to
../ansible_ai_connect/main/static/chatbot
and the
index.html
file is copied to
../ansible_ai_connect/main/templates/chatbot/
.
Executes unit tests.
Executes unit tests with code coverage reports.
The text version of the report is shown on the console,
while the HTML version and the lcov.info
file are saved
in the coverage
sub-directory.
Chatbot is enabled when all of the following three parameters are defined:
-
ModelPipelineChatBot.config.inference_url
URL of the chat service to be used. -
ModelPipelineChatBot.config.model_id
Default AI model. It should be one of models defined in the configuration used by the chat service. -
CHATBOT_DEFAULT_PROVIDER
Default AI model provider. It should be one of providers defined in the configuration used by the chat service.
CHATBOT_DEFAULT_PROVIDER=wisdom
{
"ModelPipelineChatBot": {
"config": {
"inference_url": "http://127.0.0.1:8080",
"model_id": "granite3-8b"
}
}
}
Run the following GH workflows, in order:
1.- AAP Chatbot - Release It validates the package by running tests, if successful, creates a new Pull Request with the package information.
2.- AAP Chatbot - Publish Should be run just after releasing. It validates the package by running tests, if successful, it builds, assembles and publishes the new package version into npmjs.
NOTE: Split the whole process into two different workflows so it gives a bit more flexibility on how to release and when to publish. NOTE: Based on the npmjs guideline for publishing new packages.