Skip to content

0.6.0 dev #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 87 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
b0baed1
reapply litellm updates to support only messages llm kwarg
dtam Sep 19, 2024
5e0eb15
tests run and make progress on rewrite, most of unit_tests_passing
dtam Sep 20, 2024
a11c4ee
migrate more tests partially
dtam Sep 24, 2024
487a06a
Merge remote-tracking branch 'origin/main' into feature/litellm_cleanup
dtam Sep 24, 2024
b97caa2
some progress
dtam Sep 24, 2024
e684739
more progress
dtam Sep 24, 2024
18591b7
fix some more tests
dtam Sep 25, 2024
a1f7893
fix some more tests
dtam Sep 25, 2024
816ef5f
Merge remote-tracking branch 'origin/main' into feature/litellm_cleanup
dtam Sep 25, 2024
67feff4
more progress
dtam Sep 25, 2024
da2dc63
more tests
dtam Sep 26, 2024
66a568b
more tests
dtam Sep 26, 2024
bbef78a
removed nltk dependency
AlejandroEsquivel Sep 27, 2024
0298730
remove nltk import and download from validator base
AlejandroEsquivel Sep 27, 2024
e699397
remove commented out test referencing nltk
AlejandroEsquivel Sep 27, 2024
c1f7350
throwing import error if nltk not available in detect_pii mock
AlejandroEsquivel Sep 27, 2024
bc7ff07
tests passing
dtam Sep 27, 2024
e8eb7f5
typing and lint
dtam Sep 27, 2024
f4c4827
lint
dtam Sep 27, 2024
1228310
typing
dtam Sep 27, 2024
1d0490f
Merge remote-tracking branch 'origin/main' into feature/litellm_cleanup
dtam Sep 27, 2024
4e333b9
fix bad merge
dtam Sep 27, 2024
416f290
Added rule based sentence tokenization from WordTokenizers.jl with mi…
AlejandroEsquivel Sep 27, 2024
6743df2
Added new version of split_sentence_str using new rule based sentence…
AlejandroEsquivel Sep 27, 2024
acae737
updates to factor in quotes during sentence splitting
AlejandroEsquivel Sep 27, 2024
815300f
updated poetry.lock
AlejandroEsquivel Sep 27, 2024
1a2546a
replaced split sentence default
AlejandroEsquivel Sep 27, 2024
bd0ab50
testing changes using custom separator in wordtokenizer algo
AlejandroEsquivel Oct 1, 2024
4ebef18
fix for counting subs
AlejandroEsquivel Oct 1, 2024
fb1d2d0
reverted split sentence in validators base
AlejandroEsquivel Oct 1, 2024
3fb5765
reverted to pre-seperator algo, added fix for conditional white space…
AlejandroEsquivel Oct 1, 2024
f453ecc
fix for optional white space after potential line endings ?!.
AlejandroEsquivel Oct 1, 2024
88477c7
Merge branch 'main' into feat/nltk-removal
AlejandroEsquivel Oct 1, 2024
6462558
added back modified seperator algo, fix for split sentence
AlejandroEsquivel Oct 1, 2024
6f8b175
Fix regex patterns for abbreviations in tokenization_utils_seperator.py
AlejandroEsquivel Oct 1, 2024
27a0419
fix tests
AlejandroEsquivel Oct 1, 2024
49aa02d
remove nltk references from tests
AlejandroEsquivel Oct 1, 2024
affb205
removed older scripts
AlejandroEsquivel Oct 1, 2024
0611c7b
minor fixes
dtam Oct 10, 2024
c4b7b4b
Merge remote-tracking branch 'origin/main' into feature/litellm_cleanup
dtam Oct 10, 2024
8c5f9c5
notebooks
dtam Oct 10, 2024
6dfc337
last few notebooks
dtam Oct 10, 2024
955622c
last books
dtam Oct 11, 2024
27248aa
update docs for messages
dtam Oct 12, 2024
d2df838
last of docs
dtam Oct 14, 2024
95e2767
update more docs and start migration guide
dtam Oct 17, 2024
ef2863b
fix tests and format
dtam Oct 17, 2024
10a1dde
Merge remote-tracking branch 'origin/main' into feature/litellm_cleanup
dtam Oct 18, 2024
58d16ec
update some tests
dtam Oct 18, 2024
d3cfed9
bumped api version
AlejandroEsquivel Oct 18, 2024
97f3457
dep updates
zsimjee Oct 18, 2024
5562688
Merge branch '0.6.0-dev' into feat/nltk-removal
zsimjee Oct 19, 2024
e167d83
Merge remote-tracking branch 'origin/main' into feature/litellm_cleanup
dtam Oct 21, 2024
e5ccff3
renable history by default
dtam Oct 21, 2024
e167a6d
expose messages to prompt helper and finish docs for it
dtam Oct 21, 2024
7898e76
indention
dtam Oct 21, 2024
7d7240b
fix test out of main
dtam Oct 21, 2024
8ceb5db
Merge pull request #1102 from guardrails-ai/feat/nltk-removal
dtam Oct 21, 2024
d8c0404
Merge remote-tracking branch 'origin/0.6.0-dev' into feature/litellm_…
dtam Oct 21, 2024
60605fa
update api client to point to its alpha
dtam Oct 21, 2024
730e9eb
Merge pull request #1082 from guardrails-ai/feature/litellm_cleanup
zsimjee Oct 21, 2024
6ae7f75
update validator default on fail behavior from no op to exception
dtam Oct 22, 2024
766d9cc
update notebooks
dtam Oct 22, 2024
af9f898
Merge pull request #1133 from guardrails-ai/default_validator_on_fail…
zsimjee Oct 22, 2024
595ccf5
Installs from private pypi with validator versioning
AlejandroEsquivel Oct 23, 2024
6d31efc
chore: Fix typo in pip_process function
AlejandroEsquivel Oct 23, 2024
3b78114
wip: updating tests
AlejandroEsquivel Oct 23, 2024
0d1367a
fixed tests
AlejandroEsquivel Oct 23, 2024
b8d4d18
fix f-string syntax error
AlejandroEsquivel Oct 23, 2024
5b4d6b8
fixed uninstall, list validators cli cmds, and tests
AlejandroEsquivel Oct 23, 2024
106cc86
removed unused methods from cli hub utils
AlejandroEsquivel Oct 23, 2024
f73adf7
Removed writes to org namespaced init files during install, removed u…
AlejandroEsquivel Oct 23, 2024
c0dfcce
fix tests associated with removal of namespace init file
AlejandroEsquivel Oct 24, 2024
76f6acb
update for litellm dont pass reask messages to llms
dtam Oct 25, 2024
6e8ac73
Merge pull request #1144 from guardrails-ai/dont_pass_gr_args_to_llms
zsimjee Oct 25, 2024
f2a7138
Update pyproject.toml
zsimjee Oct 25, 2024
a82a412
Update guardrails/cli/hub/uninstall.py
AlejandroEsquivel Oct 28, 2024
586cf80
remove regex pypi package dependency
AlejandroEsquivel Oct 29, 2024
cd37159
bumped version to 0.6.0-alpha3
AlejandroEsquivel Oct 29, 2024
280bb81
Merge pull request #1140 from guardrails-ai/feat/validator-versioning
AlejandroEsquivel Oct 29, 2024
d8fd51a
bump version to 0.6.0-alpha4
AlejandroEsquivel Oct 29, 2024
91077a9
temp workaround to raise errors on on pip processes
AlejandroEsquivel Nov 5, 2024
943d0c7
raise errors on install failures to avoid placing import statement
AlejandroEsquivel Nov 5, 2024
de43a01
Merge pull request #1156 from guardrails-ai/0.6.0-dev-validator-extras
AlejandroEsquivel Nov 6, 2024
1d9f7dd
update version to 0.6.0
AlejandroEsquivel Nov 6, 2024
7488f14
Merge branch 'main' into 0.6.0-dev
zsimjee Nov 6, 2024
02f5c21
updated installation tests to reflect change of behavior during excep…
AlejandroEsquivel Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,690 changes: 6,674 additions & 16 deletions docs/concepts/async_streaming.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/concepts/error_remediation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Note that this list is not exhaustive of the possible errors that could occur.
```log
The callable `fn` passed to `Guard(fn, ...)` failed with the following error:
{Root error message here!}.
Make sure that `fn` can be called as a function that takes in a single prompt string and returns a string.
```


Expand Down
20 changes: 4 additions & 16 deletions docs/concepts/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ docs/html/single-step-history.html

## Calls
### Initial Input
Inital inputs like prompt and instructions from a call are available on each call.
Initial inputs like messages from a call are available on each call.

```py
first_call = my_guard.history.first
print("prompt\n-----")
print(first_call.prompt)
print("message\n-----")
print(first_call.messages[0]["content"])
print("prompt params\n------------- ")
print(first_call.prompt_params)
```
```log
prompt
message
-----

You are a human in an enchanted forest. You come across opponents of different types. You should fight smaller opponents, run away from bigger ones, and freeze if the opponent is a bear.
Expand All @@ -67,18 +67,6 @@ prompt params
{'opp_type': 'grizzly'}
```

Note: Input messages and msg_history currently can be accessed through iterations
```py
print(guard.history.last.iterations.last.inputs.msg_history)
```
```log
[
{"role":"system","content":"You are a helpful assistant."},
{"role":"user","content":"Tell me a joke"}
]
```


### Final Output
Final output of call is accessible on a call.
```py
Expand Down
44 changes: 36 additions & 8 deletions docs/concepts/streaming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,12 +51,41 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">ValidationOutcome</span><span style=\"font-weight: bold\">(</span>\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">call_id</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'14148119808'</span>,\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">raw_llm_output</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'.'</span>,\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">validation_summaries</span>=<span style=\"font-weight: bold\">[]</span>,\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">validated_output</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'.'</span>,\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">reask</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>,\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">validation_passed</span>=<span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>,\n",
" <span style=\"color: #808000; text-decoration-color: #808000\">error</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>\n",
"<span style=\"font-weight: bold\">)</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1;35mValidationOutcome\u001b[0m\u001b[1m(\u001b[0m\n",
" \u001b[33mcall_id\u001b[0m=\u001b[32m'14148119808'\u001b[0m,\n",
" \u001b[33mraw_llm_output\u001b[0m=\u001b[32m'.'\u001b[0m,\n",
" \u001b[33mvalidation_summaries\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
" \u001b[33mvalidated_output\u001b[0m=\u001b[32m'.'\u001b[0m,\n",
" \u001b[33mreask\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
" \u001b[33mvalidation_passed\u001b[0m=\u001b[3;92mTrue\u001b[0m,\n",
" \u001b[33merror\u001b[0m=\u001b[3;35mNone\u001b[0m\n",
"\u001b[1m)\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fragment_generator = guard(\n",
" litellm.completion,\n",
" model=\"gpt-4o\",\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
Expand Down Expand Up @@ -116,7 +145,6 @@
"guard = gd.Guard()\n",
"\n",
"fragment_generator = await guard(\n",
" litellm.completion,\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
Expand All @@ -137,7 +165,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "litellm",
"language": "python",
"name": "python3"
},
Expand All @@ -151,7 +179,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
Loading
Loading