tools_schema_adapter
Type adapter for ToolsSchema serialization.
- class pipecat.bus.adapters.tools_schema_adapter.ToolsSchemaAdapter[source]
Bases:
TypeAdapterSerialize and deserialize
ToolsSchemainstances for network transport.- serialize(obj: Any, serialize_value: Callable[[Any], Any]) dict[str, Any][source]
Serialize a
ToolsSchemato a JSON-compatible dict.- Parameters:
obj – A
ToolsSchemainstance.serialize_value – Callback to recursively serialize nested values.
- Returns:
A dict with a
standard_toolslist.
- deserialize(data: dict[str, Any], deserialize_value: Callable[[Any], Any], target_type: type | None = None) Any[source]
Reconstruct a
ToolsSchemafrom a serialized dict.- Parameters:
data – A dict produced by
serialize().deserialize_value – Callback to recursively deserialize nested values.
target_type – Unused.
ToolsSchemais always the target.
- Returns:
A new
ToolsSchemainstance.