Skip to content

Commit b82956d

Browse files
Neehar DuvvuriNeehar Duvvuri
authored andcommitted
fix prompty tests
1 parent de8a43d commit b82956d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

sdk/evaluation/azure-ai-evaluation/tests/e2etests/test_prompty_async.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ async def test_first_match_image(self, prompty_config: Dict[str, Any]):
104104
result = await prompty(image="image1.jpg", question="What is this a picture of?")
105105
assert isinstance(result, dict)
106106
llm_output = result["llm_output"]
107-
assert isinstance(llm_output, AsyncGenerator)
108-
combined = ""
109-
async for chunk in llm_output:
110-
assert isinstance(chunk, str)
111-
combined += chunk
112-
assert "apple" in combined
107+
assert isinstance(llm_output, str)
108+
assert "apple" in llm_output.lower()
113109

114110
@pytest.mark.asyncio
115111
async def test_first_match_text_streaming(self, prompty_config: Dict[str, Any]):
@@ -196,7 +192,7 @@ async def test_first_match_text_json_streaming(self, prompty_config: Dict[str, A
196192
async def test_full_text(self, prompty_config: Dict[str, Any]):
197193
prompty_config["model"]["response"] = "full"
198194
prompty = AsyncPrompty(BASIC_PROMPTY, **prompty_config)
199-
result = await prompty(question="What is the capital of France?", firstName="Barbra", lastName="Streisand")
195+
result = await prompty(firstName="Bob", question="What is the capital of France?")
200196
assert isinstance(result, dict)
201197
llm_output = result["llm_output"]
202198
assert isinstance(llm_output, ChatCompletion)

0 commit comments

Comments
 (0)