Getting Started
First, setup the environment:
poetry install
poetry shell
By default, we use the OpenAI LLM (though you can customize, see app/context.py). As a result you need to specify an OPENAI_API_KEY in an .env file in this directory.
Example .env file:
OPENAI_API_KEY=<openai_api_key>
Second, generate the embeddings of the documents in the ./data directory (if this folder exists - otherwise, skip this step):
python index_data.py
Third, run the development server:
python main.py
Then call the API endpoint /api/chat to see the result:
curl --location 'localhost:8000/api/chat' \
--header 'Content-Type: application/json' \
--data '{ "messages": [{ "role": "user", "content": "Hello" }] }'
You can start editing the API by modifying app/api/routers/chat.py. The endpoint auto-updates as you save the file.
Open http://localhost:8000/docs with your browser to see the Swagger UI of the API.
The API allows CORS for all origins to simplify development. You can change this behavior by setting the ENVIRONMENT environment variable to prod:
ENVIRONMENT=prod uvicorn main:app
Metadata
Release files for talentwizer_commons 1.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| talentwizer_commons-1.0.14.tar.gz | 44.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| talentwizer_commons-1.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.3 kB
Release files / talentwizer_commons-1.0.14.tar.gz
| Download URL | talentwizer_commons-1.0.14.tar.gz |
|---|---|
| Size | 44.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d92439c6cbedf5053eec441a67f3fc5814d85effa3e5142666b78fbc12b43ba3
|
|
BLAKE2b-256 checksum How to use checksums |
c91ee0d8d726e64e140045b2076dbe05008fac53254bdb7eb2b150a9f3c6bb5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.5 Darwin/24.3.0
|
Release files / talentwizer_commons-1.0.14-py3-none-any.whl
| Download URL | talentwizer_commons-1.0.14-py3-none-any.whl |
|---|---|
| Size | 60.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3b19934b43fd89fd9e4d2bc7c58d05027f161b3dea4d1958fe43dff2d352836
|
|
BLAKE2b-256 checksum How to use checksums |
9bb62cae4636cc5abae047c31d2ed1fc216b8a979536a0c9eea0761f52d8fcc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.5 Darwin/24.3.0
|