diff --git a/guardrails/api_client.py b/guardrails/api_client.py index e6bd9f1d7..8b7376e89 100644 --- a/guardrails/api_client.py +++ b/guardrails/api_client.py @@ -1,10 +1,10 @@ import os from typing import Optional -from guard_rails_api_client import AuthenticatedClient -from guard_rails_api_client.api.guard import update_guard, validate -from guard_rails_api_client.models import Guard, ValidatePayload -from guard_rails_api_client.types import UNSET +from guardrails_api_client import AuthenticatedClient +from guardrails_api_client.api.guard import update_guard, validate +from guardrails_api_client.models import Guard, ValidatePayload +from guardrails_api_client.types import UNSET from httpx import Timeout diff --git a/guardrails/guard.py b/guardrails/guard.py index 979780c9a..22120a51f 100644 --- a/guardrails/guard.py +++ b/guardrails/guard.py @@ -22,15 +22,15 @@ overload, ) -from guard_rails_api_client.models import AnyObject -from guard_rails_api_client.models import Guard as GuardModel -from guard_rails_api_client.models import ( +from guardrails_api_client.models import AnyObject +from guardrails_api_client.models import Guard as GuardModel +from guardrails_api_client.models import ( History, HistoryEvent, ValidatePayload, ValidationOutput, ) -from guard_rails_api_client.types import UNSET +from guardrails_api_client.types import UNSET from langchain_core.messages import BaseMessage from langchain_core.runnables import Runnable, RunnableConfig from pydantic import BaseModel diff --git a/guardrails/llm_providers.py b/guardrails/llm_providers.py index e010ef8fd..c115a969e 100644 --- a/guardrails/llm_providers.py +++ b/guardrails/llm_providers.py @@ -1,7 +1,7 @@ import asyncio from typing import Any, Awaitable, Callable, Dict, Iterable, List, Optional, Union, cast -from guard_rails_api_client.models.validate_payload_llm_api import ValidatePayloadLlmApi +from guardrails_api_client.models.validate_payload_llm_api import ValidatePayloadLlmApi from pydantic import BaseModel from guardrails.utils.exception_utils import UserFacingException diff --git a/poetry.lock b/poetry.lock index ff9d3f812..f19c97ce4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -1791,9 +1791,9 @@ files = [ protobuf = ["grpcio-tools (>=1.62.1)"] [[package]] -name = "guard-rails-api-client" -version = "0.0.2" -description = "A client library for accessing GuardRails API" +name = "guardrails-api-client" +version = "0.1.0" +description = "A client library for accessing Guardrails API" optional = false python-versions = ">=3.8, <4" files = [] @@ -1807,9 +1807,9 @@ python-dateutil = ">=2.8.0,<3" [package.source] type = "git" url = "https://github.com/guardrails-ai/guardrails-api-client.git" -reference = "v0.0.2" -resolved_reference = "c9d934081c4303359abe294c6ea6e80b20f02aa7" -subdirectory = "guard-rails-api-client" +reference = "v0.1.0" +resolved_reference = "ecded7439e53c5020c61fefea9933539bfd75b0c" +subdirectory = "guardrails-api-client" [[package]] name = "h11" @@ -1971,13 +1971,13 @@ testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs [[package]] name = "importlib-resources" -version = "6.2.0" +version = "6.3.0" description = "Read resources from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_resources-6.2.0-py3-none-any.whl", hash = "sha256:8d035473d681d9bb95d06a31ad18594962933405519d36f4af1565fe6f998ad6"}, - {file = "importlib_resources-6.2.0.tar.gz", hash = "sha256:4351403cba8e3a1c03ff15b6bbea1cde4c6de00c705f49ea13909b404b415b9c"}, + {file = "importlib_resources-6.3.0-py3-none-any.whl", hash = "sha256:783407aa1cd05550e3aa123e8f7cfaebee35ffa9cb0242919e2d1e4172222705"}, + {file = "importlib_resources-6.3.0.tar.gz", hash = "sha256:166072a97e86917a9025876f34286f549b9caf1d10b35a1b372bffa1600c6569"}, ] [package.dependencies] @@ -2633,13 +2633,13 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-ena [[package]] name = "langchain-core" -version = "0.1.30" +version = "0.1.31" description = "Building applications with LLMs through composability" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain_core-0.1.30-py3-none-any.whl", hash = "sha256:c9643505e41d25ba8f20a2e8bf083d0f0d50b9a098d901511fff8df79f831ada"}, - {file = "langchain_core-0.1.30.tar.gz", hash = "sha256:e13a016e55e7f082ff3eeeda2d0cb505b89a8830e3a23c1d134d0a89d7871894"}, + {file = "langchain_core-0.1.31-py3-none-any.whl", hash = "sha256:ff028f00db8ff03565b542cea81be27426022a72c6545b54d8de66fa00948ab3"}, + {file = "langchain_core-0.1.31.tar.gz", hash = "sha256:d660cf209bb6ce61cb1c853107b091aaa809015a55dce9e0ce19b51d4c8f2a70"}, ] [package.dependencies] @@ -2671,13 +2671,13 @@ data = ["language-data (>=1.1,<2.0)"] [[package]] name = "langsmith" -version = "0.1.23" +version = "0.1.24" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langsmith-0.1.23-py3-none-any.whl", hash = "sha256:69984268b9867cb31b875965b3f86b6f56ba17dd5454d487d3a1a999bdaeea69"}, - {file = "langsmith-0.1.23.tar.gz", hash = "sha256:327c66ec0de8c1bc57bfa47bbc70a29ef749e97c3e5571b9baf754d1e0644220"}, + {file = "langsmith-0.1.24-py3-none-any.whl", hash = "sha256:898ef5265bca8fc912f7fbf207e1d69cacd86055faecf6811bd42641e6319840"}, + {file = "langsmith-0.1.24.tar.gz", hash = "sha256:432b829e763f5077df411bc59bb35449813f18174d2ebc8bbbb38427071d5e7d"}, ] [package.dependencies] @@ -3407,13 +3407,13 @@ files = [ [[package]] name = "nbclient" -version = "0.9.1" +version = "0.10.0" description = "A client library for executing notebooks. Formerly nbconvert's ExecutePreprocessor." optional = false python-versions = ">=3.8.0" files = [ - {file = "nbclient-0.9.1-py3-none-any.whl", hash = "sha256:2c50a866e8dd6c5f655de47d2e252c82d2ebe978574e760ac229f5950593a434"}, - {file = "nbclient-0.9.1.tar.gz", hash = "sha256:4f7b78c6c2a380e228f8a3bb469b847cb24e5b8ad6fda410691b5621e05ce5a2"}, + {file = "nbclient-0.10.0-py3-none-any.whl", hash = "sha256:f13e3529332a1f1f81d82a53210322476a168bb7090a0289c795fe9cc11c9d3f"}, + {file = "nbclient-0.10.0.tar.gz", hash = "sha256:4b3f1b7dba531e498449c4db4f53da339c91d449dc11e9af3a43b4eb5c5abb09"}, ] [package.dependencies] @@ -3898,13 +3898,13 @@ files = [ [[package]] name = "openai" -version = "1.13.3" +version = "1.14.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.13.3-py3-none-any.whl", hash = "sha256:5769b62abd02f350a8dd1a3a242d8972c947860654466171d60fb0972ae0a41c"}, - {file = "openai-1.13.3.tar.gz", hash = "sha256:ff6c6b3bc7327e715e4b3592a923a5a1c7519ff5dd764a83d69f633d49e77a7b"}, + {file = "openai-1.14.0-py3-none-any.whl", hash = "sha256:5c9fd3a59f5cbdb4020733ddf79a22f6b7a36d561968cb3f3dd255cdd263d9fe"}, + {file = "openai-1.14.0.tar.gz", hash = "sha256:e287057adf0ec3315abc32ddcc968d095879abd9b68bf51c0402dab13ab5ae9b"}, ] [package.dependencies] @@ -4249,13 +4249,13 @@ ptyprocess = ">=0.5" [[package]] name = "phonenumbers" -version = "8.13.31" +version = "8.13.32" description = "Python version of Google's common library for parsing, formatting, storing and validating international phone numbers." optional = true python-versions = "*" files = [ - {file = "phonenumbers-8.13.31-py2.py3-none-any.whl", hash = "sha256:e45d0bc852516a3a6594bcec0ae47b825421a8adcfcf5f114ad148f1523d8646"}, - {file = "phonenumbers-8.13.31.tar.gz", hash = "sha256:2742071c9d0af09274c8a5b2a26d9a36acbf2ea5cb62943cc2ceadb5c0c87641"}, + {file = "phonenumbers-8.13.32-py2.py3-none-any.whl", hash = "sha256:ff8cd0a786fad230d454f35998984c21e501723e22df3fa61e65dbeef0919ced"}, + {file = "phonenumbers-8.13.32.tar.gz", hash = "sha256:947a7e645ee6b77dfdd47d47e2ab5a240f46556bf26d101424cc0bb76c1ca200"}, ] [[package]] @@ -5167,7 +5167,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -5847,13 +5846,13 @@ files = [ [[package]] name = "sacrebleu" -version = "2.4.0" +version = "2.4.1" description = "Hassle-free computation of shareable, comparable, and reproducible BLEU, chrF, and TER scores" optional = true python-versions = ">=3.6" files = [ - {file = "sacrebleu-2.4.0-py3-none-any.whl", hash = "sha256:fc7c34464a56d691bf5e37c4b5292142d2273b02516ac61e264cd19035fff981"}, - {file = "sacrebleu-2.4.0.tar.gz", hash = "sha256:d9e918147dc0777b2e159bff3246b8eb22d76f3b4ee3e6c6cbda05dc25dbb9c0"}, + {file = "sacrebleu-2.4.1-py3-none-any.whl", hash = "sha256:d24a783598ea5cfa2bb461cd377a5e3f76fa38a7df170bf99069fbd4c8157d25"}, + {file = "sacrebleu-2.4.1.tar.gz", hash = "sha256:294f5cb46c18a1ee6d066899b7cb6ad9393eaf824d362baded5551930e95bd4e"}, ] [package.dependencies] @@ -5865,6 +5864,7 @@ regex = "*" tabulate = ">=0.8.9" [package.extras] +dev = ["lxml-stubs", "mypy", "pytest", "types-tabulate", "wheel"] ja = ["ipadic (>=1.0,<2.0)", "mecab-python3 (>=1.0.5,<=1.0.6)"] ko = ["mecab-ko (>=1.0.0,<=1.0.1)", "mecab-ko-dic (>=1.0,<2.0)"] @@ -6172,18 +6172,18 @@ files = [ [[package]] name = "setuptools" -version = "69.1.1" +version = "69.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-69.1.1-py3-none-any.whl", hash = "sha256:02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56"}, - {file = "setuptools-69.1.1.tar.gz", hash = "sha256:5c0806c7d9af348e6dd3777b4f4dbb42c7ad85b190104837488eab9a7c945cf8"}, + {file = "setuptools-69.2.0-py3-none-any.whl", hash = "sha256:c21c49fb1042386df081cb5d86759792ab89efca84cf114889191cd09aacc80c"}, + {file = "setuptools-69.2.0.tar.gz", hash = "sha256:0ff4183f8f42cd8fa3acea16c45205521a4ef28f73c6391d8a25e92893134f2e"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] @@ -7557,13 +7557,13 @@ files = [ [[package]] name = "unbabel-comet" -version = "2.2.1" +version = "2.2.2" description = "High-quality Machine Translation Evaluation" optional = true python-versions = ">=3.8.0,<4.0.0" files = [ - {file = "unbabel_comet-2.2.1-py3-none-any.whl", hash = "sha256:b453c9eff45d1f73901e4feb468ee0d44f2c4cd3030349eb412a73eeb9447679"}, - {file = "unbabel_comet-2.2.1.tar.gz", hash = "sha256:7bd8fb6de84d044d42e5847654db60a3810d6ab09a8b8edf65dfb08461f178e2"}, + {file = "unbabel_comet-2.2.2-py3-none-any.whl", hash = "sha256:55bc93b496bb3e1d7163470e63eb9a1fbcfade66f2e4fdecfeeb1b5473b284ea"}, + {file = "unbabel_comet-2.2.2.tar.gz", hash = "sha256:6b78d463ffe7afd5b6b50e1d56fbcb125e6df4f2bbc0772a396a7ff899af931d"}, ] [package.dependencies] @@ -8100,18 +8100,18 @@ multidict = ">=4.0" [[package]] name = "zipp" -version = "3.17.0" +version = "3.18.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, - {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, + {file = "zipp-3.18.0-py3-none-any.whl", hash = "sha256:c1bb803ed69d2cce2373152797064f7e79bc43f0a3748eb494096a867e0ebf79"}, + {file = "zipp-3.18.0.tar.gz", hash = "sha256:df8d042b02765029a09b157efd8e820451045890acc30f8e37dd2f94a060221f"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [extras] anthropic = ["anthropic"] @@ -8130,4 +8130,4 @@ vectordb = ["faiss-cpu", "numpy"] [metadata] lock-version = "2.0" python-versions = "^3.8.1" -content-hash = "4396fde3c53a875ec912127122048d38243701998e454e32423e9911efc7a38c" +content-hash = "de002dca743ab9491d9905d49749d00ee9b30051f4c7e9acaf3903d7a4924ff3" diff --git a/pyproject.toml b/pyproject.toml index 91281ee89..efd1e8e78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ opentelemetry-exporter-otlp-proto-http = "1.20.0" langchain-core = "^0.1.18" coloredlogs = "^15.0.1" requests = "^2.31.0" -guard-rails-api-client = {git = "https://github.com/guardrails-ai/guardrails-api-client.git", rev = "v0.0.2", subdirectory = "guard-rails-api-client"} +guardrails-api-client = {git = "https://github.com/guardrails-ai/guardrails-api-client.git", rev = "v0.1.0", subdirectory = "guardrails-api-client"} [tool.poetry.extras]