Skip to content

Commit 3899c70

Browse files
committed
fix test failure
Signed-off-by: Stephanie <yangcao@redhat.com>
1 parent ba3e2a6 commit 3899c70

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

src/cache/postgres_cache.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ def insert_or_append(
363363
tool_calls_json = json.dumps(tool_calls_as_dicts)
364364
except (TypeError, ValueError) as e:
365365
logger.warning(
366-
"Failed to serialize tool_calls for "
367-
"conversation %s: %s",
366+
"Failed to serialize tool_calls for conversation %s: %s",
368367
conversation_id,
369368
e,
370369
)
@@ -378,8 +377,7 @@ def insert_or_append(
378377
tool_results_json = json.dumps(tool_results_as_dicts)
379378
except (TypeError, ValueError) as e:
380379
logger.warning(
381-
"Failed to serialize tool_results for "
382-
"conversation %s: %s",
380+
"Failed to serialize tool_results for conversation %s: %s",
383381
conversation_id,
384382
e,
385383
)

src/cache/sqlite_cache.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ def get( # pylint: disable=R0914
247247
]
248248
except (json.JSONDecodeError, ValueError) as e:
249249
logger.warning(
250-
"Failed to deserialize tool_calls for "
251-
"conversation %s: %s",
250+
"Failed to deserialize tool_calls for conversation %s: %s",
252251
conversation_id,
253252
e,
254253
)
@@ -264,8 +263,7 @@ def get( # pylint: disable=R0914
264263
]
265264
except (json.JSONDecodeError, ValueError) as e:
266265
logger.warning(
267-
"Failed to deserialize tool_results for "
268-
"conversation %s: %s",
266+
"Failed to deserialize tool_results for conversation %s: %s",
269267
conversation_id,
270268
e,
271269
)
@@ -334,8 +332,7 @@ def insert_or_append(
334332
tool_calls_json = json.dumps(tool_calls_as_dicts)
335333
except (TypeError, ValueError) as e:
336334
logger.warning(
337-
"Failed to serialize tool_calls for "
338-
"conversation %s: %s",
335+
"Failed to serialize tool_calls for conversation %s: %s",
339336
conversation_id,
340337
e,
341338
)
@@ -349,8 +346,7 @@ def insert_or_append(
349346
tool_results_json = json.dumps(tool_results_as_dicts)
350347
except (TypeError, ValueError) as e:
351348
logger.warning(
352-
"Failed to serialize tool_results for "
353-
"conversation %s: %s",
349+
"Failed to serialize tool_results for conversation %s: %s",
354350
conversation_id,
355351
e,
356352
)

tests/unit/utils/test_endpoints.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,9 @@ async def test_cleanup_after_streaming_generate_topic_summary_default_true(
10691069
provider_id="test_provider",
10701070
llama_stack_model_id="test_llama_model",
10711071
query_request=query_request,
1072-
summary=mocker.Mock(llm_response="test response", tool_calls=[]),
1072+
summary=mocker.Mock(
1073+
llm_response="test response", tool_calls=[], tool_results=[]
1074+
),
10731075
metadata_map={},
10741076
started_at="2024-01-01T00:00:00Z",
10751077
client=mock_client,
@@ -1121,7 +1123,9 @@ async def test_cleanup_after_streaming_generate_topic_summary_explicit_false(
11211123
provider_id="test_provider",
11221124
llama_stack_model_id="test_llama_model",
11231125
query_request=query_request,
1124-
summary=mocker.Mock(llm_response="test response", tool_calls=[]),
1126+
summary=mocker.Mock(
1127+
llm_response="test response", tool_calls=[], tool_results=[]
1128+
),
11251129
metadata_map={},
11261130
started_at="2024-01-01T00:00:00Z",
11271131
client=mock_client,

0 commit comments

Comments
 (0)