Jiayi Lan
Jiayi Lan
貌似github代码块不能很好的处理代码与报错显示?我再重新发看看。 刚开始的堆栈报错: Traceback (most recent call last): File "/home/aistudio/deploy/llm_agent/api/common_tools/ocr_tools.py", line 78, in asyncio.run(a()) File "/home/aistudio/external-libraries/agent/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/home/aistudio/external-libraries/agent/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File...
这个是最早的代码: from __future__ import annotations import requests from typing import Any, Dict, Type, List from pydantic import Field from erniebot_agent.tools.base import Tool from erniebot_agent.file.local_file import LocalFile from erniebot_agent.tools.schema import ToolParameterView...
目前的情况: 我试着让pydantic不处理这个类而是直接调用,即: class CustomOCRInput(ToolParameterView): class Config: arbitrary_types_allowed = True local_file: 'erniebot_agent.file.local_file.LocalFile' img: 'erniebot_agent.file.local_file.LocalFile' = Field(description="待识别的图像") 报错: Traceback (most recent call last): File "/home/aistudio/deploy/llm_agent/api/common_tools/ocr_tools.py", line 78, in asyncio.run(a()) File "/home/aistudio/external-libraries/agent/lib/python3.10/asyncio/runners.py", line...
防沉,菜狗一只,希望有大佬捞捞
嗯嗯,我希望这是一个文件路径,或是别的除了LocalFile以外的其他东西(路径或者PIL Image数据类都可以),不过教程中并没有告诉我这该如何做?您方便帮个忙吗? 在 2024-07-10 14:15:37,"Sijun He" ***@***.***> 写道: hello. 报错的原因是CustomOCRInput 的 img 的type不应该是 LocalFile. 这个img你是希望一个文件路径吗? 还是希望模型填入一个创建好了的LocalFile? — Reply to this email directly, view it on GitHub, or unsubscribe. You are...
我这里没有解决,方便请问您的解决方案吗?
感谢您的解决方案!我想这应该能工作
@Alex-Shut @zwpaper Hey, I encountered a similar problem as yours when using it. The initial judgment is that it is a regular expression matching problem of id&name. You may need...