feat: modernize langchain integration social tools#30
Draft
daveomri wants to merge 63 commits intofeat/modernize-langchain-integrationfrom
Draft
feat: modernize langchain integration social tools#30daveomri wants to merge 63 commits intofeat/modernize-langchain-integrationfrom
daveomri wants to merge 63 commits intofeat/modernize-langchain-integrationfrom
Conversation
…mline client handling and error management
…media tools for apify integration
…ms and message for empty dataset
…y tools to enforce safety constraints
…and maintability; update test cases for better formatting and error handling
…to apify_api_token
…eat/modernize-langchain-integration-social-tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third PR on
feat/modernize-langchain-integration. Depends on core tools and native components. Adds seven social media Actor tools.~545 lines of new code, ~570 lines of tests.
New tools (
_actor_tools.py)ApifyInstagramScraperToolapify/instagram-scraper;search_type:user,hashtag,post,comments; optional date filter viaonly_posts_newer_thanApifyLinkedInProfilePostsToolapimaestro/linkedin-profile-posts; takes a profile URL or usernameApifyLinkedInProfileSearchToolharvestapi/linkedin-profile-search; free-text keyword search over profilesApifyLinkedInProfileDetailToolapimaestro/linkedin-profile-detail; optionalinclude_emailApifyTwitterScraperToolapidojo/twitter-scraper-lite;search_mode:search,user,replies; optional ISO date boundsApifyTikTokScraperToolclockworks/tiktok-scraper;search_type:search,user,hashtagApifyFacebookPostsScraperToolapify/facebook-posts-scraper; public pages only; optional date filterAll seven subclass
_ApifyGenericTool:handle_tool_error=True,_clamp_timeout/_clamp_itemsceilings,APIFY_API_TOKENenv fallback, sync-only_run.ApifyToolsClientadditions (_client.py)Seven new methods
instagram_scrape,linkedin_profile_posts,linkedin_profile_search,linkedin_profile_detail,twitter_scrape,tiktok_scrape,facebook_posts_scraperun_actor_and_get_items+_list_items_or_raise.Exports (
__init__.py)APIFY_SOCIAL_TOOLSlist added alongsideAPIFY_CORE_TOOLSandAPIFY_ACTOR_TOOLS. Bind only the group(s) you need; loading all at once bloats the LLM context.No breaking changes. All additions are additive; existing
ApifyActorsTool,ApifyDatasetLoader, andApifyWrapperbehavior is unchanged.Tests
test_actor_tools.py(~330 lines): happy path, param mapping,max_resultsclamping,RuntimeError/ValueError->ToolException, empty results, parametrizedhandle_tool_errorcheck across all seven toolstest_client.py(~240 lines): input mapping for all seven new client methods, unsupported-modeValueErrorsSuggested reading order:
_client.py->_actor_tools.py->__init__.py→ testsMerge target:
feat/modernize-langchain-integration, notmain. Rebase after [#28](#28) and [#29](#29) land. Docs and notebooks follow in a separate PR.