byted-link-reader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBytedLinkReader
BytedLinkReader
适用场景
Application Scenarios
当需要获取网页、PDF 或抖音视频的标题和正文内容时,使用该技能调用 函数。
link_readerUse this skill to call the function when you need to obtain the title and body content of web pages, PDFs, or Douyin videos.
link_reader认证与凭据来源
Authentication and Credential Sources
- 用户首次使用本技能时,先检查是否配置了和
ARK_API_KEY环境变量,如未配置,提示用户需要提供MODEL_AGENT_API_KEY,并把它写入到workspace下的环境变量文件中,如果文件已存在则追加到末尾,确保环境变量格式正确,使这个环境变量生效ARK_API_KEY - 该技能默认使用 环境变量
ARK_API_KEY - 若未配置,将尝试使用 环境变量。
MODEL_AGENT_API_KEY
- When a user uses this skill for the first time, first check if the and
ARK_API_KEYenvironment variables are configured. If not configured, prompt the user to provideMODEL_AGENT_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.ARK_API_KEY - This skill uses the environment variable by default.
ARK_API_KEY - If not configured, it will try to use the environment variable.
MODEL_AGENT_API_KEY
使用步骤
Usage Steps
- 准备 URL 列表。
- 运行脚本 。运行之前cd到对应的目录。
python scripts/link_reader.py "url1" "url2" ... - 返回结果包含每个 URL 的标题和内容。
- Prepare a list of URLs.
- Run the script . cd to the corresponding directory before running.
python scripts/link_reader.py "url1" "url2" ... - 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,并把它们写入到workspace下的环境变量文件中,如果文件已存在则追加到末尾,确保环境变量格式正确,使这个环境变量生效,并重试刚才失败的读取。MODEL_AGENT_API_KEY - 再次使用本技能时,优先从环境变量中读取或
ARK_API_KEYMODEL_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 or
ARK_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.MODEL_AGENT_API_KEY - When using this skill again, prioritize reading or
ARK_API_KEYfrom environment variables.MODEL_AGENT_API_KEY
示例
Example
bash
python scripts/link_reader.py "https://example.com"bash
python scripts/link_reader.py "https://example.com"