forked from phoenix-oss/llama-stack-mirror
fix: enable test_responses_store (#2290)
# What does this PR do? Changed the test to not require tool_call in output, but still keeping the tools params there as a smoke test. ## Test Plan Used llama3.3 from fireworks (same as CI) <img width="1433" alt="image" src="https://github.com/user-attachments/assets/1e5fca98-9b4f-402e-a0bc-d9f910f2c207" /> Run with ollama distro and 3b model.
This commit is contained in:
parent
4f3f28f718
commit
1d46f3102e
1 changed files with 8 additions and 8 deletions
|
@ -41,7 +41,6 @@ def openai_client(client_with_models):
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@pytest.mark.skip(reason="Very flaky, sometimes there is a message not a function call, standard tool calling issues")
|
|
||||||
def test_responses_store(openai_client, client_with_models, text_model_id, stream, tools):
|
def test_responses_store(openai_client, client_with_models, text_model_id, stream, tools):
|
||||||
if isinstance(client_with_models, LlamaStackAsLibraryClient):
|
if isinstance(client_with_models, LlamaStackAsLibraryClient):
|
||||||
pytest.skip("OpenAI responses are not supported when testing with library client yet.")
|
pytest.skip("OpenAI responses are not supported when testing with library client yet.")
|
||||||
|
@ -68,13 +67,15 @@ def test_responses_store(openai_client, client_with_models, text_model_id, strea
|
||||||
for chunk in response:
|
for chunk in response:
|
||||||
if response_id is None:
|
if response_id is None:
|
||||||
response_id = chunk.response.id
|
response_id = chunk.response.id
|
||||||
if not tools:
|
if chunk.type == "response.completed":
|
||||||
if chunk.type == "response.completed":
|
response_id = chunk.response.id
|
||||||
response_id = chunk.response.id
|
output_type = chunk.response.output[0].type
|
||||||
|
if output_type == "message":
|
||||||
content = chunk.response.output[0].content[0].text
|
content = chunk.response.output[0].content[0].text
|
||||||
else:
|
else:
|
||||||
response_id = response.id
|
response_id = response.id
|
||||||
if not tools:
|
output_type = response.output[0].type
|
||||||
|
if output_type == "message":
|
||||||
content = response.output[0].content[0].text
|
content = response.output[0].content[0].text
|
||||||
|
|
||||||
# list responses - use the underlying HTTP client for endpoints not in SDK
|
# list responses - use the underlying HTTP client for endpoints not in SDK
|
||||||
|
@ -87,9 +88,8 @@ def test_responses_store(openai_client, client_with_models, text_model_id, strea
|
||||||
retrieved_response = client.responses.retrieve(response_id)
|
retrieved_response = client.responses.retrieve(response_id)
|
||||||
assert retrieved_response.id == response_id
|
assert retrieved_response.id == response_id
|
||||||
assert retrieved_response.model == text_model_id
|
assert retrieved_response.model == text_model_id
|
||||||
if tools:
|
assert retrieved_response.output[0].type == output_type, retrieved_response
|
||||||
assert retrieved_response.output[0].type == "function_call"
|
if output_type == "message":
|
||||||
else:
|
|
||||||
assert retrieved_response.output[0].content[0].text == content
|
assert retrieved_response.output[0].content[0].text == content
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue