Prevent infinite recursion when agents delegate to each other as tools
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -25,6 +25,10 @@ type (
|
||||
MaxTurns int
|
||||
}
|
||||
|
||||
MaxToolDepthExceededError struct {
|
||||
MaxDepth int
|
||||
}
|
||||
|
||||
InputGuardrailTrippedError struct {
|
||||
Guardrail string
|
||||
Message string
|
||||
@@ -79,6 +83,10 @@ func (e *MaxTurnsExceededError) Error() string {
|
||||
return fmt.Sprintf("agent exceeded maximum number of turns (%d)", e.MaxTurns)
|
||||
}
|
||||
|
||||
func (e *MaxToolDepthExceededError) Error() string {
|
||||
return fmt.Sprintf("agent-tool delegation exceeded maximum depth (%d)", e.MaxDepth)
|
||||
}
|
||||
|
||||
func (e *InputGuardrailTrippedError) Error() string {
|
||||
return fmt.Sprintf("input guardrail %q tripped: %s", e.Guardrail, e.Message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user