Skip to content

Add feature: website-metadata-extractor#6

Open
arisha8809 wants to merge 1 commit into
data-artisans-centre:masterfrom
arisha8809:feature/website-metadata-extractor
Open

Add feature: website-metadata-extractor#6
arisha8809 wants to merge 1 commit into
data-artisans-centre:masterfrom
arisha8809:feature/website-metadata-extractor

Conversation

@arisha8809

Copy link
Copy Markdown

Add Website Metadata Extractor Agent
Summary:

This pull request introduces a new agent for extracting metadata from websites. The WebsiteMetadataAgent fetches and returns essential metadata for a given URL, including the title, description, and keywords (if available). This agent handles edge cases where metadata might be missing and ensures that meaningful default values are returned.

Key Features:

  1. Fetches metadata from the given website URL.
  2. Retrieves the title, meta description, and meta keywords.
  3. Handles missing metadata gracefully by returning default values.
  4. Implements a health_check method to verify the operational status of the agent by attempting to fetch metadata from a test URL.

Changes Made:

  1. Created the WebsiteMetadataAgent class under agents/website_metadata_extractor/.
  2. Implemented the execute method to fetch metadata from websites.
  3. Added the health_check method to test if the agent is functional.
  4. Added appropriate error handling for invalid URLs and failed requests.

Testing:

  1. Unit tests were added to ensure that the agent behaves correctly:
  2. Tests for successful metadata extraction.
  3. Tests for handling invalid URLs.
  4. Simulated network errors for health check failure scenarios.

How to Use:
Execute the agent via the PlugFlow CLI with the following parameters:

python main.py execute website-metadata-extractor --params '{"url": "https://example.com"}'

The agent will return the website metadata in the following format:
{
"Title": "Example Domain",
"Meta Description": "No description found",
"Meta Keywords": "No keywords found"
}

@kanishksaleria

Copy link
Copy Markdown
Collaborator

checks have failed please try to resolve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants