Skip to content

.NET: [Bug] : arguments null to Error message is: 'NoneType' object has no attribute items #6514

@junkai-li

Description

@junkai-li

Description

当AI调用 自定义的WriteTextToDesktop函数 传入了arguments:null ,我的函数参数都是必填 导致报错直接报错
下面是我捕捉的json

Code Sample

{
            "role": "assistant",
            "content": "下面是一个完全由我原创设计的科技风格 HTML 可视化页面,基于你提供的内容,涵盖架构、工具注入、技能加载、绑定管理等核心模块。\n\n",
            "tool_calls": [
                {
                    "id": "call_ffee0b78ef0b44d197647dd8",
                    "type": "function",
                    "function": {
                        "name": "WriteTextToDesktop",
                        "arguments": "null"
                    }
                }
            ]
        },  {
            "type": "function",
            "function": {
                "description": "输出文件到系统桌面。 用于把各种文件输出到桌面",
                "name": "WriteTextToDesktop",
                "parameters": {
                    "type": "object",
                    "required": [
                        "fileName",
                        "content"
                    ],
                    "properties": {
                        "fileName": {
                            "description": "\u6587\u4EF6\u540D\u79F0\u5982\uFF08xx.html,xx.txt\uFF09\u652F\u6301\u5404\u79CD\u6587\u4EF6\u7C7B\u578B",
                            "type": "string"
                        },
                        "content": {
                            "description": "\u5185\u5BB9",
                            "type": "string"
                        },
                        "overwrite": {
                            "description": "\u6587\u4EF6\u662F\u5426\u4E0D\u5B58\u5728 \u9ED8\u8BA4\u662F",
                            "type": "boolean",
                            "default": true
                        }
                    },
                    "additionalProperties": false
                }
            }
        },

Error Messages / Stack Traces

{"message":"<400> InternalError.Algo.InvalidParameter: Error message is: 'NoneType' object has no attribute 'items'","type":"invalid_request_error","param":null,"code":"invalid_parameter_error"},"id":"chatcmpl-2d4c0c6a-dfad-9df6-bf7f-cd61a3766458","request_id":"2d4c0c6a-dfad-9df6-bf7f-cd61a3766458"}

Package Versions

1.10.0

.NET Version

9

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions