We use Poetry to manage dependencies.
poetry shell
poetry install
Create testdata
directory in the root directory and add files.
Now we only support
.md
,.txt
,.docx
,
You can also import documents from github repositories.
Use pre-commit.
pre-commit install
(Optional) Create a .env
file in the root directory and add the following environment variables:
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=<LANGCHAIN_API_KEY>
MODEL_API=<the model api from Mattermost>
ACCESS_TOKEN=<Github access token>
Note:
- You can get the
LANGCHAIN_API_KEY
from LangSmith.- Get the
MODEL_API
from Mattermost.- How to get Github access token: Github Docs.
預設使用 port:6333
如果要新增或修改資料請使用此方法
cd vectorDB
docker-compose -f addData/docker-compose.yml up -d
cd vectorDB
docker build -t polyhistor:db .
docker run -d --restart always -p 6333:6333 --name polyhistor_qdrant polyhistor:db
cd vectorDB
python3 create_collection.py
cd vectorDB
python3 read_docs.py
Run Ollama:
ollama serve
Default embedding model is
chevalblanc/acge_text_embedding
and default language model isqwen:4b
.
Open a new terminal and run the following command:
cd src
python main.py
Then you can ask questions to the model.
If you want to exit, type bye
.