Skip to content
New issue

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

[New Feature]update fix-tool-input #280

Merged
merged 10 commits into from
Jan 14, 2024

Conversation

wj-Mcat
Copy link
Collaborator

@wj-Mcat wj-Mcat commented Jan 10, 2024

  • 支持 yaml path 里面没有 operationId 这个字段
  • 使用 pydantic 的方式来dump dataclass 派生类

erniebot-agent/cookbook/remote_tool.ipynb Show resolved Hide resolved
@@ -29,6 +29,19 @@ def __str__(self):
return f"An error occured in stage <{self.stage}>. The error message is {self.message}"


class ToolError(Exception):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啥时候应该抛ToolError, 啥时候应该抛RemoteToolError呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是 LocalTool 就抛 ToolError,如果是 RemoteTool 就抛 RemoteToolError 了。

Comment on lines 8 to 9
from fastapi import FastAPI
from fastapi.openapi.utils import get_openapi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不行吧,直接把fastapi搞到主import路径上了,没有fastapi这个依赖直接报错了

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个调整了。

@@ -241,3 +243,42 @@ async def parse_file_from_response(
"and can not find `Content-Disposition` or `Content-Type` field from response header.",
stage="Output parsing",
)


def custom_openapi(app: FastAPI):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数名字不好,看不出是在干什么

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sijunhe sijunhe merged commit ff86088 into PaddlePaddle:develop Jan 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants