Skip to content

Commit 85c07d2

Browse files
committed
test(ChatAdapter): Added descriptive comments
1 parent ef6eaa7 commit 85c07d2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/adapters/test_chat_adapter.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ async def test_chat_adapter_async_call():
9898

9999

100100
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+
101105
class DogClass(pydantic.BaseModel):
102106
dog_breeds: list[str] = pydantic.Field(description="List of the breeds of dogs")
103107
num_dogs: int = pydantic.Field(description="Number of dogs the owner has", ge=0, le=10)
@@ -143,6 +147,10 @@ class TestSignature(dspy.Signature):
143147

144148

145149
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+
146154
class TestSignature(dspy.Signature):
147155
input1: str = dspy.InputField(desc="String Input")
148156
input2: int = dspy.InputField(desc="Integer Input")
@@ -179,6 +187,9 @@ class TestSignature(dspy.Signature):
179187

180188

181189
def test_chat_adapter_exception_raised_on_failure():
190+
"""
191+
This test ensures that on an error, ChatAdapter raises an explicit exception.
192+
"""
182193
signature = dspy.make_signature("question->answer")
183194
adapter = dspy.ChatAdapter()
184195
invalid_completion = "{'output':'mismatched value'}"

0 commit comments

Comments
 (0)