Use cases
When you need to retrieve the title and body content of a webpage, PDF, or Douyin video, use this skill to call the link_reader function.
Authentication and credential sources
- When a user uses this skill for the first time, first check whether
ARK_API_KEYandMODEL_AGENT_API_KEYenvironment variables are configured. If they are not configured, prompt the user to provideARK_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_KEYenvironment variable by default - If it is not configured, it will try to use the
MODEL_AGENT_API_KEYenvironment variable.
Usage steps
- Prepare a URL list.
- Run the script
python scripts/link_reader.py "url1" "url2" .... Before running, cd to the corresponding directory. - The returned result contains the title and content of each URL.
Output format
- A JSON-formatted list, where each element contains the title and content corresponding to a URL.
Error handling
- 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_KEYorMODEL_AGENT_API_KEY, and write them to the environment variable file under the workspace. If the file already exists, append them to the end, ensure the environment variable format is correct, make these environment variables take effect, and retry the read that just failed. - When using this skill again, prioritize reading
ARK_API_KEYorMODEL_AGENT_API_KEY
Example
python scripts/link_reader.py "https://example.com"