Skip to content

Commit 927754c

Browse files
committed
add test for RAGChunks
Signed-off-by: Anxhela Coba <acoba@redhat.com>
1 parent 2d798ec commit 927754c

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ dependencies = [
6565
"peft>=0.15.2",
6666
"trl>=0.18.2",
6767
"sentence-transformers>=5.1.0",
68+
"greenlet>=3.2.4",
6869
]
6970

7071

src/utils/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from llama_stack_client.types.shared.completion_message import CompletionMessage
88
from llama_stack_client.types.shared.tool_call import ToolCall
99
from llama_stack_client.types.tool_execution_step import ToolExecutionStep
10-
from pydantic.main import BaseModel, Field
10+
from pydantic import BaseModel, Field
1111

1212

1313
class Singleton(type):

tests/unit/app/endpoints/test_streaming_query.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from models.requests import QueryRequest, Attachment
4646
from models.config import ModelContextProtocolServer, Action
4747
from authorization.resolvers import NoopRolesResolver
48-
from utils.types import ToolCallSummary, TurnSummary
48+
from utils.types import ToolCallSummary, TurnSummary, RAGChunkData
4949

5050
MOCK_AUTH = ("mock_user_id", "mock_username", False, "mock_token")
5151

@@ -343,6 +343,13 @@ async def _test_streaming_query_endpoint_handler(mocker, store_transcript=False)
343343
response=" ".join(SAMPLE_KNOWLEDGE_SEARCH_RESULTS),
344344
)
345345
],
346+
rag_chunks=[
347+
RAGChunkData(
348+
content=" ".join(SAMPLE_KNOWLEDGE_SEARCH_RESULTS),
349+
source="knowledge_search",
350+
score=None,
351+
)
352+
],
346353
),
347354
attachments=[],
348355
rag_chunks=[],

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)