Skip to content

Commit 4e02725

Browse files
authored
Merge pull request #1324 from guardrails-ai/v0.6.8-release
v0.6.8 Release
2 parents d21091c + aff09c9 commit 4e02725

File tree

11 files changed

+94
-84
lines changed

11 files changed

+94
-84
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
python-version: ["3.9", "3.10", "3.11", "3.12"]
23+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949
strategy:
5050
matrix:
51-
python-version: ["3.9", "3.10", "3.11", "3.12"]
51+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
5252
steps:
5353
- uses: actions/checkout@v4
5454
- name: Set up Python ${{ matrix.python-version }}
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: ubuntu-latest
7676
strategy:
7777
matrix:
78-
python-version: ["3.9", "3.10", "3.11", "3.12"]
78+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
7979
steps:
8080
- uses: actions/checkout@v4
8181
- name: Set up Python ${{ matrix.python-version }}
@@ -102,7 +102,7 @@ jobs:
102102
runs-on: LargeBois
103103
strategy:
104104
matrix:
105-
python-version: ["3.9", "3.10", "3.11", "3.12"]
105+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
106106
# TODO: fix errors so that we can run both `make dev` and `make full`
107107
# dependencies: ['dev', 'full']
108108
# dependencies: ["full"]

.github/workflows/cli-compatibility.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ name: CLI Compatibility Tests
33
on:
44
push:
55
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
6+
workflow_dispatch:
87

98
jobs:
109
CLI-Compatibility:
1110
runs-on: ubuntu-latest
1211
strategy:
1312
matrix:
14-
python-version: ["3.9", "3.10", "3.11", "3.12"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1514
typer-version: ["0.16.0", "0.17.0", "0.18.0", "0.19.2"]
1615
click-version: ["8.1.0", "8.2.0"]
1716
exclude:

.github/workflows/examples_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Python
3737
uses: actions/setup-python@v5
3838
with:
39-
python-version: 3.11.x
39+
python-version: 3.13.x
4040
- name: Install dependencies
4141
run: |
4242

.github/workflows/install_from_hub.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Python
1616
uses: actions/setup-python@v5
1717
with:
18-
python-version: 3.11.x
18+
python-version: 3.13.x
1919
- name: pip install from main
2020
run: pip install git+https://github.com/guardrails-ai/guardrails.git@main
2121
- name: Install PII validator

.github/workflows/release_version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
uses: actions/checkout@v2
1313

1414
- name: Setup Python
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v5
1616
with:
17-
python-version: 3.11.x
17+
python-version: 3.13.x
1818

1919
- name: Poetry cache
2020
uses: actions/cache@v3

guardrails/async_guard.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,14 @@ async def _exec(
325325
Returns:
326326
The raw text output from the LLM and the validated output.
327327
"""
328-
api = get_async_llm_ask(llm_api, *args, **kwargs) # type: ignore
328+
api = None
329+
330+
if llm_api is not None or kwargs.get("model") is not None:
331+
api = get_async_llm_ask(llm_api, *args, **kwargs) # type: ignore
332+
333+
if self._output_formatter is not None:
334+
api = self._output_formatter.wrap_async_callable(api) # type: ignore
335+
329336
if kwargs.get("stream", False):
330337
runner = AsyncStreamRunner(
331338
output_type=self._output_type,

guardrails/formatters/base_formatter.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from guardrails.llm_providers import (
44
ArbitraryCallable,
5+
AsyncPromptCallableBase,
56
PromptCallableBase,
67
)
78

@@ -17,7 +18,15 @@ class BaseFormatter(ABC):
1718
@abstractmethod
1819
def wrap_callable(self, llm_callable: PromptCallableBase) -> ArbitraryCallable: ...
1920

21+
@abstractmethod
22+
def wrap_async_callable(
23+
self, llm_callable: PromptCallableBase
24+
) -> AsyncPromptCallableBase: ...
25+
2026

2127
class PassthroughFormatter(BaseFormatter):
22-
def wrap_callable(self, llm_callable: PromptCallableBase):
28+
def wrap_callable(self, llm_callable: PromptCallableBase): # type: ignore
29+
return llm_callable # Noop
30+
31+
def wrap_async_callable(self, llm_callable: PromptCallableBase): # type: ignore
2332
return llm_callable # Noop

guardrails/formatters/json_formatter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,6 @@ def fn(
149149
raise ValueError(
150150
"JsonFormatter can only be used with HuggingFace*Callable."
151151
)
152+
153+
def wrap_async_callable(self, llm_callable):
154+
raise NotImplementedError()

poetry.lock

Lines changed: 60 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "guardrails-ai"
3-
version = "0.6.7"
3+
version = "0.6.8"
44
description = "Adding guardrails to large language models."
55
authors = [
66
{name = "Guardrails AI", email = "[email protected]"}
@@ -20,7 +20,7 @@ dependencies = [
2020
"rich>=13.6.0,<15.0.0",
2121
"pydantic>=2.0.0, <3.0",
2222
"typer>=0.9.0,<0.20",
23-
"click>=8.1.0,<=8.2.0",
23+
"click<=8.2.0",
2424
"tenacity>=8.1.0,<10.0.0",
2525
"rstr>=3.2.2,<4.0.0",
2626
"typing-extensions>=4.8.0,<5.0.0",

0 commit comments

Comments
 (0)