2424
2525class ResponseBuilders :
2626 """Builders for creating model responses for testing.
27-
27+
2828 .. warning::
2929 This API is experimental and may change in the future."""
3030
3131 @staticmethod
3232 def model_response (output : TResponseOutputItem ) -> ModelResponse :
3333 """Create a ModelResponse with the given output.
34-
34+
3535 .. warning::
3636 This API is experimental and may change in the future."""
3737 return ModelResponse (
@@ -43,7 +43,7 @@ def model_response(output: TResponseOutputItem) -> ModelResponse:
4343 @staticmethod
4444 def response_output_message (text : str ) -> ResponseOutputMessage :
4545 """Create a ResponseOutputMessage with text content.
46-
46+
4747 .. warning::
4848 This API is experimental and may change in the future."""
4949 return ResponseOutputMessage (
@@ -63,7 +63,7 @@ def response_output_message(text: str) -> ResponseOutputMessage:
6363 @staticmethod
6464 def tool_call (arguments : str , name : str ) -> ModelResponse :
6565 """Create a ModelResponse with a function tool call.
66-
66+
6767 .. warning::
6868 This API is experimental and may change in the future."""
6969 return ResponseBuilders .model_response (
@@ -80,7 +80,7 @@ def tool_call(arguments: str, name: str) -> ModelResponse:
8080 @staticmethod
8181 def output_message (text : str ) -> ModelResponse :
8282 """Create a ModelResponse with an output message.
83-
83+
8484 .. warning::
8585 This API is experimental and may change in the future."""
8686 return ResponseBuilders .model_response (
@@ -90,38 +90,38 @@ def output_message(text: str) -> ModelResponse:
9090
9191class TestModelProvider (ModelProvider ):
9292 """Test model provider which simply returns the given module.
93-
93+
9494 .. warning::
9595 This API is experimental and may change in the future."""
9696
9797 __test__ = False
9898
9999 def __init__ (self , model : Model ):
100100 """Initialize a test model provider with a model.
101-
101+
102102 .. warning::
103103 This API is experimental and may change in the future."""
104104 self ._model = model
105105
106106 def get_model (self , model_name : Union [str , None ]) -> Model :
107107 """Get a model from the model provider.
108-
108+
109109 .. warning::
110110 This API is experimental and may change in the future."""
111111 return self ._model
112112
113113
114114class TestModel (Model ):
115115 """Test model for use mocking model responses.
116-
116+
117117 .. warning::
118118 This API is experimental and may change in the future."""
119119
120120 __test__ = False
121121
122122 def __init__ (self , fn : Callable [[], ModelResponse ]) -> None :
123123 """Initialize a test model with a callable.
124-
124+
125125 .. warning::
126126 This API is experimental and may change in the future."""
127127 self .fn = fn
@@ -157,7 +157,7 @@ def stream_response(
157157 @staticmethod
158158 def returning_responses (responses : list [ModelResponse ]) -> "TestModel" :
159159 """Create a mock model which sequentially returns responses from a list.
160-
160+
161161 .. warning::
162162 This API is experimental and may change in the future."""
163163 i = iter (responses )
0 commit comments