Skip to content

Commit dca66c3

Browse files
docs: Fix Docstring formatting for code samples (#492)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 63a8a18 commit dca66c3

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

src/a2a/client/client_factory.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ class ClientFactory:
4141
The factory is configured with a `ClientConfig` and optionally a list of
4242
`Consumer`s to use for all generated `Client`s. The expected use is:
4343
44-
factory = ClientFactory(config, consumers)
45-
# Optionally register custom client implementations
46-
factory.register('my_customer_transport', NewCustomTransportClient)
47-
# Then with an agent card make a client with additional consumers and
48-
# interceptors
49-
client = factory.create(card, additional_consumers, interceptors)
50-
# Now the client can be used the same regardless of transport and
51-
# aligns client config with server capabilities.
44+
.. code-block:: python
45+
46+
factory = ClientFactory(config, consumers)
47+
# Optionally register custom client implementations
48+
factory.register('my_customer_transport', NewCustomTransportClient)
49+
# Then with an agent card make a client with additional consumers and
50+
# interceptors
51+
client = factory.create(card, additional_consumers, interceptors)
52+
53+
Now the client can be used consistently regardless of the transport. This
54+
aligns the client configuration with the server's capabilities.
5255
"""
5356

5457
def __init__(

src/a2a/server/models.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,18 @@ def create_task_model(
166166
TaskModel class with the specified table name.
167167
168168
Example:
169-
# Create a task model with default table name
170-
TaskModel = create_task_model()
169+
.. code-block:: python
171170
172-
# Create a task model with custom table name
173-
CustomTaskModel = create_task_model('my_tasks')
171+
# Create a task model with default table name
172+
TaskModel = create_task_model()
174173
175-
# Use with a custom base
176-
from myapp.database import Base as MyBase
177-
TaskModel = create_task_model('tasks', MyBase)
174+
# Create a task model with custom table name
175+
CustomTaskModel = create_task_model('my_tasks')
176+
177+
# Use with a custom base
178+
from myapp.database import Base as MyBase
179+
180+
TaskModel = create_task_model('tasks', MyBase)
178181
"""
179182

180183
class TaskModel(TaskMixin, base): # type: ignore

0 commit comments

Comments
 (0)