ms-agent icon indicating copy to clipboard operation
ms-agent copied to clipboard

keyerror_qwen_dashscope

Open buptzhulin opened this issue 7 months ago • 1 comments

Initial Checks

  • [ ] 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

运行RolePlay, 报错误,KeyError: 'qwen_dashscope'

Versions / Dependencies

master 分支: 4238cf9da5b7a7e2e5819794d8e5d5648dc33c56

Reproduction script

import os os.environ['DASHSCOPE_API_KEY']="xxxxxxxx" #YOUR_DASHSCOPE_API_KEY os.environ['AMAP_TOKEN']="yyyyyyyy" #YOUR_AMAP_TOKEN

选用RolePlay 配置agent

from modelscope_agent.agents.role_play import RolePlay # NOQA

role_template = '你扮演一个天气预报助手,你需要查询相应地区的天气,并调用给你的画图工具绘制一张城市的图。'

llm_config = {'model': 'qwen-max', 'model_server': 'dashscope'}

input tool name

function_list = ['amap_weather', 'image_gen']

bot = RolePlay( function_list=function_list, llm=llm_config, instruction=role_template)

response = bot.run('朝阳区天气怎样?')

text = '' for chunk in response: text += chunk

Issue Severity

None

buptzhulin avatar May 23 '25 09:05 buptzhulin

+1

2686685661 avatar May 29 '25 10:05 2686685661