Validate Schema Roundtrip • AI Agent SDK

validate_schema_roundtrip: Validate that schema can round-trip through OpenAI-style serialization.

validate_schema_roundtrip

Method

</div>

This is a method of the BaseTool class in the base module.

Validate that schema can round-trip through OpenAI-style serialization.

This ensures the tool schema is compatible with LLM providers that expect OpenAI function calling format and that parameters can be properly parsed.

Signature

python
def validate_schema_roundtrip() -> bool

Returns

ResponseField bool

True if round-trip validation passes

Exceptions

ToolValidationError

If round-trip fails

Uses

  • get_schema
  • json.dumps
  • json.loads
  • ToolValidationError

Used By

Source

View on GitHub

praisonaiagents/tools/base.py at line 415