2024-05-27 22:01:11 +08:00
|
|
|
from typing import Optional
|
2024-02-01 18:11:57 +08:00
|
|
|
|
2024-01-23 19:58:23 +08:00
|
|
|
from pydantic import BaseModel
|
|
|
|
|
2024-05-27 22:01:11 +08:00
|
|
|
from core.tools.entities.tool_entities import ToolParameter
|
2024-02-06 13:21:13 +08:00
|
|
|
|
2024-01-23 19:58:23 +08:00
|
|
|
|
2024-05-27 22:01:11 +08:00
|
|
|
class ApiToolBundle(BaseModel):
|
2024-01-23 19:58:23 +08:00
|
|
|
"""
|
|
|
|
This class is used to store the schema information of an api based tool. such as the url, the method, the parameters, etc.
|
|
|
|
"""
|
2024-09-10 17:00:20 +08:00
|
|
|
|
2024-01-23 19:58:23 +08:00
|
|
|
# server_url
|
|
|
|
server_url: str
|
|
|
|
# method
|
|
|
|
method: str
|
|
|
|
# summary
|
|
|
|
summary: Optional[str] = None
|
|
|
|
# operation_id
|
|
|
|
operation_id: str = None
|
|
|
|
# parameters
|
2024-02-09 15:21:33 +08:00
|
|
|
parameters: Optional[list[ToolParameter]] = None
|
2024-01-23 19:58:23 +08:00
|
|
|
# author
|
|
|
|
author: str
|
|
|
|
# icon
|
|
|
|
icon: Optional[str] = None
|
|
|
|
# openapi operation
|
|
|
|
openapi: dict
|