-
Notifications
You must be signed in to change notification settings - Fork 138
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
请问 OAIClient 是哪个Agently 版本可以使用? #151
Comments
目前版本是3.3.4.5,3.0.4已经远低于当前版本了
在 2024年8月21日星期三,Uerben ***@***.***> 写道:
… 目前我本地安装的版本 Agently==3.0.4
agent = (
Agently.create_agent()
.set_settings("current_model", "OAIClient")
.set_settings("model.OAIClient.auth.api_key", "sk-
3f10906a8c054a5a9cf0a7a4abe27e8a")
# 使用DashScope专门适配的API Base URL
.set_settings("model.OAIClient.url", "https://dashscope.aliyuncs.
com/compatible-mode/v1")
# 如果需要切换模型,可参考模型清单:https://help.aliyun.com/zh/dashscope/
developer-reference/openai-file-interface
.set_settings("model.OAIClient.options.model", "qwen-turbo")
)
result = (
agent
# general: agent应该知道的全局信息,通常被视作system prompt或类似位置的信息
.general("输出规定", "必须使用中文进行输出")
# role: agent自身的角色设定信息
.role({
"姓名": "Agently小助手",
"任务": "使用自己的知识为用户解答常见问题",
})
# user_info: agent需要了解的用户相关的信息
.user_info("和你对话的用户是一个只具有Python编程基础知识的入门初学者")
# abstract: 对于之前对话(尤其是较长对话)的总结信息
.abstract(None)
# chat_history: 按照OpenAI消息列格式的对话记录list
## 支持:
## [{ "role": "system", "content": "" },
## { "role": "assistant", "content": "" },
## { "role": "user", "content": "" }]
## 三种角色
.chat_history([])
# input: 和本次请求相关的输入信息
.input({
"question": "请问Python中协程和线程的关系和区别是什么?",
"reply_style_expect": "请用对编程概念零基础的人能理解的方式进行回复"
})
# info: 为本次请求提供的额外补充信息
.info("协程相关关键词", ["asyncio", "coroutine", "event loop"])
.info("线程相关关键词", ["threads", "queue"])
# instruct: 为本次请求提供的行动指导信息
.instruct([
"请使用{reply_style_expect}的回复风格,回复{question}提出的问题",
])
# output: 对本次请求的输出提出格式和内容的要求
.output({
"reply": ("str", "对{question}的直接回复"),
"next_questions": ([
("str",
"根据{reply}内容,结合{user_info}提供的用户信息," +
"给用户推荐的可以进一步提问的问题"
)], "不少于3个"),
})
# start: 用于开始本次主要交互请求
.start()
)
print(result)
执行后,Exception: [Plugin Manager] Plugin 'OAIClient' is not in the plugins
runtime_ctx of module 'request' 异常。
—
Reply to this email directly, view it on GitHub
<#151>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBVNY543LFPEAEU7E65KO3ZSRYFLAVCNFSM6AAAAABM3Y54O6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3TONZVGAYDEMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Thanks,
Mo Xin
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
目前我本地安装的版本 Agently==3.0.4
agent = (
Agently.create_agent()
.set_settings("current_model", "OAIClient")
.set_settings("model.OAIClient.auth.api_key", "sk-3f10906a8c054a5a9cf0a7a4abe27e8a")
# 使用DashScope专门适配的API Base URL
.set_settings("model.OAIClient.url", "https://dashscope.aliyuncs.com/compatible-mode/v1")
# 如果需要切换模型,可参考模型清单:https://help.aliyun.com/zh/dashscope/developer-reference/openai-file-interface
.set_settings("model.OAIClient.options.model", "qwen-turbo")
)
result = (
agent
# general: agent应该知道的全局信息,通常被视作system prompt或类似位置的信息
.general("输出规定", "必须使用中文进行输出")
# role: agent自身的角色设定信息
.role({
"姓名": "Agently小助手",
"任务": "使用自己的知识为用户解答常见问题",
})
# user_info: agent需要了解的用户相关的信息
.user_info("和你对话的用户是一个只具有Python编程基础知识的入门初学者")
# abstract: 对于之前对话(尤其是较长对话)的总结信息
.abstract(None)
# chat_history: 按照OpenAI消息列格式的对话记录list
## 支持:
## [{ "role": "system", "content": "" },
## { "role": "assistant", "content": "" },
## { "role": "user", "content": "" }]
## 三种角色
.chat_history([])
# input: 和本次请求相关的输入信息
.input({
"question": "请问Python中协程和线程的关系和区别是什么?",
"reply_style_expect": "请用对编程概念零基础的人能理解的方式进行回复"
})
# info: 为本次请求提供的额外补充信息
.info("协程相关关键词", ["asyncio", "coroutine", "event loop"])
.info("线程相关关键词", ["threads", "queue"])
# instruct: 为本次请求提供的行动指导信息
.instruct([
"请使用{reply_style_expect}的回复风格,回复{question}提出的问题",
])
# output: 对本次请求的输出提出格式和内容的要求
.output({
"reply": ("str", "对{question}的直接回复"),
"next_questions": ([
("str",
"根据{reply}内容,结合{user_info}提供的用户信息," +
"给用户推荐的可以进一步提问的问题"
)], "不少于3个"),
})
# start: 用于开始本次主要交互请求
.start()
)
print(result)
执行后,Exception: [Plugin Manager] Plugin 'OAIClient' is not in the plugins runtime_ctx of module 'request' 异常。
The text was updated successfully, but these errors were encountered: