FastApiAssistant #2

Merged
mongar28 merged 21 commits from FastApiAssistant into main 2024-11-07 18:23:14 -05:00
31 changed files with 1171 additions and 2 deletions
Showing only changes of commit 4be1115e3a - Show all commits

View File

@ -14,6 +14,8 @@ RUN poetry install --no-interaction --no-ansi --no-root
COPY ./app ./app
RUN pip3 install -r ./app/requirements.txt
RUN poetry install --no-interaction --no-ansi
EXPOSE 8080

View File

View File

@ -1,9 +1,13 @@
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from langchain.chat_models import ChatOpenAI
from langserve import add_routes
app = FastAPI()
llm = ChatOpenAI(
model="gpt-4o-mini",
temperature=0.9
)
@app.get("/")
async def redirect_root_to_docs():
@ -11,7 +15,11 @@ async def redirect_root_to_docs():
# Edit this to add the chain you want to add
add_routes(app, NotImplemented)
add_routes(
app,
llm,
path="/openai"
)
if __name__ == "__main__":
import uvicorn

1159
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff