byted-link-reader

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

BytedLinkReader

BytedLinkReader

适用场景

Application Scenarios

当需要获取网页、PDF 或抖音视频的标题和正文内容时,使用该技能调用
link_reader
函数。
Use this skill to call the
link_reader
function when you need to obtain the title and body content of web pages, PDFs, or Douyin videos.

认证与凭据来源

Authentication and Credential Sources

  • 用户首次使用本技能时,先检查是否配置了
    ARK_API_KEY
    MODEL_AGENT_API_KEY
    环境变量,如未配置,提示用户需要提供
    ARK_API_KEY
    ,并把它写入到workspace下的环境变量文件中,如果文件已存在则追加到末尾,确保环境变量格式正确,使这个环境变量生效
  • 该技能默认使用
    ARK_API_KEY
    环境变量
  • 若未配置,将尝试使用
    MODEL_AGENT_API_KEY
    环境变量。
  • When a user uses this skill for the first time, first check if the
    ARK_API_KEY
    and
    MODEL_AGENT_API_KEY
    environment variables are configured. If not configured, prompt the user to provide
    ARK_API_KEY
    , and write it to the environment variable file under the workspace. If the file already exists, append it to the end, ensure the environment variable format is correct, and make this environment variable take effect.
  • This skill uses the
    ARK_API_KEY
    environment variable by default.
  • If not configured, it will try to use the
    MODEL_AGENT_API_KEY
    environment variable.

使用步骤

Usage Steps

  1. 准备 URL 列表。
  2. 运行脚本
    python scripts/link_reader.py "url1" "url2" ...
    。运行之前cd到对应的目录。
  3. 返回结果包含每个 URL 的标题和内容。
  1. Prepare a list of URLs.
  2. Run the script
    python scripts/link_reader.py "url1" "url2" ...
    . cd to the corresponding directory before running.
  3. The returned result includes the title and content corresponding to each URL.

输出格式

Output Format

  • JSON 格式的列表,每个元素包含 URL 对应的标题和内容。
  • A list in JSON format, where each element contains the title and content corresponding to the URL.

错误处理

Error Handling

  • 如果出现'PermissionError: ARK_API_KEY or MODEL_AGENT_API_KEY is not set in environment variables.'错误,则提示用户需要提供
    ARK_API_KEY
    MODEL_AGENT_API_KEY
    ,并把它们写入到workspace下的环境变量文件中,如果文件已存在则追加到末尾,确保环境变量格式正确,使这个环境变量生效,并重试刚才失败的读取。
  • 再次使用本技能时,优先从环境变量中读取
    ARK_API_KEY
    MODEL_AGENT_API_KEY
  • If the error 'PermissionError: ARK_API_KEY or MODEL_AGENT_API_KEY is not set in environment variables.' occurs, prompt the user to provide
    ARK_API_KEY
    or
    MODEL_AGENT_API_KEY
    , write them to the environment variable file under the workspace. If the file already exists, append it to the end, ensure the environment variable format is correct, make this environment variable take effect, and retry the failed read operation.
  • When using this skill again, prioritize reading
    ARK_API_KEY
    or
    MODEL_AGENT_API_KEY
    from environment variables.

示例

Example

bash
python scripts/link_reader.py "https://example.com"
bash
python scripts/link_reader.py "https://example.com"