From 7818f2cc38152ce6713b270972834e0939b380f7 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Tue, 26 Aug 2025 19:22:00 +0800 Subject: [PATCH 1/2] fix: tool_call dump bug --- config.yaml.full | 2 +- pyproject.toml | 2 +- .../extractors/tool_attributes_extractors.py | 10 ++++++---- veadk/version.py | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/config.yaml.full b/config.yaml.full index 1bdda69e..e9b2db26 100644 --- a/config.yaml.full +++ b/config.yaml.full @@ -88,7 +88,7 @@ database: db: 0 # default # [optional] for knowledgebase (https://console.volcengine.com/vikingdb) viking: - project: # user project in Volcengine Viking DB + project: default # user project in Volcengine Viking DB region: cn-beijing # [optional] for knowledgebase with viking database tos: diff --git a/pyproject.toml b/pyproject.toml index 26475dcf..b9c0c5d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "veadk-python" -version = "0.2.4" +version = "0.2.5" description = "Volcengine agent development kit, integrations with Volcengine cloud services." readme = "README.md" requires-python = ">=3.10" diff --git a/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py b/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py index 388646a9..aa9af646 100644 --- a/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py +++ b/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py @@ -52,11 +52,13 @@ def tool_gen_ai_tool_name(params: ToolAttributesParams) -> ExtractorResponse: def tool_cozeloop_output(params: ToolAttributesParams) -> ExtractorResponse: - function_response = params.function_response_event.get_function_responses()[0] + function_response = params.function_response_event.get_function_responses()[ + 0 + ].model_dump() tool_output = { - "id": function_response.id, - "name": function_response.name, - "response": function_response.response, + "id": function_response["id"], + "name": function_response["name"], + "response": function_response["response"], } return ExtractorResponse(content=json.dumps(tool_output) or "") diff --git a/veadk/version.py b/veadk/version.py index 6f9485ea..c759311b 100644 --- a/veadk/version.py +++ b/veadk/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = "0.2.4" +VERSION = "0.2.5" From 8d4d0db19be6f9e23b09c2d96164c9b9d764de63 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Tue, 26 Aug 2025 19:29:09 +0800 Subject: [PATCH 2/2] fix: tool_call dump ascii bug --- .../attributes/extractors/tool_attributes_extractors.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py b/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py index aa9af646..483bf17f 100644 --- a/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py +++ b/veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py @@ -44,7 +44,9 @@ def tool_cozeloop_input(params: ToolAttributesParams) -> ExtractorResponse: "description": params.tool.description, "parameters": params.args, } - return ExtractorResponse(content=json.dumps(tool_input) or "") + return ExtractorResponse( + content=json.dumps(tool_input, ensure_ascii=False) or "" + ) def tool_gen_ai_tool_name(params: ToolAttributesParams) -> ExtractorResponse: @@ -60,7 +62,9 @@ def tool_cozeloop_output(params: ToolAttributesParams) -> ExtractorResponse: "name": function_response["name"], "response": function_response["response"], } - return ExtractorResponse(content=json.dumps(tool_output) or "") + return ExtractorResponse( + content=json.dumps(tool_output, ensure_ascii=False) or "" + ) TOOL_ATTRIBUTES = {