Repository navigation
Replies: 1 comment 2 replies
|
The history is not in the workspace. By default HarnessAgent saves the conversation state in a separate directory under your user home: I checked this against the source, not a running 2.0.4. In 2.0.4, if you don't call The docs also describe this location, which is deliberately kept outside the workspace: To start from a clean history you can do any of these:
On current main, which will become 2.1.0, this changed. The default is now an event-log mode that keeps its history in a reserved (I looked this up in the code with help from an AI assistant; the links are to the lines I checked.) |
Uh oh!
There was an error while loading. Please reload this page.
我在使用
<dependency> <groupId>io.agentscope</groupId> <artifactId>agentscope-harness</artifactId> <version>2.0.4</version> </dependency> <dependency> <groupId>io.agentscope</groupId> <artifactId>agentscope-extensions-model-dashscope</artifactId> <version>2.0.4</version> </dependency>做一个对话的测试例子。
模型的基本配置是:
@Bean public HarnessAgent.Builder getHarnessAgentBuilder() { return HarnessAgent.builder() .name("note-taker") .agentId("note-taker") .sysPrompt("你是一个百事通。") .model("dashscope:qwen-plus") .workspace(Path.of(".agentscope/workspace")); }工作目录是:.agentscope/workspace。
通过:
RuntimeContext ctx = RuntimeContext.builder() .userId("alice").sessionId("demo-session").build(); Msg reply = agent.call(new UserMessage(message), ctx).block();发送对话消息。
第一次发送之后在
.agentscope/workspace 这个目录下记录对话内容。
### 我的问题是:
我将 .agentscope/workspace 这个文件删除之后。在没有修改 userId和sessionId的情况下。再次发送消息。发送给模型的消息里面依然有历史对话内容。请问一下,为什么删除了.agentscope/workspace 文件之后还能存在历史对话内容。历史对话是从哪里读取的?我没有配置任何的缓存和持久化。目录删除之后服务重启也不行。
All reactions