Metadata-Version: 2.1
Name: talentwizer_commons
Version: 0.4.0
Summary: Common utilities and objects for Talentwizer projects
Author: Mihir
Author-email: mail@mihir@talentwizer.com
Requires-Python: >=3.11,<3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: aiofiles (>=23.2.1,<24.0.0)
Requires-Dist: boto3 (>=1.34.54,<2.0.0)
Requires-Dist: chargebee (==2.47.1)
Requires-Dist: docx2txt (>=0.8,<0.9)
Requires-Dist: email-validator (>=2.1.1,<3.0.0)
Requires-Dist: fastapi (>=0.104.1,<0.105.0)
Requires-Dist: google-api-python-client (>=2.92.0,<3.0.0)
Requires-Dist: google-auth (>=2.18.1,<3.0.0)
Requires-Dist: google-auth-oauthlib (>=1.0.0,<2.0.0)
Requires-Dist: linkedin_api
Requires-Dist: linkedin_scraper
Requires-Dist: llama-index (==0.10.33)
Requires-Dist: llama-index-tools-google
Requires-Dist: llama-index-vector-stores-mongodb (==0.1.4)
Requires-Dist: msal (==1.31.1)
Requires-Dist: nltk (>=3.8.1,<4.0.0)
Requires-Dist: pdfplumber (>=0.10.4,<0.11.0)
Requires-Dist: proxycurl-py
Requires-Dist: pymongo (>=4.6.1,<5.0.0)
Requires-Dist: pypdf (>=4.0.1,<5.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
Requires-Dist: stripe (>=5.2.0,<6.0.0)
Requires-Dist: uvicorn[standard] (>=0.23.2,<0.24.0)
Requires-Dist: wikipedia (>=1.4.0,<2.0.0)
Description-Content-Type: text/markdown

## 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](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
```
