Comments (5)
File "C:\Users\Administrator\one-bot.venv\lib\site-packages\erniebot_agent\tools\schema.py", line 313, in to_openapi_dict
for field_name, field_info in cls.model_fields.items():
AttributeError: type object 'BihaiAddTimeIn' has no attribute 'model_fields'
from ernie-sdk.
以这个演示demo参考为例,需要稍微改改,避免无法运行。,https://ernie-bot-agent.readthedocs.io/zh-cn/latest/cookbooks/agent/local_tool/#12
from ernie-sdk.
添加环境环境变量
from future import annotations
import os
from erniebot_agent.memory import WholeMemory
from erniebot_agent.chat_models import ERNIEBot
from erniebot_agent.agents.function_agent import FunctionAgent
from erniebot_agent.tools.schema import ToolParameterView
from erniebot_agent.tools.base import Tool
from pydantic import Field
from typing import Any, Dict, Type, List
import asyncio
os.environ["EB_AGENT_ACCESS_TOKEN"] = ""
class AddWordInput(ToolParameterView):
word: str = Field(description="待添加的单词")
class AddWordOutput(ToolParameterView):
result: str = Field(description="表示是否成功将单词成功添加到词库当中")
class AddWordTool(Tool):
description: str = "添加单词到词库当中"
input_type: Type[ToolParameterView] = AddWordInput
ouptut_type: Type[ToolParameterView] = AddWordOutput
def __init__(self) -> None:
self.word_books = {}
super().__init__()
async def __call__(self, word: str) -> Dict[str, Any]:
if word in self.word_books:
return {"result": f"<{word}>单词已经存在,无需添加"}
self.word_books[word] = True
words = "\n".join(list(self.word_books.keys()))
return {"result": f"<{word}>单词已添加成功, 当前单词本中有如下单词:{words}"}
async def main():
agent = FunctionAgent(ERNIEBot("ernie-3.5"),
tools=[AddWordTool()], memory=WholeMemory())
result = await agent.run("将单词:“red”添加到词库当中")
print(result)
asyncio.run(main())
from ernie-sdk.
倒未发现报错~
from ernie-sdk.
这个可能要辛苦 @wj-Mcat 看看
from ernie-sdk.
Related Issues (20)
- 请问支持tool_calls吗? HOT 7
- 请问使用ERNIE Bot Agent开发,怎么设置system呢? HOT 19
- 多代理模式目前实现了吗 HOT 9
- 自定义 Remote Tool,FastAPI 的web 服务
- 官方提供的remote tool识别ocr报错 HOT 1
- 请求对agents的文档和使用说明进行补全 HOT 1
- 有计划出rust的SDK么 HOT 2
- 请问能够接入其他的模型吗?
- ernie-bot-agent 不支持在aistudio的notebook环境中运行 HOT 3
- 自己写了一个RUST SDK,有大佬愿意看看嘛哈哈哈 HOT 1
- function call出了正确结果了,但是最后一步模型回答的还是错误的答案。 HOT 5
- 运行question_bot.py报错请问是哪里出问题了,安装了langchain-community依然报错 HOT 2
- faiss升级faiss.swigfaiss.IndexFlatIP改为faiss.IndexFlatIP HOT 1
- 多代理模式目前实现了吗,coze那个设计的不错 HOT 2
- 星河社区的token(令牌)采用智能体包中的ERNIEBot访问时报[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')(在Aistudio中调用是正常的) HOT 4
- RemoteToolkit.from_url("http://127.0.0.1:8020")读取openapi.yaml成功,但解析时报错。 HOT 3
- 智能体需要多次执法FC,而在文心返回结果中只有一个FC及其相关参数 HOT 3
- 请问一下运行retrieval_function_call的时候报错是什么原因
- 字段命名拼写错误 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ernie-sdk.