Skip to content

bug: Handle non-string task outputs in guardrails#5238

Open
joelwilliamson wants to merge 3 commits intocrewAIInc:mainfrom
joelwilliamson:patch-1
Open

bug: Handle non-string task outputs in guardrails#5238
joelwilliamson wants to merge 3 commits intocrewAIInc:mainfrom
joelwilliamson:patch-1

Conversation

@joelwilliamson
Copy link
Copy Markdown

When a task has a response_model set, a guardrail failing would cause the task to fail because the result passed to the raw parameter of TaskOutput in _invoke_guardrail_function would be an instance of that model, but TaskOutput requires it to be a string. Convert it to a string before passing.

When a task has a response_model set, a guardrail failing would cause the task to fail because the result passed to the `raw` parameter of TaskOutput in _invoke_guardrail_function would be an instance of that model, but TaskOutput requires it to be a string. Convert it to a string before passing.
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.

1 participant