We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
正确调用的情况:
错误调用的情况:
Modelscope-agent: 0.7.0 python: 3.10 OS: centos8
import os import sys import json from typing import Dict, Optional, Union sys.path.insert(0, "/data/workspace/modelscope-agent") from modelscope_agent.agents import RolePlay from modelscope_agent.tools.base import BaseTool from modelscope_agent.tools import register_tool @register_tool("UserDatabase") class UserDatabase(BaseTool): description = "企业员工数据库,包含员工的性别、生日、职位信息" name = "UserDatabase" parameters: list = [ { "name": "name", "type": "string", "description": "员工名字,所属查阅信息的员工姓名,如`张三", "required": True, } ] def __init__(self, cfg: Optional[Dict] = None): super().__init__(cfg) # 数据库存有员工基本信息 self.database = { "李四": {"性别": "女", "生日": "10月3日", "职位": "画师"}, "张三": {"性别": "男", "生日": "5月5日", "职位": "业务员"}, "王五": {"性别": "男", "生日": "12月19日", "职位": "业务经理"}, } def call(self, params: Union[str, dict], **kwargs) -> str: params = self._verify_args(params) name = params["name"] # 输入姓名返回员工信息 return json.dumps(self.database.get(name, "查无此人"), ensure_ascii=False) role_template = "" llm_config = { "model": "qwen2:7b-instruct", "model_server": "ollama", } function_list = ["UserDatabase"] bot = RolePlay(function_list=function_list, llm=llm_config, instruction=role_template) response = bot.run( "职工张三的生日是在今年10月份吗?现在是2月份,距离张三的生日还有几个月?", remote=False, print_info=True, ) text = "" for chunk in response: text += chunk print(text)
None
The text was updated successfully, but these errors were encountered:
zzhangpurdue
suluyana
No branches or pull requests
Initial Checks
What happened + What you expected to happen
正确调用的情况:
错误调用的情况:
Versions / Dependencies
Modelscope-agent: 0.7.0
python: 3.10
OS: centos8
Reproduction script
Issue Severity
None
The text was updated successfully, but these errors were encountered: