This project creates a simple API server that provides a language translation service using the LangChain library and FastAPI. Users can use this API to translate their texts into different languages. The API is powered by the OpenAI GPT-4 model.
- Using
LangChain
andFastAPI
to perform language translation. - Natural language processing using the OpenAI GPT-4 based model.
- Secure management of sensitive information with
.env
file. - Easy to use with simple API endpoints.
-
Activate the virtual environment:
-
Windows:
venv\Scripts\activate
-
MacOS/Linux:
source venv/bin/activate
-
-
Install the required dependencies:
pip install -r requirements.txt
You need to add the OpenAI API key and other sensitive information to the .env file. Add the following line to your .env file:
OPENAI_API_KEY=your-openai-api-key