Skip to content

Add better Apify integration docs with more examples #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 6, 2025

Conversation

ohlava
Copy link
Contributor

@ohlava ohlava commented Mar 26, 2025

This edit is connected with an updated version of the actual implementation in the Agno main repository PR#2566.

Later we will follow with adding Agno implementation into the Apify docs as well.

@ohlava ohlava marked this pull request as draft March 26, 2025 20:35
@ohlava
Copy link
Contributor Author

ohlava commented Mar 28, 2025

Apify docs will be also updated to improve the integration apify/apify-docs#1511

Copy link
Contributor

@MQ37 MQ37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nit picks and personal opinions, otherwise LGTM 👍

Copy link
Contributor

@jirispilka jirispilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link the other PR (with code) in the PR description 🙏🏻

@ohlava can you please work on the @MQ37 comments and fix them

@ohlava
Copy link
Contributor Author

ohlava commented Apr 3, 2025

I tried to touch on all your feedback and everything should be resolved now or commented.

Copy link
Contributor

@jirispilka jirispilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor comments, We are good to go

@ohlava ohlava marked this pull request as ready for review April 3, 2025 15:28
@ohlava
Copy link
Contributor Author

ohlava commented Apr 17, 2025

@ysolanky It is all finished, can we merge please?

Related PRs to be also merged:
PR#2566 agno-agi
PR#1529 apify-docs
Both also ready.

@ohlava ohlava force-pushed the feat/apify-tools branch from 2c98497 to 7edcb1d Compare April 28, 2025 20:33
dirkbrnd added a commit to agno-agi/agno that referenced this pull request May 6, 2025
## Description

- **Summary of changes**: This PR refactors the ApifyTools class
replacing the previous custom implementation.
    - Implemented dynamic registration of any Apify Actor as a function
- Added support for multiple actors through a single ApifyTools instance
    - Added comprehensive error handling and logging
- Improved documentation with examples and configuration instructions
- **Related issues**: This update is connected with
[PR#183](agno-agi/agno-docs#183) in docs repo.
- **Motivation and context**: The previous implementation only supported
two hardcoded Apify actors (website-content-crawler and web-scraper).
The new implementation allows users to utilize any of the 4000+ actors
from the Apify ecosystem without modifying the core code. This
significantly expands the tool's capabilities for web data extraction
tasks.
- **Environment or dependencies**:
    -  langchain-apify: Required for ApifyActorsTool integration
    - apify-client: Required for direct API interactions
- Now requires an APIFY_API_TOKEN environment variable or explicit API
token parameter
- **Impact on metrics**: 
    - Increased flexibility with support for any Apify Actor
    - Improved documentation and error handling
- Reduced code maintenance burden by leveraging LangChain's Actor
interface
- Better user experience through expanded examples in the demo script

Fixes # (issue)

---

## Type of change

Please check the options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Model update (Addition or modification of models)
- [x] Other (please describe): Add better examples and start better
integration with Apify. This update is connected with PR#183 in docs
repo.

---

## Checklist

- [x] Adherence to standards: Code complies with Agno’s style guidelines
and best practices.
- [x] Formatting and validation: You have run `./scripts/format.sh` and
`./scripts/validate.sh` to ensure code is formatted and linted.
- [x] Self-review completed: A thorough review has been performed by the
contributor(s).
- [x] Documentation: Docstrings and comments have been added or updated
for any complex logic.
- [x] Examples and guides: Relevant cookbook examples have been included
or updated (if applicable).
- [x] Tested in a clean environment: Changes have been tested in a clean
environment to confirm expected behavior.
- [ ] Tests (optional): Tests have been added or updated to cover any
new or changed functionality.

---

## Additional Notes

Include any deployment notes, performance implications, security
considerations, or other relevant information (e.g., screenshots or logs
if applicable).

---------

Co-authored-by: Jakub Kopecký <[email protected]>
Co-authored-by: Jiří Spilka <[email protected]>
Co-authored-by: Priti <[email protected]>
Co-authored-by: Dirk Brand <[email protected]>
Co-authored-by: Ondřej Hlava <[email protected]>
@dirkbrnd dirkbrnd merged commit b8ecc28 into agno-agi:main May 6, 2025
Lockeysama pushed a commit to Entertech/agno that referenced this pull request May 9, 2025
## Description

- **Summary of changes**: This PR refactors the ApifyTools class
replacing the previous custom implementation.
    - Implemented dynamic registration of any Apify Actor as a function
- Added support for multiple actors through a single ApifyTools instance
    - Added comprehensive error handling and logging
- Improved documentation with examples and configuration instructions
- **Related issues**: This update is connected with
[PR#183](agno-agi/agno-docs#183) in docs repo.
- **Motivation and context**: The previous implementation only supported
two hardcoded Apify actors (website-content-crawler and web-scraper).
The new implementation allows users to utilize any of the 4000+ actors
from the Apify ecosystem without modifying the core code. This
significantly expands the tool's capabilities for web data extraction
tasks.
- **Environment or dependencies**:
    -  langchain-apify: Required for ApifyActorsTool integration
    - apify-client: Required for direct API interactions
- Now requires an APIFY_API_TOKEN environment variable or explicit API
token parameter
- **Impact on metrics**: 
    - Increased flexibility with support for any Apify Actor
    - Improved documentation and error handling
- Reduced code maintenance burden by leveraging LangChain's Actor
interface
- Better user experience through expanded examples in the demo script

Fixes # (issue)

---

## Type of change

Please check the options that are relevant:

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Model update (Addition or modification of models)
- [x] Other (please describe): Add better examples and start better
integration with Apify. This update is connected with PR#183 in docs
repo.

---

## Checklist

- [x] Adherence to standards: Code complies with Agno’s style guidelines
and best practices.
- [x] Formatting and validation: You have run `./scripts/format.sh` and
`./scripts/validate.sh` to ensure code is formatted and linted.
- [x] Self-review completed: A thorough review has been performed by the
contributor(s).
- [x] Documentation: Docstrings and comments have been added or updated
for any complex logic.
- [x] Examples and guides: Relevant cookbook examples have been included
or updated (if applicable).
- [x] Tested in a clean environment: Changes have been tested in a clean
environment to confirm expected behavior.
- [ ] Tests (optional): Tests have been added or updated to cover any
new or changed functionality.

---

## Additional Notes

Include any deployment notes, performance implications, security
considerations, or other relevant information (e.g., screenshots or logs
if applicable).

---------

Co-authored-by: Jakub Kopecký <[email protected]>
Co-authored-by: Jiří Spilka <[email protected]>
Co-authored-by: Priti <[email protected]>
Co-authored-by: Dirk Brand <[email protected]>
Co-authored-by: Ondřej Hlava <[email protected]>
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.

4 participants