[BUG] Go Ollama adapter does not send tool_name on tool result messages

未关闭 适合新手
#3,371 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@mandipadk 已经在做这个了。

开始于 2026年10月28日。

  • #3422 来自 @mandipadk —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
ai, backend

调研方向

阅读 go/adk/pkg/models/ollama_adk.go,尤其是 convertGenaiContentsToOllamaMessages,并将其函数响应处理方式与 Python 参考文件中的 _convert_content_to_ollama_messages 进行比较。为 get_weather 和 get_time 的响应添加一个测试,检查每条工具消息是否携带其函数名称;当两个 ToolName 值都与对应名称一致时即为完成。

由索引模型根据 Issue 内容生成。

描述

Bug Description

The Go Ollama adapter does not send tool_name on tool result messages. In convertGenaiContentsToOllamaMessages, each function response becomes a message with only role: tool and content. The Python Ollama adapter sets tool_name from the function response name. Ollama uses this field when it builds the prompt. For example, the Gemma 4 renderer shows a result with no tool_name as coming from an "unknown" tool.

Steps To Reproduce
  1. Build a history with a model turn that calls get_weather and get_time, then a user turn with both function responses.
  2. Pass it to convertGenaiContentsToOllamaMessages.
  3. Both tool messages have an empty ToolName.
Expected Behavior

Each tool message carries the name of the tool that produced it, the same as the Python runtime.

Additional Context

File: go/adk/pkg/models/ollama_adk.go. Python reference: _convert_content_to_ollama_messages in python/packages/kagent-adk/src/kagent/adk/models/_ollama.py. I have a small fix with a test ready.

主要语言
Go
星标
4.1k
派生
859
平均合并
1 天 7 小时
30 天内合并 PR
174

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kagent-dev/kagent 的其他 Issue

查看 kagent-dev/kagent 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。