Skip to content

Commit e77f275

Browse files
committed
test(ChatAdapter): Added descriptive comments
1 parent 04da84d commit e77f275

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
@@ -99,6 +99,10 @@ async def test_chat_adapter_async_call():
9999

100100

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

145149

146150
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+
147155
class TestSignature(dspy.Signature):
148156
input1: str = dspy.InputField(desc="String Input")
149157
input2: int = dspy.InputField(desc="Integer Input")
@@ -180,6 +188,9 @@ class TestSignature(dspy.Signature):
180188

181189

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

0 commit comments

Comments
 (0)