feat: add list of types
This commit is contained in:
parent
75d1a003dc
commit
4bb76ed218
4 changed files with 1275 additions and 2 deletions
1199
poetry.lock
generated
Normal file
1199
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
22
pyproject.toml
Normal file
22
pyproject.toml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
[tool.poetry]
|
||||||
|
name = "expert-backend"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = ""
|
||||||
|
authors = ["Ibis Prevedello <ibiscp@gmail.com>"]
|
||||||
|
readme = "README.md"
|
||||||
|
packages = [{include = "expert_backend"}]
|
||||||
|
|
||||||
|
[tool.poetry.dependencies]
|
||||||
|
python = "^3.10"
|
||||||
|
openai = "^0.26.5"
|
||||||
|
fastapi = "^0.91.0"
|
||||||
|
langchain = {path = "../langchain", develop = true}
|
||||||
|
uvicorn = "^0.20.0"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
black = "^23.1.0"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["poetry-core"]
|
||||||
|
build-backend = "poetry.core.masonry.api"
|
||||||
50
src/list.py
Normal file
50
src/list.py
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
from fastapi import APIRouter
|
||||||
|
|
||||||
|
from langchain import chains
|
||||||
|
from langchain import agents
|
||||||
|
from langchain import prompts
|
||||||
|
from langchain import llms
|
||||||
|
from langchain import utilities
|
||||||
|
from langchain.chains.conversation import memory
|
||||||
|
|
||||||
|
|
||||||
|
# build router
|
||||||
|
router = APIRouter(
|
||||||
|
prefix="/list",
|
||||||
|
tags=["list"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/")
|
||||||
|
def read_items():
|
||||||
|
return ["chains", "agents", "prompts", "llms", "utilities", "memories"]
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/chains")
|
||||||
|
def chains():
|
||||||
|
return chains.__all__
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/agents")
|
||||||
|
def agents():
|
||||||
|
return agents.__all__
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/prompts")
|
||||||
|
def prompts():
|
||||||
|
return prompts.__all__
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/llms")
|
||||||
|
def llms():
|
||||||
|
return llms.__all__
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/utilities")
|
||||||
|
def utilities():
|
||||||
|
return utilities.__all__
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/memories")
|
||||||
|
def memories():
|
||||||
|
return memory.__all__
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from endpoints import router
|
from endpoints import router as endpoints_router
|
||||||
|
from list import router as list_router
|
||||||
|
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
"""Create the FastAPI app and include the router."""
|
"""Create the FastAPI app and include the router."""
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
app.include_router(router)
|
app.include_router(endpoints_router)
|
||||||
|
app.include_router(list_router)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue