tool_bundle.py 649 B

123456789101112131415161718192021222324252627282930
  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.
  7. such as the url, the method, the parameters, etc.
  8. """
  9. # server_url
  10. server_url: str
  11. # method
  12. method: str
  13. # summary
  14. summary: Optional[str] = None
  15. # operation_id
  16. operation_id: str = None
  17. # parameters
  18. parameters: Optional[list[ToolParameter]] = None
  19. # author
  20. author: str
  21. # icon
  22. icon: Optional[str] = None
  23. # openapi operation
  24. openapi: dict