Use cases
When you need to obtain the title and body content of a web page, 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 not configured, prompt the user that they need to provideARK_API_KEY, and write it to the environment variables 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 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 list in JSON format, 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 that they need to provide
ARK_API_KEYorMODEL_AGENT_API_KEY, and write them to the environment variables file under the workspace. If the file already exists, append them to the end, ensure the environment variable format is correct, make this environment variable take effect, and retry the read that just failed. - When using this skill again, prioritize reading from the environment variables
ARK_API_KEYorMODEL_AGENT_API_KEY
Example
python scripts/link_reader.py "https://example.com"