tool_bundle.py 643 B

12345678910111213141516171819202122232425262728
  1. from typing import Optional
  2. from pydantic import BaseModel
  3. from core.tools.entities.tool_entities import ToolParameter
  4. class ApiToolBundle(BaseModel):
  5. """
  6. This class is used to store the schema information of an api based tool. such as the url, the method, the parameters, etc.
  7. """
  8. # server_url
  9. server_url: str
  10. # method
  11. method: str
  12. # summary
  13. summary: Optional[str] = None
  14. # operation_id
  15. operation_id: str = None
  16. # parameters
  17. parameters: Optional[list[ToolParameter]] = None
  18. # author
  19. author: str
  20. # icon
  21. icon: Optional[str] = None
  22. # openapi operation
  23. openapi: dict