Skip to content

Commit

Permalink
fix(pin pydantic version):
Browse files Browse the repository at this point in the history
  • Loading branch information
msoedov committed Nov 6, 2023
1 parent 97c2334 commit 57cfdde
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 52 deletions.
16 changes: 2 additions & 14 deletions langcorn/server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,13 @@

from fastapi import Depends, FastAPI, Header, HTTPException, Request
from fastapi.security.utils import get_authorization_scheme_param
from langchain.schema import messages_from_dict, messages_to_dict
from langchain.callbacks import get_openai_callback
from langchain.chains.base import Chain
from langchain.schema import messages_from_dict, messages_to_dict
from loguru import logger
from pydantic import BaseModel
from uvicorn.importer import import_from_string

if sys.version_info < (3, 10):
# Broken in 3.9: https://github.com/msoedov/langcorn/actions/runs/6773166265/job/18407381002
class get_openai_callback:
def __enter__(self):
return

def __exit__(self, exc_type, exc_val, exc_tb):
return

else:
from langchain.callbacks import get_openai_callback


TRACK_USAGE = True

# TODO: improve logging
Expand Down
76 changes: 38 additions & 38 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bs4 = "0.0.1" # required for ex4.py
langchain-experimental = "^0.0.37"
certifi = "^2023.7.22"
numexpr = "^2.8.7"
pydantic = "^1.10.13"

[tool.poetry.group.dev.dependencies]
black = "^23.10.1"
Expand Down

1 comment on commit 57cfdde

@vercel
Copy link

@vercel vercel bot commented on 57cfdde Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

langcorn – ./

langcorn-msoedov.vercel.app
langcorn.vercel.app
langcorn-git-main-msoedov.vercel.app

Please sign in to comment.