mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
fix: missing detailed paths of endpoints
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
@ -12,7 +13,17 @@ class EndpointDeclaration(BaseModel):
|
||||
declaration of an endpoint
|
||||
"""
|
||||
|
||||
path: str
|
||||
method: str
|
||||
|
||||
|
||||
class EndpointProviderDeclaration(BaseModel):
|
||||
"""
|
||||
declaration of an endpoint group
|
||||
"""
|
||||
|
||||
settings: list[ProviderConfig] = Field(default_factory=list)
|
||||
endpoints: Optional[list[EndpointDeclaration]] = Field(default_factory=list)
|
||||
|
||||
|
||||
class EndpointEntity(BasePluginEntity):
|
||||
@ -21,14 +32,17 @@ class EndpointEntity(BasePluginEntity):
|
||||
"""
|
||||
|
||||
settings: dict
|
||||
tenant_id: str
|
||||
plugin_id: str
|
||||
expired_at: datetime
|
||||
declaration: EndpointProviderDeclaration = Field(default_factory=EndpointProviderDeclaration)
|
||||
|
||||
|
||||
class EndpointEntityWithInstance(EndpointEntity):
|
||||
name: str
|
||||
enabled: bool
|
||||
url: str
|
||||
hook_id: str
|
||||
tenant_id: str
|
||||
plugin_id: str
|
||||
expired_at: datetime
|
||||
declaration: EndpointDeclaration = Field(default_factory=EndpointDeclaration)
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
|
||||
@ -5,7 +5,7 @@ from pydantic import BaseModel, Field
|
||||
|
||||
from core.model_runtime.entities.provider_entities import ProviderEntity
|
||||
from core.plugin.entities.base import BasePluginEntity
|
||||
from core.plugin.entities.endpoint import EndpointEntity
|
||||
from core.plugin.entities.endpoint import EndpointProviderDeclaration
|
||||
from core.tools.entities.common_entities import I18nObject
|
||||
from core.tools.entities.tool_entities import ToolProviderEntity
|
||||
|
||||
@ -61,7 +61,7 @@ class PluginDeclaration(BaseModel):
|
||||
plugins: Plugins
|
||||
tool: Optional[ToolProviderEntity] = None
|
||||
model: Optional[ProviderEntity] = None
|
||||
endpoint: Optional[EndpointEntity] = None
|
||||
endpoint: Optional[EndpointProviderDeclaration] = None
|
||||
|
||||
|
||||
class PluginEntity(BasePluginEntity):
|
||||
|
||||
Reference in New Issue
Block a user