File tree 1 file changed +11
-0
lines changed 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ async def test_chat_adapter_async_call():
99
99
100
100
101
101
def test_chat_adapter_with_pydantic_models ():
102
+ """
103
+ This test verifies that ChatAdapter can handle different input and output field types, both basic and nested.
104
+ """
105
+
102
106
class DogClass (pydantic .BaseModel ):
103
107
dog_breeds : list [str ] = pydantic .Field (description = "List of the breeds of dogs" )
104
108
num_dogs : int = pydantic .Field (description = "Number of dogs the owner has" , ge = 0 , le = 10 )
@@ -144,6 +148,10 @@ class TestSignature(dspy.Signature):
144
148
145
149
146
150
def test_chat_adapter_signature_information ():
151
+ """
152
+ This test ensures that the signature information sent to the LM follows an expected format.
153
+ """
154
+
147
155
class TestSignature (dspy .Signature ):
148
156
input1 : str = dspy .InputField (desc = "String Input" )
149
157
input2 : int = dspy .InputField (desc = "Integer Input" )
@@ -180,6 +188,9 @@ class TestSignature(dspy.Signature):
180
188
181
189
182
190
def test_chat_adapter_exception_raised_on_failure ():
191
+ """
192
+ This test ensures that on an error, ChatAdapter raises an explicit exception.
193
+ """
183
194
signature = dspy .make_signature ("question->answer" )
184
195
adapter = dspy .ChatAdapter ()
185
196
invalid_completion = "{'output':'mismatched value'}"
You can’t perform that action at this time.
0 commit comments