Skip to content

Conversation

@lucasgomide
Copy link
Contributor

@lucasgomide lucasgomide commented Apr 17, 2025

This PR introduce No-Code Guardrail Support

  • Enables defining guardrail tasks without requiring explicit code
  • Emit events when Guardrail's process has started and competed

Usage

Write down what your guardrail expectation

...
task = Task(
    description="Extract the latest new from BBC",
    expected_output="A JSON object with the latest news",
    guardrail="Ensure the JSON response has more than 10 items",
)
...

If you need more customization such as custom LLM, you can define a GuardrailTask instance

...
task = Task(
    description="Test task",
    expected_output="Output",
    guardrail=GuardrailTask(description="Ensure the JSON response has more than 10 items", llm=llm),
)
...

@lucasgomide lucasgomide marked this pull request as draft April 17, 2025 21:20
@lucasgomide lucasgomide force-pushed the lg-guardrail-llm branch 3 times, most recently from c983ab7 to c6fc53b Compare April 21, 2025 22:34
@lucasgomide lucasgomide changed the title wip guardrail llm Support Guardrail creation using NPL Apr 21, 2025
@lucasgomide lucasgomide marked this pull request as ready for review April 21, 2025 22:35
@lucasgomide lucasgomide force-pushed the lg-guardrail-llm branch 2 times, most recently from de517d0 to 0d619a2 Compare April 21, 2025 23:18
@lucasgomide lucasgomide changed the title Support Guardrail creation using NPL Supporting no-code Guardrail creation Apr 21, 2025
@lucasgomide lucasgomide force-pushed the lg-guardrail-llm branch 2 times, most recently from 163dd78 to 8932fba Compare April 23, 2025 19:59
@lucasgomide lucasgomide force-pushed the lg-guardrail-llm branch 2 times, most recently from 3c7d30b to 0ad5ace Compare April 25, 2025 12:42
@lucasgomide lucasgomide force-pushed the lg-guardrail-llm branch 3 times, most recently from fbfc79c to d917ed9 Compare April 29, 2025 13:30
This parameter was used to get the model from the `task.agent` which is a quite bit redudant since we could propagate the llm directly
@lucasgomide
Copy link
Contributor Author

@gvieira suggestions applied, could you review it again?

@lucasgomide lucasgomide merged commit 015e1a4 into main Apr 30, 2025
9 checks passed
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.

5 participants