You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched GitHub for a duplicate issue and I'm sure this is something new
I have read and followed the docs & demos and still think this is a bug
I am confident that the issue is with modelscope-agent (not my code, or another library in the ecosystem)
What happened + What you expected to happen
您好,
我在建立一个多agent framework,按照单agent的方法把一些本地写的tools写在了上面 (@register_tool('get-index-info')
class GetIndexTool(BaseTool):)但是当运行脚本时出现报错说tools import false:
File "C:\Users\kbzh\folder\modelscope-agent\FRAMEWORK_agent\modelscope_agent\agent.py", line 120, in _register_tool
raise NotImplementedError
NotImplementedError
import logging
import time
import json
import ray
from modelscope_agent import create_component
from modelscope_agent.agents import RolePlay
from modelscope_agent.multi_agents_utils.executors.ray import RayTaskExecutor
from modelscope_agent.task_center import TaskCenter
def receive_input():
# Function to receive input from the user
question = input("Please input your question: ")
return question
def check_completion():
# Function to check if all tasks are completed
for role in roles:
if not role.task_complete:
return False
return True
def generate_answer(question):
# Function to pass the question to the agent framework and monitor completion
planner_agent.input_text(question)
while not check_completion():
time.sleep(1)
return expresser_agent.output_text
def main():
question = receive_input()
answer = generate_answer(question)
output = {
'action': 'output the plan and completion status',
'answer': answer
}
print(json.dumps(output))
if name == "main":
ray.get(task_center.add_agents.remote(roles))
ray.get(task_center.add_agents.remote([output_agent]))
main()
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered:
Initial Checks
What happened + What you expected to happen
您好,
我在建立一个多agent framework,按照单agent的方法把一些本地写的tools写在了上面 (@register_tool('get-index-info')
class GetIndexTool(BaseTool):)但是当运行脚本时出现报错说tools import false:
File "C:\Users\kbzh\folder\modelscope-agent\FRAMEWORK_agent\modelscope_agent\agent.py", line 120, in _register_tool
raise NotImplementedError
NotImplementedError
大概的framework结构和example给出的chatroom类似。我想知道这类示例下tool registration具体应该如何做。
谢谢!
Versions / Dependencies
python 3.11.0
agent
import logging
import time
import json
import ray
from modelscope_agent import create_component
from modelscope_agent.agents import RolePlay
from modelscope_agent.multi_agents_utils.executors.ray import RayTaskExecutor
from modelscope_agent.task_center import TaskCenter
Reproduction script
其中一个implementation如下:
llm_config = {
'model': 'GLM-4',
'model_server': 'zhipu'
}
input tool name
function_list = ['get-index-info','get-index-data','get-index-weight',
'get-industry-info','get-company-info','get-st-history',
'get-stock-data','get-fundamental-data','get-economic-indicator-data']
empty_func_list = []
planner_agent = create_component(
RolePlay,
name='计划者',
remote=REMOTE_MODE,
llm=llm_config,
function_list=empty_func_list,
instruction=PLANNER_INSTRUCTION_PROMPT)
roles = [planner_agent , ....]
def receive_input():
# Function to receive input from the user
question = input("Please input your question: ")
return question
def check_completion():
# Function to check if all tasks are completed
for role in roles:
if not role.task_complete:
return False
return True
def generate_answer(question):
# Function to pass the question to the agent framework and monitor completion
planner_agent.input_text(question)
while not check_completion():
time.sleep(1)
return expresser_agent.output_text
def main():
question = receive_input()
answer = generate_answer(question)
output = {
'action': 'output the plan and completion status',
'answer': answer
}
print(json.dumps(output))
if name == "main":
ray.get(task_center.add_agents.remote(roles))
ray.get(task_center.add_agents.remote([output_agent]))
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered: