Skip to content

Conversation

@xiehuc
Copy link

@xiehuc xiehuc commented Nov 24, 2025

No description provided.

@github-actions
Copy link

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

// - error: if not nil, this error will be returned.
type AfterToolCallback func(ctx context.Context, toolName string, toolDeclaration *Declaration, jsonArgs []byte, result any, runErr error) (any, error)

type Message any // should be model.Message, avoid cycle import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个导出字段需要加一下注释 // Message ...

// Marshal the result to JSON.
resultBytes, err := json.Marshal(result)
format := toolJsonContent
if p.toolCallbacks.ToolFormatMessage != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.toolCallbacks 可能是 nil,得判断一下

ToolID: toolCall.ID,
},
Index: index,
Message: msg.(model.Message),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果业务实现 callback 不是规范的 model.Message,这里可能会 panic。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants