Skip to content

Commit cf26b14

Browse files
authored
fix: tool_call bug (#107)
* fix: tool_call dump bug * fix: tool_call dump ascii bug
1 parent 0730dfa commit cf26b14

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

config.yaml.full

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ database:
8888
db: 0 # default
8989
# [optional] for knowledgebase (https://console.volcengine.com/vikingdb)
9090
viking:
91-
project: # user project in Volcengine Viking DB
91+
project: default # user project in Volcengine Viking DB
9292
region: cn-beijing
9393
# [optional] for knowledgebase with viking database
9494
tos:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "veadk-python"
3-
version = "0.2.4"
3+
version = "0.2.5"
44
description = "Volcengine agent development kit, integrations with Volcengine cloud services."
55
readme = "README.md"
66
requires-python = ">=3.10"

veadk/tracing/telemetry/attributes/extractors/tool_attributes_extractors.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,27 @@ def tool_cozeloop_input(params: ToolAttributesParams) -> ExtractorResponse:
4444
"description": params.tool.description,
4545
"parameters": params.args,
4646
}
47-
return ExtractorResponse(content=json.dumps(tool_input) or "<unknown_tool_input>")
47+
return ExtractorResponse(
48+
content=json.dumps(tool_input, ensure_ascii=False) or "<unknown_tool_input>"
49+
)
4850

4951

5052
def tool_gen_ai_tool_name(params: ToolAttributesParams) -> ExtractorResponse:
5153
return ExtractorResponse(content=params.tool.name or "<unknown_tool_name>")
5254

5355

5456
def tool_cozeloop_output(params: ToolAttributesParams) -> ExtractorResponse:
55-
function_response = params.function_response_event.get_function_responses()[0]
57+
function_response = params.function_response_event.get_function_responses()[
58+
0
59+
].model_dump()
5660
tool_output = {
57-
"id": function_response.id,
58-
"name": function_response.name,
59-
"response": function_response.response,
61+
"id": function_response["id"],
62+
"name": function_response["name"],
63+
"response": function_response["response"],
6064
}
61-
return ExtractorResponse(content=json.dumps(tool_output) or "<unknown_tool_output>")
65+
return ExtractorResponse(
66+
content=json.dumps(tool_output, ensure_ascii=False) or "<unknown_tool_output>"
67+
)
6268

6369

6470
TOOL_ATTRIBUTES = {

veadk/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION = "0.2.4"
15+
VERSION = "0.2.5"

0 commit comments

Comments
 (0)