Skip to content

This is a Python project that utilizes LangChain and FastAPI libraries. LangChain is used to generate docstrings for Python files, and FastAPI is used to call the LangChain generator. The project also utilizes Poetry for managing the virtual environment.

Notifications You must be signed in to change notification settings

Pastorio/Langchain-Generate-Docstring-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Project with LangChain and FastAPI

This is a Python project that utilizes LangChain and FastAPI libraries. LangChain is used to generate docstrings for Python files, and FastAPI is used to call the LangChain generator. The project also utilizes Poetry for managing the virtual environment.

Project Structure

The project has the following file structure:

- config/
- data/
- models/
- notebooks/
    - test_file/   # Contains Python files to test the generation of docstrings
    - langchainAPI.ipynb   # Jupyter Notebook with test code for the LangChain model
    - request_test.ipynb   # Jupyter Notebook with test code for the API
- src/   # Contains the source code
    - test_file/   # Contains Python files to test the generation of docstrings
    - langchain_functions.py   # Python file with LangChain functions
    - request_test.py   # Python file with test code for the API
- main.py   # Python file with the API code

Requirements

To run this project, make sure you have the following dependencies installed:

  • LangChain
  • FastAPI
  • Poetry

Installation

  1. Clone this repository:
git clone https://github.com/Pastorio/langchain-api.git
  1. Change into the project directory:
cd langchain-api
  1. Set up the virtual environment using Poetry:
poetry install
  1. Activate the virtual environment:
poetry shell

Usage

  1. Add your OpenAI key to the .env file
PROJECT_NAME="langchain-api"
OPENAI_API_KEY="sk-xxx"
  1. Start the FastAPI server by running the main.py file:
python main.py
  1. Run the src/request_test.py to generate docstring for a specific file.

More Details

For more detailed information about the project, including setup instructions, usage examples, and additional documentation, please refer to the project documentation on Notion.

The documentation covers topics such as:

  • Installation and dependencies
  • Project structure and file organization
  • API endpoints and usage
  • LangChain and FastAPI integration
  • Testing and validation

Please visit the project documentation for more information.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request in the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

This is a Python project that utilizes LangChain and FastAPI libraries. LangChain is used to generate docstrings for Python files, and FastAPI is used to call the LangChain generator. The project also utilizes Poetry for managing the virtual environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published