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
openai.BadRequestError: Error code: 400 - {'object': 'error', 'message': '[{'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'system'", 'input': 'user', 'ctx': {'expected': "'system'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'assistant'", 'input': 'user', 'ctx': {'expected': "'assistant'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'tool'", 'input': 'user', 'ctx': {'expected': "'tool'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'missing', 'loc': ('body', 'messages', 1, 'typed-dict', 'tool_call_id'), 'msg': 'Field required', 'input': {'role': 'user', 'content': 'user_requirement: who are u', 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'missing', 'loc': ('body', 'messages', 1, 'typed-dict', 'name'), 'msg': 'Field required', 'input': {'role': 'user', 'content': 'user_requirement: who are u', 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'function'", 'input': 'user', 'ctx': {'expected': "'function'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'system'", 'input': 'assistant', 'ctx': {'expected': "'system'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'user'", 'input': 'assistant', 'ctx': {'expected': "'user'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'tool'", 'input': 'assistant', 'ctx': {'expected': "'tool'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'missing', 'loc': ('body', 'messages', 2, 'typed-dict', 'tool_call_id'), 'msg': 'Field required', 'input': {'role': 'assistant', 'content': "I'm an AI assistant designed to provide information and help answer a wide range of questions. My capabilities include accessing vast databases, executing computational tasks, and interacting through various media formats. If you have any specific questions or tasks, feel free to ask!", 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'missing', 'loc': ('body', 'messages', 2, 'typed-dict', 'name'), 'msg': 'Field required', 'input': {'role': 'assistant', 'content': "I'm an AI assistant designed to provide information and help answer a wide range of questions. My capabilities include accessing vast databases, executing computational tasks, and interacting through various media formats. If you have any specific questions or tasks, feel free to ask!", 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'function'", 'input': 'assistant', 'ctx': {'expected': "'function'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}]', 'type': 'BadRequestError', 'param': None, 'code': 400}
Modelscope-agent 0.21
import logging import os import time
from modelscope_agent import create_component from modelscope_agent.agents import RolePlay from modelscope_agent.task_center import TaskCenter
REMOTE_MODE = False
llm_config = { "model": "qwen_7B_chat", "model_server": "openai", "api_base": "url", "stream":True }
function_list = []
task_center = create_component( TaskCenter, name='task_center', remote=REMOTE_MODE)
logging.warning(msg=f'time:{time.time()} done create task center')
role_play1 = create_component( RolePlay, name='role_play1', remote=REMOTE_MODE, llm=llm_config, function_list=function_list)
role_play2 = create_component( RolePlay, name='role_play2', remote=REMOTE_MODE, llm=llm_config, function_list=function_list)
task_center.add_agents([role_play1, role_play2])
n_round = 2 task = 'who are u' task_center.send_task_request(task) while n_round > 0:
for frame in task_center.step(): print(frame) time.sleep(3) n_round -= 1
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
openai.BadRequestError: Error code: 400 - {'object': 'error', 'message': '[{'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'system'", 'input': 'user', 'ctx': {'expected': "'system'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'assistant'", 'input': 'user', 'ctx': {'expected': "'assistant'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'tool'", 'input': 'user', 'ctx': {'expected': "'tool'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'missing', 'loc': ('body', 'messages', 1, 'typed-dict', 'tool_call_id'), 'msg': 'Field required', 'input': {'role': 'user', 'content': 'user_requirement: who are u', 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'missing', 'loc': ('body', 'messages', 1, 'typed-dict', 'name'), 'msg': 'Field required', 'input': {'role': 'user', 'content': 'user_requirement: who are u', 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'literal_error', 'loc': ('body', 'messages', 1, 'typed-dict', 'role'), 'msg': "Input should be 'function'", 'input': 'user', 'ctx': {'expected': "'function'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 1, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'system'", 'input': 'assistant', 'ctx': {'expected': "'system'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'user'", 'input': 'assistant', 'ctx': {'expected': "'user'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'tool'", 'input': 'assistant', 'ctx': {'expected': "'tool'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'missing', 'loc': ('body', 'messages', 2, 'typed-dict', 'tool_call_id'), 'msg': 'Field required', 'input': {'role': 'assistant', 'content': "I'm an AI assistant designed to provide information and help answer a wide range of questions. My capabilities include accessing vast databases, executing computational tasks, and interacting through various media formats. If you have any specific questions or tasks, feel free to ask!", 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'missing', 'loc': ('body', 'messages', 2, 'typed-dict', 'name'), 'msg': 'Field required', 'input': {'role': 'assistant', 'content': "I'm an AI assistant designed to provide information and help answer a wide range of questions. My capabilities include accessing vast databases, executing computational tasks, and interacting through various media formats. If you have any specific questions or tasks, feel free to ask!", 'sent_from': 'role_play1', 'send_to': ['all']}, 'url': 'https://errors.pydantic.dev/2.6/v/missing'}, {'type': 'literal_error', 'loc': ('body', 'messages', 2, 'typed-dict', 'role'), 'msg': "Input should be 'function'", 'input': 'assistant', 'ctx': {'expected': "'function'"}, 'url': 'https://errors.pydantic.dev/2.6/v/literal_error'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'sent_from'), 'msg': 'Extra inputs are not permitted', 'input': 'role_play1', 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}, {'type': 'extra_forbidden', 'loc': ('body', 'messages', 2, 'typed-dict', 'send_to'), 'msg': 'Extra inputs are not permitted', 'input': ['all'], 'url': 'https://errors.pydantic.dev/2.6/v/extra_forbidden'}]', 'type': 'BadRequestError', 'param': None, 'code': 400}
Versions / Dependencies
Modelscope-agent 0.21
Reproduction script
import logging
import os
import time
from modelscope_agent import create_component
from modelscope_agent.agents import RolePlay
from modelscope_agent.task_center import TaskCenter
REMOTE_MODE = False
llm_config = {
"model": "qwen_7B_chat",
"model_server": "openai",
"api_base": "url",
"stream":True
}
function_list = []
task_center = create_component(
TaskCenter, name='task_center', remote=REMOTE_MODE)
logging.warning(msg=f'time:{time.time()} done create task center')
role_play1 = create_component(
RolePlay,
name='role_play1',
remote=REMOTE_MODE,
llm=llm_config,
function_list=function_list)
role_play2 = create_component(
RolePlay,
name='role_play2',
remote=REMOTE_MODE,
llm=llm_config,
function_list=function_list)
task_center.add_agents([role_play1, role_play2])
n_round = 2
task = 'who are u'
task_center.send_task_request(task)
while n_round > 0:
Issue Severity
None
The text was updated successfully, but these errors were encountered: