mirror of
https://github.com/volcengine/OpenViking.git
synced 2026-10-01 01:38:07 +08:00
* refactor(client): remove Python embedded mode Consolidate Python consumers on the HTTP SDK while keeping shared server and storage capabilities unchanged. * refactor(client): remove obsolete embedded leftovers
27 lines
784 B
Python
27 lines
784 B
Python
# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
|
|
# SPDX-License-Identifier: AGPL-3.0
|
|
"""Shared add-resource parsing modes."""
|
|
|
|
from enum import Enum
|
|
from typing import Literal, TypeAlias
|
|
|
|
from openviking_cli.exceptions import InvalidArgumentError
|
|
|
|
|
|
class ParseMode(str, Enum):
|
|
"""Controls whether parsed Markdown is split into multiple files."""
|
|
|
|
DEFAULT = "default"
|
|
NO_SPLIT = "no_split"
|
|
|
|
|
|
ParseModeInput: TypeAlias = ParseMode | Literal["default", "no_split"]
|
|
|
|
|
|
def normalize_parse_mode(value: str | ParseMode) -> ParseMode:
|
|
"""Return a validated resource parsing mode."""
|
|
try:
|
|
return ParseMode(value)
|
|
except (TypeError, ValueError) as exc:
|
|
raise InvalidArgumentError("parse_mode must be one of: default, no_split.") from exc
|