Create initial Tanuki bot api endpoint
What does this MR do and why?
Related https://gitlab.com/gitlab-org/enablement-section/tanuki-bot/-/issues/2
Creates an API endpoint that receives and responds with json:
POST /-/llm/tanuki_bot/ask
{ "q": "What is advanced search?" }
This is part of a series of MRs and should be reviewed and merged in this order
MR | status |
---|---|
Add support for the embedding database (!118156 - merged) (db setup) | merged |
Add the tanuki_bot model (!118195 - merged) (migration) | merged |
Create initial Tanuki bot api endpoint (!117695 - merged) (api) | in review |
Screenshots or screen recordings
How to set up and validate locally
Feature.enable(:openai_experimentation)
Feature.enable(:tanuki_bot)
::Gitlab::CurrentSettings.update!(openai_api_key: '<YOUR_KEY>')
- Follow instructions for settings up the MR dependency: Add support for the embedding database (!118156 - merged)
- Run migrations:
rails db:migrate
- * Clone the tanuki-bot repository
- * cd into the
pgvector
folder - * use asdf to install python (should be python 3.11.3)
asdf install python
- * install pip
- * install requirements
pip install -r requirements.txt
- * run the command to copy the chroma db to the gdk postgres database
OPENAI_API_KEY=not-an-actual-key PG_USER=<Your user> PG_HOST=<Your gdk install directory>/postgresql python chroma_to_pg.py
- Make an API request to
POST /-/llm/tanuki_bot/ask
* you only need to do this once to have data in the embedding database.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Dmitry Gruzd