Skip to content

lion-devs/langchain-demo

Repository files navigation

LangChain-demo

This is a demo project to demonstrate the usage of the LangChain framework.

Currently, this project integrates with the following Large Language Models (LLMs):

In the future, we plan to add support for additional APIs such as Ollama and others. Stay tuned for updates!

Start the project

Prerequisites

  • Poetry
  • Pyenv

more details on how to install and setup pyenv and poetry can be found in the appendix (or enable virtualenvs.prefer-active-python to true)

Initial project

  1. Clone this repository

  2. Install dependencies using poetry

    poetry install --no-root
  3. Signup for LangSmith

  4. Remember the API key from the LangSmith-Personal-API Keys

Configure project

Checkout Available models:

  1. Modify the config/config.yaml file to set the model and question fields
  2. Create a .env file based on the .env.example file. cp .env.example .env
  3. Set all the environment variables in the .env file

Start the project

Run the following command to start the FastAPI server using Uvicorn:

poetry run uvicorn main:app --reload

or

poetry run fastapi dev main.py

Common Error Resolutions

If you encounter the following error:

TypeError: 'FieldInfo' object is not a mapping

You can resolve it by installing a specific version of the Pydantic library. Run the following command in your terminal:

pip install pydantic==1.10.2

About

Connect LLM API for demo

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages