from typing import Annotated, Literal # 从 typing 模块导入 Annotated 和 Literal
from pydantic import Field # 从 pydantic 模块导入 Field
URL = Annotated[
str, Field(description="需要抓取的网站 URL。")
]
RENDER = Annotated[
str,
Field(
description="代理配置选择器 (Unlocker为解锁器,其他值为普通代理)",
),
]
OUTPUT_FORMAT = Annotated[ # 定义一个名为 OUTPUT_FORMAT 的 Annotated 类型
Literal[ # 其基础类型为 Literal
"", # 允许空字符串
"links", # 允许 "links"
"Markdown", # 允许 "Markdown"
"html", # 允许 "html"
],
Field( # 并添加一个 Field
description=""" # 描述了输出的格式。
输出的格式。
- links - 你需要页面的链接或者导航时。
- Markdown - 你需要页面的为可读的MarkDown格式时。
- html - 你需要页面为纯HTML格式时。
"""
),
]
# IS_CATCH = Annotated[
# bool,
# Field(
# description="是否启用HTML缓存功能,默认为True启用缓存",
# default=True
# ),
# ]