Currently Skills are not automatically informed about the constraints imposed by Pydantic validator annotations in their signature. For example, guardrails.py includes two validators:
@Skill.define
def is_safe_query(user_query: str) -> bool:
"""
Determine whether the user's query is purely related to travel advice: {user_query}
"""
def is_concise_answer(answer: str) -> bool:
"""Determine whether the answer is concise (<100 words)."""
return len(answer.split()) < 100
@Skill.define
def travel_query(
user_query: typing.Annotated[str, annotated_types.Predicate(is_safe_query)],
) -> typing.Annotated[str, annotated_types.Predicate(is_concise_answer)]:
"""
Produce a concise (<100 word) answer to: {user_query}
"""
These two happen to already be visible through lexical scope, but we might want to introspect the Predicate annotations on travel_query and inject their docstrings into the system prompt so that information doesn't have to be manually duplicated in the travel_query template.
Currently
Skills are not automatically informed about the constraints imposed by Pydantic validator annotations in their signature. For example,guardrails.pyincludes two validators:These two happen to already be visible through lexical scope, but we might want to introspect the
Predicateannotations ontravel_queryand inject their docstrings into the system prompt so that information doesn't have to be manually duplicated in thetravel_querytemplate.