File tree Expand file tree Collapse file tree 2 files changed +21
-15
lines changed
Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Original file line number Diff line number Diff 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__ (
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments