dify/api/core/plugin/entities/endpoint.py

29 lines
617 B
Python
Raw Normal View History

2024-09-26 12:49:00 +08:00
from datetime import datetime
2024-09-26 14:51:10 +08:00
from pydantic import BaseModel, Field
from core.entities.provider_entities import ProviderConfig
2024-09-26 12:49:00 +08:00
from core.plugin.entities.base import BasePluginEntity
2024-09-26 14:51:10 +08:00
class EndpointDeclaration(BaseModel):
"""
declaration of an endpoint
"""
2024-09-30 17:39:13 +08:00
settings: list[ProviderConfig] = Field(default_factory=list)
2024-09-26 14:51:10 +08:00
2024-09-26 12:49:00 +08:00
class EndpointEntity(BasePluginEntity):
2024-09-26 14:51:10 +08:00
"""
entity of an endpoint
"""
2024-09-26 12:49:00 +08:00
settings: dict
2024-09-30 16:57:09 +08:00
name: str
2024-09-26 12:49:00 +08:00
hook_id: str
tenant_id: str
plugin_id: str
expired_at: datetime
2024-09-26 14:51:10 +08:00
declaration: EndpointDeclaration = Field(default_factory=EndpointDeclaration)