call_template
File: core/src/utcp/data/call_template.py
class CallTemplate
Documentation
Base class for all UTCP tool providers.
This is the abstract base class that all specific call template implementations inherit from. It provides the common fields that every provider must have.
Attributes
name
: Unique identifier for the provider. Defaults to a random UUID hex string. Should be unique across all providers and recommended to be set to a human-readable name. Can only contain letters, numbers and underscores. All special characters must be replaced with underscores.call_template_type
: The transport protocol type used by this provider.
Fields:
- name: str
- call_template_type: str
- auth: Optional[Auth]
class CallTemplateSerializer (Serializer[CallTemplate])
Documentation
Serializer for call templates.
Defines the contract for serializers that convert call templates to and from
Dictionaries For Storage Or Transmission. Serializers Are Responsible For
- Converting call templates to dictionaries for storage or transmission
- Converting dictionaries back to call templates
- Ensuring data consistency during serialization and deserialization
Fields:
- call_template_serializers: dict[str, Serializer[CallTemplate]]
Methods:
to_dict(self, obj: CallTemplate) -> dict
Convert a CallTemplate object to a dictionary.
Args
obj
: The CallTemplate object to convert.
Returns
The dictionary converted from the CallTemplate object.
validate_dict(self, obj: dict) -> CallTemplate
Validate a dictionary and convert it to a CallTemplate object.
Args
obj
: The dictionary to validate and convert.
Returns
The CallTemplate object converted from the dictionary.