tool_bundle.py 920 B

12345678910111213141516171819202122232425262728293031323334
  1. from pydantic import BaseModel
  2. from typing import Dict, Optional, Any, List
  3. from core.tools.entities.tool_entities import ToolProviderType, ToolParamter
  4. class ApiBasedToolBundle(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[ToolParamter]] = None
  18. # author
  19. author: str
  20. # icon
  21. icon: Optional[str] = None
  22. # openapi operation
  23. openapi: dict
  24. class AppToolBundle(BaseModel):
  25. """
  26. This class is used to store the schema information of an tool for an app.
  27. """
  28. type: ToolProviderType
  29. credential: Optional[Dict[str, Any]] = None
  30. provider_id: str
  31. tool_name: str