chatwitheino/cmd/ch04/main.go中没有将工具调用上下文存入到session中

Open
#241 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
ai, backend

Research direction

Start with quickstart/chatwitheino/cmd/ch04/main.go and inspect how userMsg, assistantMsg, and tool-call results are appended to session. Reproduce a multi-turn conversation that uses a tool, then verify that the session retains the tool-call context and returned result so a later request can refer to it.

Written by the indexing model from the issue text.

Description

https://github.com/cloudwego/eino-examples/blob/main/quickstart/chatwitheino/cmd/ch04/main.go
示例中似乎只把userMsg、assistantMsg(最终文本)存入到了session中,丢失了工具调用的上下文——不知道之前调用过哪些工具、工具返回了什么结果。对于需要参考之前工具调用结果的多轮对话场景(比如"基于之前读的那个文件再做些修改"),模型会表现得"失忆"。

        userMsg := msgops.NewUser[M](line)
		if err := session.Append(userMsg); err != nil {
			_, _ = fmt.Fprintln(os.Stderr, err)
			os.Exit(1)
		}


         assistantMsg := msgops.NewAssistant[M](result.AssistantText, nil)
		if err := session.Append(assistantMsg); err != nil {
			_, _ = fmt.Fprintln(os.Stderr, err)
			os.Exit(1)
		}
Dominant language
Go
Stars
806
Forks
274
Avg merge
13h 34m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudwego/eino-examples

All issues in cloudwego/eino-examples

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.