Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/endpoints/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ async def query_endpoint_handler_base( # pylint: disable=R0914
response = QueryResponse(
conversation_id=conversation_id,
response=summary.llm_response,
tool_calls=summary.tool_calls if summary.tool_calls else None,
tool_results=summary.tool_results if summary.tool_results else None,
tool_calls=summary.tool_calls,
tool_results=summary.tool_results,
referenced_documents=referenced_documents,
truncated=False, # TODO: implement truncation detection
input_tokens=token_usage.input_tokens,
Expand Down
1 change: 0 additions & 1 deletion src/app/endpoints/query_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def _build_tool_call_summary( # pylint: disable=too-many-return-statements,too-
Args:
output_item: An OpenAIResponseOutput item from the response.output array
rag_chunks: List to append extracted RAG chunks to (from file_search_call items)

Returns:
A tuple of (ToolCallSummary, ToolResultSummary) one of them possibly None
if current llama stack Responses API does not provide the information.
Expand Down
8 changes: 4 additions & 4 deletions src/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ class QueryResponse(AbstractSuccessfulResponse):
examples=[{"daily": 1000, "monthly": 50000}],
)

tool_calls: Optional[list[ToolCallSummary]] = Field(
None,
tool_calls: list[ToolCallSummary] = Field(
default_factory=list,
description="List of tool calls made during response generation",
)

tool_results: Optional[list[ToolResultSummary]] = Field(
None,
tool_results: list[ToolResultSummary] = Field(
default_factory=list,
description="List of tool results",
)

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/models/responses/test_successful_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def test_constructor_minimal(self) -> None:
assert isinstance(response_obj, AbstractSuccessfulResponse)
assert response_obj.response == "Test response"
assert response_obj.conversation_id is None
assert response_obj.tool_calls is None
assert response_obj.tool_results is None
assert response_obj.tool_calls == []
assert response_obj.tool_results == []
assert response_obj.referenced_documents == []
assert response_obj.truncated is False
assert response_obj.input_tokens == 0
Expand Down
Loading