diff --git a/src/a2a/client/client_factory.py b/src/a2a/client/client_factory.py index c568331f..3e98c9f5 100644 --- a/src/a2a/client/client_factory.py +++ b/src/a2a/client/client_factory.py @@ -41,14 +41,17 @@ class ClientFactory: The factory is configured with a `ClientConfig` and optionally a list of `Consumer`s to use for all generated `Client`s. The expected use is: - factory = ClientFactory(config, consumers) - # Optionally register custom client implementations - factory.register('my_customer_transport', NewCustomTransportClient) - # Then with an agent card make a client with additional consumers and - # interceptors - client = factory.create(card, additional_consumers, interceptors) - # Now the client can be used the same regardless of transport and - # aligns client config with server capabilities. + .. code-block:: python + + factory = ClientFactory(config, consumers) + # Optionally register custom client implementations + factory.register('my_customer_transport', NewCustomTransportClient) + # Then with an agent card make a client with additional consumers and + # interceptors + client = factory.create(card, additional_consumers, interceptors) + + Now the client can be used consistently regardless of the transport. This + aligns the client configuration with the server's capabilities. """ def __init__( diff --git a/src/a2a/server/models.py b/src/a2a/server/models.py index c677fa8c..4b0f7504 100644 --- a/src/a2a/server/models.py +++ b/src/a2a/server/models.py @@ -166,15 +166,18 @@ def create_task_model( TaskModel class with the specified table name. Example: - # Create a task model with default table name - TaskModel = create_task_model() + .. code-block:: python - # Create a task model with custom table name - CustomTaskModel = create_task_model('my_tasks') + # Create a task model with default table name + TaskModel = create_task_model() - # Use with a custom base - from myapp.database import Base as MyBase - TaskModel = create_task_model('tasks', MyBase) + # Create a task model with custom table name + CustomTaskModel = create_task_model('my_tasks') + + # Use with a custom base + from myapp.database import Base as MyBase + + TaskModel = create_task_model('tasks', MyBase) """ class TaskModel(TaskMixin, base): # type: ignore