diff --git a/pyproject.toml b/pyproject.toml index 4aeb3874..9e920076 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [project] name = "codeinterpreterapi" -version = "0.1.18" +version = "0.1.19" description = "CodeInterpreterAPI is an (unofficial) open source python interface for the ChatGPT CodeInterpreter." authors = [{ name = "Shroominic", email = "contact@shroominic.com" }] dependencies = [ "langchain-openai>=0.1.1", + "langchain-community>=0.2", "codeboxapi==0.1.19", "langchain>=0.1.14", "pyzmq==25.1.2", diff --git a/requirements-dev.lock b/requirements-dev.lock index 1bc584f0..80536e52 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,17 +10,19 @@ # universal: false -e file:. -aiohttp==3.9.3 +aiohappyeyeballs==2.4.3 + # via aiohttp +aiohttp==3.10.10 # via codeboxapi # via langchain # via langchain-community aiosignal==1.3.1 # via aiohttp -altair==5.3.0 +altair==5.4.1 # via streamlit -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.3.0 +anyio==4.6.2.post1 # via httpx # via jupyter-server # via openai @@ -28,7 +30,6 @@ appnope==0.1.4 # via ipykernel argon2-cffi==23.1.0 # via jupyter-server - # via nbclassic # via notebook argon2-cffi-bindings==21.2.0 # via argon2-cffi @@ -39,29 +40,29 @@ asttokens==2.4.1 async-timeout==4.0.3 # via aiohttp # via langchain -attrs==23.2.0 +attrs==24.2.0 # via aiohttp # via jsonschema # via referencing -babel==2.14.0 +babel==2.16.0 # via mkdocs-material beautifulsoup4==4.12.3 # via nbconvert -bleach==6.1.0 +bleach==6.2.0 # via nbconvert -blinker==1.7.0 +blinker==1.8.2 # via streamlit -cachetools==5.3.3 +cachetools==5.5.0 # via streamlit -certifi==2024.2.2 +certifi==2024.8.30 # via httpcore # via httpx # via requests -cffi==1.16.0 +cffi==1.17.1 # via argon2-cffi-bindings cfgv==3.4.0 # via pre-commit -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 # via requests click==8.1.7 # via mkdocs @@ -72,16 +73,15 @@ colorama==0.4.6 # via mkdocs-material comm==0.2.2 # via ipykernel -dataclasses-json==0.6.4 - # via langchain +dataclasses-json==0.6.7 # via langchain-community -debugpy==1.8.1 +debugpy==1.8.7 # via ipykernel decorator==5.1.1 # via ipython defusedxml==0.7.1 # via nbconvert -distlib==0.3.8 +distlib==0.3.9 # via virtualenv distro==1.9.0 # via openai @@ -91,15 +91,15 @@ exceptiongroup==1.2.2 # via anyio # via ipython # via pytest -executing==2.0.1 +executing==2.1.0 # via stack-data -fastjsonschema==2.19.1 +fastjsonschema==2.20.0 # via nbformat -filelock==3.13.4 +filelock==3.16.1 # via virtualenv fqdn==1.5.1 # via jsonschema -frozenlist==1.4.1 +frozenlist==1.5.0 # via aiohttp # via aiosignal ghp-import==2.1.0 @@ -110,13 +110,16 @@ gitpython==3.1.43 # via streamlit h11==0.14.0 # via httpcore -httpcore==1.0.5 +httpcore==1.0.6 # via httpx -httpx==0.27.0 +httpx==0.27.2 + # via langsmith # via openai -identify==2.5.35 +httpx-sse==0.4.0 + # via langchain-community +identify==2.6.1 # via pre-commit -idna==3.6 +idna==3.10 # via anyio # via httpx # via jsonschema @@ -125,10 +128,11 @@ idna==3.6 importlib-metadata==8.5.0 # via markdown # via mkdocs + # via mkdocs-get-deps # via nbconvert iniconfig==2.0.0 # via pytest -ipykernel==6.29.4 +ipykernel==6.29.5 # via nbclassic # via notebook ipython==8.18.1 @@ -141,32 +145,31 @@ isoduration==20.11.0 isort==5.13.2 jedi==0.19.1 # via ipython -jinja2==3.1.3 +jinja2==3.1.4 # via altair # via jupyter-server # via mkdocs # via mkdocs-material - # via nbclassic # via nbconvert # via notebook # via pydeck +jiter==0.7.0 + # via openai jsonpatch==1.33 - # via langchain # via langchain-core -jsonpointer==2.4 +jsonpointer==3.0.0 # via jsonpatch # via jsonschema -jsonschema==4.21.1 +jsonschema==4.23.0 # via altair # via jupyter-events # via nbformat -jsonschema-specifications==2023.12.1 +jsonschema-specifications==2024.10.1 # via jsonschema jupyter-client==7.4.9 # via ipykernel # via jupyter-kernel-gateway # via jupyter-server - # via nbclassic # via nbclient # via notebook jupyter-core==5.7.2 @@ -174,7 +177,6 @@ jupyter-core==5.7.2 # via jupyter-client # via jupyter-kernel-gateway # via jupyter-server - # via nbclassic # via nbclient # via nbconvert # via nbformat @@ -183,74 +185,77 @@ jupyter-events==0.10.0 # via jupyter-server jupyter-kernel-gateway==2.5.2 # via codeboxapi -jupyter-server==2.13.0 - # via nbclassic +jupyter-server==2.14.2 # via notebook-shim jupyter-server-terminals==0.5.3 # via jupyter-server jupyterlab-pygments==0.3.0 # via nbconvert -langchain==0.1.15 +langchain==0.3.7 # via codeinterpreterapi -langchain-community==0.0.32 - # via langchain -langchain-core==0.1.41 + # via langchain-community +langchain-community==0.3.5 + # via codeinterpreterapi +langchain-core==0.3.15 # via langchain # via langchain-community # via langchain-openai # via langchain-text-splitters -langchain-openai==0.1.2 +langchain-openai==0.2.5 # via codeinterpreterapi -langchain-text-splitters==0.0.1 +langchain-text-splitters==0.3.2 # via langchain -langsmith==0.1.43 +langsmith==0.1.139 # via langchain # via langchain-community # via langchain-core -markdown==3.6 +markdown==3.7 # via mkdocs # via mkdocs-material # via pymdown-extensions markdown-it-py==3.0.0 # via rich -markupsafe==2.1.5 +markupsafe==3.0.2 # via jinja2 # via mkdocs # via nbconvert -marshmallow==3.21.1 +marshmallow==3.23.1 # via dataclasses-json -matplotlib-inline==0.1.6 +matplotlib-inline==0.1.7 # via ipykernel # via ipython mdurl==0.1.2 # via markdown-it-py mergedeep==1.3.4 # via mkdocs + # via mkdocs-get-deps mistune==3.0.2 # via nbconvert -mkdocs==1.5.3 +mkdocs==1.6.1 # via mkdocs-material -mkdocs-material==9.5.17 +mkdocs-get-deps==0.2.0 + # via mkdocs +mkdocs-material==9.5.43 mkdocs-material-extensions==1.3.1 # via mkdocs-material -multidict==6.0.5 +multidict==6.1.0 # via aiohttp # via yarl -mypy==1.9.0 +mypy==1.13.0 mypy-extensions==1.0.0 # via mypy # via typing-inspect -nbclassic==1.0.0 +narwhals==1.12.1 + # via altair +nbclassic==1.1.0 # via notebook nbclient==0.10.0 # via nbconvert -nbconvert==7.16.3 +nbconvert==7.16.4 # via jupyter-server - # via nbclassic # via notebook nbformat==5.10.4 # via jupyter-server - # via nbclassic # via nbclient # via nbconvert # via notebook @@ -259,27 +264,25 @@ nest-asyncio==1.6.0 # via jupyter-client # via nbclassic # via notebook -nodeenv==1.8.0 +nodeenv==1.9.1 # via pre-commit -notebook==6.5.4 +notebook==6.5.7 # via jupyter-kernel-gateway notebook-shim==0.2.4 # via nbclassic numpy==1.26.4 - # via altair # via langchain # via langchain-community # via pandas - # via pyarrow # via pydeck # via streamlit -openai==1.16.2 +openai==1.53.0 # via langchain-openai -orjson==3.10.0 +orjson==3.10.11 # via langsmith overrides==7.7.0 # via jupyter-server -packaging==23.2 +packaging==24.1 # via altair # via ipykernel # via jupyter-server @@ -289,10 +292,9 @@ packaging==23.2 # via nbconvert # via pytest # via streamlit -paginate==0.5.6 +paginate==0.5.7 # via mkdocs-material -pandas==2.2.1 - # via altair +pandas==2.2.3 # via streamlit pandocfilters==1.5.1 # via nbconvert @@ -302,56 +304,58 @@ pathspec==0.12.1 # via mkdocs pexpect==4.9.0 # via ipython -pillow==10.3.0 +pillow==10.4.0 # via codeboxapi # via streamlit -platformdirs==4.2.0 +platformdirs==4.3.6 # via jupyter-core - # via mkdocs + # via mkdocs-get-deps # via virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via pytest -pre-commit==3.7.0 -prometheus-client==0.20.0 +pre-commit==4.0.1 +prometheus-client==0.21.0 # via jupyter-server - # via nbclassic # via notebook -prompt-toolkit==3.0.43 +prompt-toolkit==3.0.48 # via ipython -protobuf==4.25.3 +propcache==0.2.0 + # via yarl +protobuf==5.28.3 # via streamlit -psutil==5.9.8 +psutil==6.1.0 # via ipykernel ptyprocess==0.7.0 # via pexpect # via terminado -pure-eval==0.2.2 +pure-eval==0.2.3 # via stack-data -pyarrow==15.0.2 +pyarrow==18.0.0 # via streamlit pycparser==2.22 # via cffi -pydantic==2.6.4 +pydantic==2.9.2 # via codeboxapi # via langchain # via langchain-core # via langsmith # via openai # via pydantic-settings -pydantic-core==2.16.3 +pydantic-core==2.23.4 # via pydantic -pydantic-settings==2.2.1 +pydantic-settings==2.6.1 # via codeboxapi -pydeck==0.8.0 + # via langchain-community +pydeck==0.9.1 # via streamlit -pygments==2.17.2 +pygments==2.18.0 # via ipython # via mkdocs-material # via nbconvert # via rich -pymdown-extensions==10.7.1 +pymdown-extensions==10.12 # via mkdocs-material -pytest==8.1.1 +pytest==8.3.3 python-dateutil==2.9.0.post0 # via arrow # via ghp-import @@ -361,14 +365,15 @@ python-dotenv==1.0.1 # via pydantic-settings python-json-logger==2.0.7 # via jupyter-events -pytz==2024.1 +pytz==2024.2 # via pandas -pyyaml==6.0.1 +pyyaml==6.0.2 # via jupyter-events # via langchain # via langchain-community # via langchain-core # via mkdocs + # via mkdocs-get-deps # via pre-commit # via pymdown-extensions # via pyyaml-env-tag @@ -379,45 +384,43 @@ pyzmq==25.1.2 # via ipykernel # via jupyter-client # via jupyter-server - # via nbclassic # via notebook -referencing==0.34.0 +referencing==0.35.1 # via jsonschema # via jsonschema-specifications # via jupyter-events -regex==2023.12.25 +regex==2024.9.11 # via mkdocs-material # via tiktoken -requests==2.31.0 +requests==2.32.3 # via codeboxapi # via jupyter-kernel-gateway # via langchain # via langchain-community # via langsmith # via mkdocs-material + # via requests-toolbelt # via streamlit # via tiktoken +requests-toolbelt==1.0.0 + # via langsmith rfc3339-validator==0.1.4 # via jsonschema # via jupyter-events rfc3986-validator==0.1.1 # via jsonschema # via jupyter-events -rich==13.7.1 +rich==13.9.4 # via streamlit -rpds-py==0.18.0 +rpds-py==0.20.1 # via jsonschema # via referencing -ruff==0.3.5 +ruff==0.7.2 send2trash==1.8.3 # via jupyter-server - # via nbclassic # via notebook -setuptools==69.2.0 - # via nodeenv six==1.16.0 # via asttokens - # via bleach # via python-dateutil # via rfc3339-validator smmap==5.0.1 @@ -426,16 +429,16 @@ sniffio==1.3.1 # via anyio # via httpx # via openai -soupsieve==2.5 +soupsieve==2.6 # via beautifulsoup4 -sqlalchemy==2.0.29 +sqlalchemy==2.0.35 # via langchain # via langchain-community stack-data==0.6.3 # via ipython -streamlit==1.33.0 +streamlit==1.39.0 # via codeinterpreterapi -tenacity==8.2.3 +tenacity==9.0.0 # via langchain # via langchain-community # via langchain-core @@ -443,31 +446,27 @@ tenacity==8.2.3 terminado==0.18.1 # via jupyter-server # via jupyter-server-terminals - # via nbclassic # via notebook -tiktoken==0.6.0 +tiktoken==0.8.0 # via langchain-openai -tinycss2==1.2.1 +tinycss2==1.4.0 # via nbconvert toml==0.10.2 # via streamlit tomli==2.0.2 # via mypy # via pytest -toolz==0.12.1 - # via altair -tornado==6.4 +tornado==6.4.1 # via ipykernel # via jupyter-client # via jupyter-kernel-gateway # via jupyter-server - # via nbclassic # via notebook # via streamlit # via terminado -tqdm==4.66.2 +tqdm==4.66.6 # via openai -traitlets==5.14.2 +traitlets==5.14.3 # via comm # via ipykernel # via ipython @@ -477,48 +476,50 @@ traitlets==5.14.2 # via jupyter-kernel-gateway # via jupyter-server # via matplotlib-inline - # via nbclassic # via nbclient # via nbconvert # via nbformat # via notebook -types-python-dateutil==2.9.0.20240316 +types-python-dateutil==2.9.0.20241003 # via arrow -typing-extensions==4.11.0 +typing-extensions==4.12.2 # via altair # via anyio # via ipython + # via langchain-core + # via multidict # via mypy # via openai # via pydantic # via pydantic-core + # via rich # via sqlalchemy # via streamlit # via typing-inspect typing-inspect==0.9.0 # via dataclasses-json -tzdata==2024.1 +tzdata==2024.2 # via pandas uri-template==1.3.0 # via jsonschema -urllib3==2.2.1 +urllib3==2.2.3 # via requests -virtualenv==20.25.1 +virtualenv==20.27.1 # via pre-commit -watchdog==4.0.0 +watchdog==6.0.0 # via mkdocs wcwidth==0.2.13 # via prompt-toolkit -webcolors==1.13 +webcolors==24.8.0 # via jsonschema webencodings==0.5.1 # via bleach # via tinycss2 -websocket-client==1.7.0 +websocket-client==1.8.0 # via jupyter-server -websockets==12.0 +websockets==13.1 # via codeboxapi -yarl==1.9.4 +yarl==1.17.1 # via aiohttp zipp==3.20.2 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index eb48b191..14bcaf1b 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,76 +10,82 @@ # universal: false -e file:. -aiohttp==3.9.3 +aiohappyeyeballs==2.4.3 + # via aiohttp +aiohttp==3.10.10 # via codeboxapi # via langchain # via langchain-community aiosignal==1.3.1 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.3.0 +anyio==4.6.2.post1 # via httpx # via openai async-timeout==4.0.3 # via aiohttp # via langchain -attrs==23.2.0 +attrs==24.2.0 # via aiohttp -certifi==2024.2.2 +certifi==2024.8.30 # via httpcore # via httpx # via requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 # via requests codeboxapi==0.1.19 # via codeinterpreterapi -dataclasses-json==0.6.4 - # via langchain +dataclasses-json==0.6.7 # via langchain-community distro==1.9.0 # via openai exceptiongroup==1.2.2 # via anyio -frozenlist==1.4.1 +frozenlist==1.5.0 # via aiohttp # via aiosignal h11==0.14.0 # via httpcore -httpcore==1.0.5 +httpcore==1.0.6 # via httpx -httpx==0.27.0 +httpx==0.27.2 + # via langsmith # via openai -idna==3.6 +httpx-sse==0.4.0 + # via langchain-community +idna==3.10 # via anyio # via httpx # via requests # via yarl +jiter==0.7.0 + # via openai jsonpatch==1.33 - # via langchain # via langchain-core -jsonpointer==2.4 +jsonpointer==3.0.0 # via jsonpatch -langchain==0.1.15 +langchain==0.3.7 # via codeinterpreterapi -langchain-community==0.0.32 - # via langchain -langchain-core==0.1.41 + # via langchain-community +langchain-community==0.3.5 + # via codeinterpreterapi +langchain-core==0.3.15 # via langchain # via langchain-community # via langchain-openai # via langchain-text-splitters -langchain-openai==0.1.2 +langchain-openai==0.2.5 # via codeinterpreterapi -langchain-text-splitters==0.0.1 +langchain-text-splitters==0.3.2 # via langchain -langsmith==0.1.43 +langsmith==0.1.139 # via langchain # via langchain-community # via langchain-core -marshmallow==3.21.1 +marshmallow==3.23.1 # via dataclasses-json -multidict==6.0.5 +multidict==6.1.0 # via aiohttp # via yarl mypy-extensions==1.0.0 @@ -87,57 +93,65 @@ mypy-extensions==1.0.0 numpy==1.26.4 # via langchain # via langchain-community -openai==1.16.2 +openai==1.53.0 # via langchain-openai -orjson==3.10.0 +orjson==3.10.11 # via langsmith -packaging==23.2 +packaging==24.1 # via langchain-core # via marshmallow -pydantic==2.6.4 +propcache==0.2.0 + # via yarl +pydantic==2.9.2 # via codeboxapi # via langchain # via langchain-core # via langsmith # via openai # via pydantic-settings -pydantic-core==2.16.3 +pydantic-core==2.23.4 # via pydantic -pydantic-settings==2.2.1 +pydantic-settings==2.6.1 # via codeboxapi + # via langchain-community python-dotenv==1.0.1 # via pydantic-settings -pyyaml==6.0.1 +pyyaml==6.0.2 # via langchain # via langchain-community # via langchain-core pyzmq==25.1.2 # via codeinterpreterapi -regex==2023.12.25 +regex==2024.9.11 # via tiktoken -requests==2.31.0 +requests==2.32.3 # via codeboxapi # via langchain # via langchain-community # via langsmith + # via requests-toolbelt # via tiktoken +requests-toolbelt==1.0.0 + # via langsmith sniffio==1.3.1 # via anyio # via httpx # via openai -sqlalchemy==2.0.29 +sqlalchemy==2.0.35 # via langchain # via langchain-community -tenacity==8.2.3 +tenacity==9.0.0 # via langchain # via langchain-community # via langchain-core -tiktoken==0.6.0 +tiktoken==0.8.0 # via langchain-openai -tqdm==4.66.2 +tqdm==4.66.6 # via openai -typing-extensions==4.11.0 +typing-extensions==4.12.2 # via anyio + # via langchain-core + # via multidict # via openai # via pydantic # via pydantic-core @@ -145,9 +159,9 @@ typing-extensions==4.11.0 # via typing-inspect typing-inspect==0.9.0 # via dataclasses-json -urllib3==2.2.1 +urllib3==2.2.3 # via requests -websockets==12.0 +websockets==13.1 # via codeboxapi -yarl==1.9.4 +yarl==1.17.1 # via aiohttp diff --git a/src/codeinterpreterapi/config.py b/src/codeinterpreterapi/config.py index c917839d..ba2333c3 100644 --- a/src/codeinterpreterapi/config.py +++ b/src/codeinterpreterapi/config.py @@ -1,7 +1,7 @@ from typing import Optional from langchain_core.messages import SystemMessage -from langchain_core.pydantic_v1 import BaseSettings, SecretStr +from langchain_core.pydantic_v1 import BaseSettings from codeinterpreterapi.prompts import code_interpreter_system_message @@ -14,12 +14,12 @@ class CodeInterpreterAPISettings(BaseSettings): DEBUG: bool = False # Models - OPENAI_API_KEY: Optional[SecretStr] = None - AZURE_OPENAI_API_KEY: Optional[SecretStr] = None + OPENAI_API_KEY: Optional[str] = None + AZURE_OPENAI_API_KEY: Optional[str] = None AZURE_API_BASE: Optional[str] = None AZURE_API_VERSION: Optional[str] = None AZURE_DEPLOYMENT_NAME: Optional[str] = None - ANTHROPIC_API_KEY: Optional[SecretStr] = None + ANTHROPIC_API_KEY: Optional[str] = None # LLM Settings MODEL: str = "gpt-3.5-turbo"