marketplace.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from typing import Optional
  2. from pydantic import BaseModel, Field
  3. from core.model_runtime.entities.provider_entities import ProviderEntity
  4. from core.plugin.entities.endpoint import EndpointProviderDeclaration
  5. from core.plugin.entities.plugin import PluginResourceRequirements
  6. from core.tools.entities.common_entities import I18nObject
  7. from core.tools.entities.tool_entities import ToolProviderEntity
  8. class MarketplacePluginDeclaration(BaseModel):
  9. name: str = Field(..., description="Unique identifier for the plugin within the marketplace")
  10. org: str = Field(..., description="Organization or developer responsible for creating and maintaining the plugin")
  11. plugin_id: str = Field(..., description="Globally unique identifier for the plugin across all marketplaces")
  12. icon: str = Field(..., description="URL or path to the plugin's visual representation")
  13. label: I18nObject = Field(..., description="Localized display name for the plugin in different languages")
  14. brief: I18nObject = Field(..., description="Short, localized description of the plugin's functionality")
  15. resource: PluginResourceRequirements = Field(
  16. ..., description="Specification of computational resources needed to run the plugin"
  17. )
  18. endpoint: Optional[EndpointProviderDeclaration] = Field(
  19. None, description="Configuration for the plugin's API endpoint, if applicable"
  20. )
  21. model: Optional[ProviderEntity] = Field(None, description="Details of the AI model used by the plugin, if any")
  22. tool: Optional[ToolProviderEntity] = Field(
  23. None, description="Information about the tool functionality provided by the plugin, if any"
  24. )
  25. latest_version: str = Field(
  26. ..., description="Most recent version number of the plugin available in the marketplace"
  27. )
  28. latest_package_identifier: str = Field(
  29. ..., description="Unique identifier for the latest package release of the plugin"
  30. )