Skip to content
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

Validation Outcome #431

Merged

Conversation

CalebCourier
Copy link
Collaborator

Includes:

  • ValidationOutcome class for all guard responses (call and parse)
  • Error handling

This PR contains a breaking change that consolidates all returnables from call and parse into a single class ValidationOutcome. It also adds a property onto this class for easy determination of whether validation succeeded or failed.

Addresses: #283

zsimjee and others added 5 commits November 3, 2023 12:26
* install deps + pkg for nb runs

* lock nb runner to 3.11.x

* use cohere api key from environ

* ref env vars for cohere + openai
* fix bad merge in code originally from validators.py

* lint fixes
* use pypi pass from env

* upgrade pip before installing deps

* pass pypi pass explicitly

* use environ competently
Copy link

vercel bot commented Nov 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
guardrails ⬜️ Ignored (Inspect) Visit Preview Nov 3, 2023 7:54pm

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@d8dfb2a). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #431   +/-   ##
=======================================
  Coverage        ?   81.33%           
=======================================
  Files           ?       49           
  Lines           ?     4537           
  Branches        ?        0           
=======================================
  Hits            ?     3690           
  Misses          ?      847           
  Partials        ?        0           
Flag Coverage Δ
unittests 81.33% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CalebCourier CalebCourier requested a review from a team November 6, 2023 14:33
@CalebCourier
Copy link
Collaborator Author

We'll need to update any wrappers we publish as well once we release this i.e. Langchain and I think Llama index?

@CalebCourier CalebCourier changed the base branch from main to 0.3.0 November 28, 2023 18:28
@CalebCourier CalebCourier merged commit 6e7a959 into guardrails-ai:0.3.0 Nov 28, 2023
36 of 37 checks passed
CalebCourier added a commit that referenced this pull request Nov 28, 2023
* start validation outcome changes

* fix gather_reasks for non-structured output

* lint fixes

* more lint fixes

* start test fixes, debug types

* fix tests

* fix types with overloads

* fix tests

* lint fixes

* lint fixes

* fix tests

* lint fixes

* switch to generics for ValidationOutcome

* allow destructuring

* remove None from generic type

* init commit, changes to handle error in guard

* handle error a layer deeper

* update return in text2sql

* remove extra fx in validation outcome

* use error instead of exception

* remove print statements plus lint

* fix type

* fix typing while maintaining type hinting

* fix other type issues

* autoformat

* lint fixes

* test fixes

* autoformat

* type fixes

* lint fix

* unused import

* uncomment test parameters

* merge/type fixes

* guard: Allow calling parse with preconfigured num_reasks (#423)

* Cron nb (#425)

* install deps + pkg for nb runs

* lock nb runner to 3.11.x

* use cohere api key from environ

* ref env vars for cohere + openai

* fix bad merge in code originally from validators.py (#427)

* fix bad merge in code originally from validators.py

* lint fixes

* bump version (#428)

* update notebooks

* Setup passed password (#429)

* use pypi pass from env

* upgrade pip before installing deps

* pass pypi pass explicitly

* use environ competently

* list -> List

* lint and test fixes

* autoformat

* lint and type fix

* fix test

* fix llm_output type

* ' -> "

* fix tests

* lint fixes

* fix notebooks again

* fix docs

* debug

* validated_response -> validated_output

---------

Co-authored-by: Nefertiti  Rogers <[email protected]>
Co-authored-by: Nefertiti  Rogers <[email protected]>
Co-authored-by: rafael <[email protected]>
Co-authored-by: zsimjee <[email protected]>
CalebCourier added a commit that referenced this pull request Dec 7, 2023
* start validation outcome changes

* fix gather_reasks for non-structured output

* lint fixes

* more lint fixes

* start test fixes, debug types

* fix tests

* fix types with overloads

* fix tests

* lint fixes

* lint fixes

* fix tests

* lint fixes

* switch to generics for ValidationOutcome

* allow destructuring

* remove None from generic type

* init commit, changes to handle error in guard

* handle error a layer deeper

* update return in text2sql

* remove extra fx in validation outcome

* use error instead of exception

* remove print statements plus lint

* fix type

* fix typing while maintaining type hinting

* fix other type issues

* autoformat

* lint fixes

* test fixes

* autoformat

* type fixes

* lint fix

* unused import

* uncomment test parameters

* merge/type fixes

* guard: Allow calling parse with preconfigured num_reasks (#423)

* Cron nb (#425)

* install deps + pkg for nb runs

* lock nb runner to 3.11.x

* use cohere api key from environ

* ref env vars for cohere + openai

* fix bad merge in code originally from validators.py (#427)

* fix bad merge in code originally from validators.py

* lint fixes

* bump version (#428)

* update notebooks

* Setup passed password (#429)

* use pypi pass from env

* upgrade pip before installing deps

* pass pypi pass explicitly

* use environ competently

* list -> List

* lint and test fixes

* autoformat

* lint and type fix

* fix test

* fix llm_output type

* ' -> "

* fix tests

* lint fixes

* fix notebooks again

* fix docs

* debug

* validated_response -> validated_output

---------

Co-authored-by: Nefertiti  Rogers <[email protected]>
Co-authored-by: Nefertiti  Rogers <[email protected]>
Co-authored-by: rafael <[email protected]>
Co-authored-by: zsimjee <[email protected]>

impl and refactor

autoformat and lint fixes

lint fixes

fix reask merging, harmonize Call and ValidationOutcome

mark test as TODO

force clean merge

Validation Outcome (#431)

* start validation outcome changes

* fix gather_reasks for non-structured output

* lint fixes

* more lint fixes

* start test fixes, debug types

* fix tests

* fix types with overloads

* fix tests

* lint fixes

* lint fixes

* fix tests

* lint fixes

* switch to generics for ValidationOutcome

* allow destructuring

* remove None from generic type

* init commit, changes to handle error in guard

* handle error a layer deeper

* update return in text2sql

* remove extra fx in validation outcome

* use error instead of exception

* remove print statements plus lint

* fix type

* fix typing while maintaining type hinting

* fix other type issues

* autoformat

* lint fixes

* test fixes

* autoformat

* type fixes

* lint fix

* unused import

* uncomment test parameters

* merge/type fixes

* guard: Allow calling parse with preconfigured num_reasks (#423)

* Cron nb (#425)

* install deps + pkg for nb runs

* lock nb runner to 3.11.x

* use cohere api key from environ

* ref env vars for cohere + openai

* fix bad merge in code originally from validators.py (#427)

* fix bad merge in code originally from validators.py

* lint fixes

* bump version (#428)

* update notebooks

* Setup passed password (#429)

* use pypi pass from env

* upgrade pip before installing deps

* pass pypi pass explicitly

* use environ competently

* list -> List

* lint and test fixes

* autoformat

* lint and type fix

* fix test

* fix llm_output type

* ' -> "

* fix tests

* lint fixes

* fix notebooks again

* fix docs

* debug

* validated_response -> validated_output

---------

Co-authored-by: Nefertiti  Rogers <[email protected]>
Co-authored-by: Nefertiti  Rogers <[email protected]>
Co-authored-by: rafael <[email protected]>
Co-authored-by: zsimjee <[email protected]>

many test fixes, many more to come
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants