-
Copy the
.env.example
file to a new file named.env
:cp .env.example .env
-
Open the
.env
file and replace the placeholder values with your actual configuration:LANGCHAIN_TRACING_V2=true LANGCHAIN_ENDPOINT=https://api.smith.langchain.com LANGCHAIN_API_KEY=<your-langchain-api-key> LANGCHAIN_PROJECT=<your-langchain-project> OPENAI_API_KEY=<your-openai-api-key> USER_AGENT=my_custom_agent
Replace the following:
<your-langchain-api-key>
: Your LangChain API key<your-langchain-project>
: Your LangChain project name<your-openai-api-key>
: Your OpenAI API key
Note:
LANGCHAIN_TRACING_V2
is set totrue
by default.LANGCHAIN_ENDPOINT
is pre-configured.USER_AGENT
is set to "my_custom_agent". Modify if needed.
This project uses pip-tools to manage dependencies. Follow these steps to set up your environment:
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install pip-tools:
pip install pip-tools
-
Install project dependencies:
pip-sync
We use pip-tools to manage project dependencies. Here's how to use it:
- Add the new package to
requirements.in
. - Run
pip-compile requirements.in
to updaterequirements.txt
. - Run
pip-sync
to install the new package.
- Update the version in
requirements.in
(if it's a direct dependency). - Run
pip-compile --upgrade requirements.in
to upgrade all packages. - Run
pip-sync
to apply the changes to your environment.
- Remove the package from
requirements.in
. - Run
pip-compile requirements.in
to updaterequirements.txt
. - Run
pip-sync
to apply the changes to your environment.
Remember to commit both requirements.in
and requirements.txt
after making changes.
- Ensure your virtual environment is activated.
- Run the main script:
python src/basic_rag/main.py