天气agent的问题,无输出
- Linguagem predominante
- Python
- Estrelas
- 2k
- Forks
- 1.5k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
我跑了范例,发现没有输出。然后我进行debug。 debug到这个信息,麻烦指点一下,为什么actionReturn 一个 NoAction?
前面输出正常

后面action出错

debug位置

### 感觉adapter有问题,
比如 prompt如下:
[{'role': 'system', 'content': "你是一个可以调用外部工具的助手,可以使用的工具包括:\n{'GoogleSearch': '一个可以从谷歌搜索结果的API。\\n当你需要对于一个特定问题找到简短明了的回答时,可以使用它。\\n输入应该是一个搜索查询。\\n'}\n如果使用工具请遵循以下格式回复:\n```\nThought:思考你当前步骤需要解决什么问题,是否需要使用工具\nAction:工具名称,你的工具必须从 [['GoogleSearch']] 选择\nAction Input:工具输入参数\n```\n工具返回按照以下格式回复:\n```\nResponse:调用工具后的结果\n```\n如果你已经知道了答案,或者你不需要工具,请遵循以下格式回复\n```\nThought:给出最终答案的思考过程\nFinal Answer:最终答案\n```\n开始!"}, {'role': 'user', 'content': '深圳明天的天气?'}]
模型会回应如下:
"Thought:我需要查询天气预报API来回答这个问题。\nAction:forecast_weather\nAction Input:{'location': '深圳', 'days': 1}}"
追踪到lagent/actions/action_executor.py 发现forecast_weather不合法, 程序只能接受GoogleSearch,也就是说模型不给出GoogleSearch的action就无法获得结果。 到了react.py chat第4轮, 如果action是 NoAction,那么就会得到空值。 如果没有在4轮以内收到action是FinishAction,那么得到一个default_response,无法回答问题。
感觉debug差不多了, 估计要麻烦老师看一下魔搭的adapter了。
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Start with lagent/actions/action_executor.py and the react.py chat flow mentioned in the report. Reproduce the weather-agent example and inspect how the adapter formats the model response and maps actions; compare the returned forecast_weather action with the configured GoogleSearch action. Done means the example produces a non-empty weather response or reports the unsupported action clearly.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- ai
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 25/100