mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-06 06:49:48 +08:00
38 lines
814 B
Python
38 lines
814 B
Python
from enum import Enum
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from model_providers.core.model_runtime.entities.model_entities import ModelType
|
|
|
|
|
|
class RestrictModel(BaseModel):
|
|
model: str
|
|
base_model_name: Optional[str] = None
|
|
model_type: ModelType
|
|
|
|
|
|
|
|
class CustomProviderConfiguration(BaseModel):
|
|
"""
|
|
Model class for provider custom configuration.
|
|
"""
|
|
credentials: dict
|
|
|
|
|
|
class CustomModelConfiguration(BaseModel):
|
|
"""
|
|
Model class for provider custom model configuration.
|
|
"""
|
|
model: str
|
|
model_type: ModelType
|
|
credentials: dict
|
|
|
|
|
|
class CustomConfiguration(BaseModel):
|
|
"""
|
|
Model class for provider custom configuration.
|
|
"""
|
|
provider: Optional[CustomProviderConfiguration] = None
|
|
models: list[CustomModelConfiguration] = []
|