-
Notifications
You must be signed in to change notification settings - Fork 55
allow user format mcp content #733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
CLA Assistant Lite bot: 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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果业务实现 callback 不是规范的 model.Message,这里可能会 panic。
No description provided.