Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/a2a/client/client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down
17 changes: 10 additions & 7 deletions src/a2a/server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading