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