Maplemx / Agently

[AI Agent Application Development Framework] - 🚀 Build AI agent native application in very few code 💬 Easy to interact with AI agent in code using structure data and chained-calls syntax 🧩 Enhance AI Agent using plugins instead of rebuild a whole new agent
http://agently.tech
Apache License 2.0
1.07k stars 122 forks source link

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

Closed BussanQ closed 10 months ago

BussanQ commented 10 months ago

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

Maplemx commented 10 months ago

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

临时修正方法为:

  1. 下载这个包session_plugin.zip内容,解压到执行文件夹;

  2. 在脚本中通过:

    from session_plugin import install
    install(Agently)

    更新主包中的session插件

  3. 通过以下脚本尝试运行上下文管理:

    
    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 commented 10 months ago

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

https://github.com/Maplemx/Agently/commit/0256a1e3fbce3077260e32228bfed6ed9f9f3d14

Maplemx commented 10 months ago

fixed in 3.0.2