Skip to content

Commit a0bfc12

Browse files
committed
Fix failing tests
1 parent 583ea14 commit a0bfc12

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • python/semantic_kernel/connectors/ai/google/vertex_ai/services

python/semantic_kernel/connectors/ai/google/vertex_ai/services/utils.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft. All rights reserved.
22

3+
import json
34
import logging
45
from typing import TYPE_CHECKING
56

@@ -88,7 +89,14 @@ def format_assistant_message(message: ChatMessageContent) -> list[Part]:
8889
if item.text:
8990
parts.append(Part.from_text(item.text))
9091
elif isinstance(item, FunctionCallContent):
91-
parts.append(Part.from_dict({"function_call": {"name": item.name, "args": item.arguments}}))
92+
parts.append(
93+
Part.from_dict({
94+
"function_call": {
95+
"name": item.name,
96+
"args": json.loads(item.arguments) if isinstance(item.arguments, str) else item.arguments,
97+
}
98+
})
99+
)
92100
elif isinstance(item, ImageContent):
93101
parts.append(_create_image_part(item))
94102
else:

0 commit comments

Comments
 (0)