Skip to content
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

3.0版本的上下文管理如何使用 #32

Closed
BussanQ opened this issue Nov 16, 2023 · 3 comments
Closed

3.0版本的上下文管理如何使用 #32

BussanQ opened this issue Nov 16, 2023 · 3 comments

Comments

@BussanQ
Copy link

BussanQ commented Nov 16, 2023

3.0版本的上下文管理如何使用?

@Maplemx
Copy link
Owner

Maplemx commented Nov 16, 2023

3.0.1版本有一个bug会导致Session能力无法正常工作

临时修正方法为:

  1. 下载这个包session_plugin.zip内容,解压到执行文件夹;
  2. 在脚本中通过:
from session_plugin import install
install(Agently)

更新主包中的session插件

  1. 通过以下脚本尝试运行上下文管理:
import json
import Agently

from session_plugin import install
install(Agently)

agent_factory = Agently.AgentFactory(is_debug = True)

agent_factory\
    .set_settings("model.OpenAI.auth", { "api_key": "Your-API-Key" })\
    .set_settings("model.OpenAI.url", "Your-Base-URL-if-needed")\
    .set_settings("is_debug", True)

agent = agent_factory.create_agent("my-agent")#任意唯一id

session_id = agent.active_session("my-session")#任意唯一id

agent\
    .input("提醒我买个鸡蛋")\
    .start()

agent\
    .input("我们刚才说了什么")\
    .start()

agent.stop_session()

此问题将被修复,并在下一次版本发布时更新

更新后issue关闭

@Maplemx
Copy link
Owner

Maplemx commented Nov 16, 2023

已经在此次提交修复问题,兼容插件携带或不携带"prompt."开头的返回键值进行返回

0256a1e

@Maplemx
Copy link
Owner

Maplemx commented Nov 17, 2023

fixed in 3.0.2

@Maplemx Maplemx closed this as completed Nov 17, 2023
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

No branches or pull requests

2 participants