fa45d8aa5f
- health_checklist.json: 192.168.1.122→node122
- ocr_client.py: docstring IP→node122
- docs/market-data-requirements.md: IP→node122
- 所有API调用通过ProxyHandler({})绕过系统代理
Privoxy对node122:18003返回500,直连正常
32 lines
829 B
Python
32 lines
829 B
Python
"""
|
|
Credential table models.
|
|
|
|
These are the canonical credential types for the proxy. They live in the model
|
|
layer; ``litellm.types.utils`` re-exports them for backwards compatibility.
|
|
"""
|
|
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, model_validator
|
|
|
|
|
|
class CredentialBase(BaseModel):
|
|
credential_name: str
|
|
credential_info: dict
|
|
|
|
|
|
class CredentialItem(CredentialBase):
|
|
credential_values: dict
|
|
|
|
|
|
class CreateCredentialItem(CredentialBase):
|
|
credential_values: Optional[dict] = None
|
|
model_id: Optional[str] = None
|
|
|
|
@model_validator(mode="before")
|
|
@classmethod
|
|
def check_credential_params(cls, values):
|
|
if not values.get("credential_values") and not values.get("model_id"):
|
|
raise ValueError("Either credential_values or model_id must be set")
|
|
return values
|