@ansible/ansible-ai-connect-chatbot
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Ansible AI Connect Chatbot UI

Build from source

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

Available Scripts

npm start

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.

npm run build

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/.

npm run test

Executes unit tests.

npm run coverage

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.

Test Chatbot in Local environment

Chatbot is enabled when all of the following three parameters are defined:

  1. ModelPipelineChatBot.config.inference_url URL of the chat service to be used.
  2. ModelPipelineChatBot.config.model_id Default AI model. It should be one of models defined in the configuration used by the chat service.
  3. 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"
    }
  }
}

Releasing and publishing

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @ansible/ansible-ai-connect-chatbot

Weekly Downloads

145

Version

0.1.4

License

none

Unpacked Size

6.82 MB

Total Files

23

Last publish

Collaborators

  • jtalton
  • zitanemeckova
  • skochay
  • roger600