mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
50 lines
1.1 KiB
Python
50 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from pydantic import (
|
|
BaseModel,
|
|
SecretStr,
|
|
)
|
|
|
|
from openhands.core.config.mcp_config import MCPConfig
|
|
from openhands.integrations.provider import ProviderToken
|
|
from openhands.integrations.service_types import ProviderType
|
|
from openhands.storage.data_models.settings import Settings
|
|
|
|
|
|
class POSTProviderModel(BaseModel):
|
|
"""
|
|
Settings for POST requests
|
|
"""
|
|
|
|
mcp_config: MCPConfig | None = None
|
|
provider_tokens: dict[ProviderType, ProviderToken] = {}
|
|
|
|
|
|
class POSTCustomSecrets(BaseModel):
|
|
"""
|
|
Adding new custom secret
|
|
"""
|
|
|
|
custom_secrets: dict[str, str | SecretStr] = {}
|
|
|
|
|
|
class GETSettingsModel(Settings):
|
|
"""
|
|
Settings with additional token data for the frontend
|
|
"""
|
|
|
|
provider_tokens_set: dict[ProviderType, str | None] | None = (
|
|
None # provider + base_domain key-value pair
|
|
)
|
|
llm_api_key_set: bool
|
|
|
|
model_config = {'use_enum_values': True}
|
|
|
|
|
|
class GETCustomSecrets(BaseModel):
|
|
"""
|
|
Custom secrets names
|
|
"""
|
|
|
|
custom_secrets: list[str] | None = None
|