mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-29 03:14:19 +00:00
sqlite-vec support for Responses file_search
This wires up the Files API optional dependency into sqlite_vec and adds the localfs Files provider to our starter template, so that Responses API file_search tool works out of the box for sqlite_vec in that template. Some additional testing with this provider plus some other inference models led me to loosen the verification test results checking a bit - not for the tool call, but just around the assistant response with the file_search tool call. Some providers, such as OpenAI SaaS, make multiple tool calls to resolve the query sometimes, especially when it cannot find an answer so tries a few permutations before returning empty results to the user in that test. Signed-off-by: Ben Browning <bbrownin@redhat.com>
This commit is contained in:
parent
ec09524a91
commit
7a71d9ebd8
8 changed files with 30 additions and 24 deletions
|
@ -340,7 +340,7 @@ def test_response_non_streaming_file_search(
|
|||
response = openai_client.responses.create(
|
||||
model=model,
|
||||
input=case["input"],
|
||||
tools=case["tools"],
|
||||
tools=tools,
|
||||
stream=False,
|
||||
include=["file_search_call.results"],
|
||||
)
|
||||
|
@ -354,11 +354,7 @@ def test_response_non_streaming_file_search(
|
|||
assert case["output"].lower() in response.output[0].results[0].text.lower()
|
||||
assert response.output[0].results[0].score > 0
|
||||
|
||||
# Verify the assistant response that summarizes the results
|
||||
assert response.output[1].type == "message"
|
||||
assert response.output[1].status == "completed"
|
||||
assert response.output[1].role == "assistant"
|
||||
assert len(response.output[1].content) > 0
|
||||
# Verify the output_text generated by the response
|
||||
assert case["output"].lower() in response.output_text.lower().strip()
|
||||
|
||||
|
||||
|
@ -390,11 +386,8 @@ def test_response_non_streaming_file_search_empty_vector_store(
|
|||
assert response.output[0].queries # ensure it's some non-empty list
|
||||
assert not response.output[0].results # ensure we don't get any results
|
||||
|
||||
# Verify the assistant response that summarizes the results
|
||||
assert response.output[1].type == "message"
|
||||
assert response.output[1].status == "completed"
|
||||
assert response.output[1].role == "assistant"
|
||||
assert len(response.output[1].content) > 0
|
||||
# Verify some output_text was generated by the response
|
||||
assert response.output_text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue