Pydantic models for CLI configuration, including LLM providers and OAuth refs.
# Source: https://github.com/MoonshotAI/kimi-cli | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations
import json
from pathlib import Path
from typing import Literal, Self
import tomlkit
from pydantic import (
AliasChoices,
BaseModel,
Field,
SecretStr,
ValidationError,
field_serializer,
model_validator,
)
from tomlkit.exceptions import TOMLKitError
from kimi_cli.exception import ConfigError
from kimi_cli.hooks.config import HookDef
from kimi_cli.llm import ModelCapability, ProviderType
from kimi_cli.share import get_share_dir
from kimi_cli.utils.logging import logger
class OAuthRef(BaseModel):
"""Reference to OAuth
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key