Add CrewAI TinyFish integration#16
Open
pranavjana wants to merge 2 commits into
Open
Conversation
Adds the CrewAI TinyFish package with SDK-backed tools for web automation, queued runs, run lookup, run listing, web search, content fetch, and browser session creation. Uses tinyfish>=0.2.5, includes focused tests, and adds scoped CI.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/crew-ai-ci.yml (1)
35-39: ⚡ Quick winCI is missing the package build smoke test listed in the PR test plan.
Add
python -m buildso packaging issues are caught before merge.🔧 Proposed update
- - run: python -m pip install -e . -r requirements-dev.txt + - run: python -m pip install -e . -r requirements-dev.txt build @@ - run: make test + + - run: python -m build🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/crew-ai-ci.yml around lines 35 - 39, Add a packaging smoke test to the CI steps by inserting a run step that executes "python -m build" (so packaging errors fail the job) alongside the existing run steps that call "python -m pip install -e . -r requirements-dev.txt", "make lint", and "make test"; place the new "python -m build" run immediately after the pip install step (or before make test) to ensure the project can be built before running tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crew-ai/pyproject.toml`:
- Around line 6-9: The Python version constraint in requires-python is too low
for the tinyfish dependency; update the requires-python setting (the
requires-python = ">=3.10,<3.14" entry) to a range that includes Python 3.11
(for example raise the lower bound to >=3.11) so that tinyfish>=0.2.5 is
satisfiable; ensure the new upper bound still matches project compatibility
(e.g., ">=3.11,<3.14") and keep the dependency line "tinyfish>=0.2.5" unchanged.
In `@crew-ai/src/tinyfish_web_agent/tool.py`:
- Around line 118-121: The urls Field currently allows any list length but the
schema requires "one to ten URLs"; update the model to enforce this by using
pydantic constraints: either change the annotation to conlist(str, min_items=1,
max_items=10) and keep the Field description, or add min_items=1 and
max_items=10 to the existing Field(...) call for urls so the schema and runtime
validation match (refer to the urls Field definition to locate the change).
- Around line 425-427: The code currently reads runs via runs =
getattr(response, "runs", []) which breaks on tinyfish SDK v0.2.5+ where list
results are in response.data; update the handling in the function that calls
client.runs.list() (look for the variable response and the existing getattr
call) to first check for response.data (e.g., getattr(response, "data", None))
and fall back to response.runs for backward compatibility, and ensure the rest
of the logic uses that resolved list so the function no longer returns "No runs
found" incorrectly.
- Around line 232-236: The code constructs ProxyConfig with
ProxyCountryCode(self.proxy_country) inside _run_kwargs, which evaluates before
_safe_call and raises on invalid country codes; move the ProxyCountryCode
conversion into the try block inside _safe_call so invalid values are caught and
returned as a tool error. Specifically, in the method _run_kwargs, only set
kwargs["proxy_config"] with a placeholder or raw country string, and in the
_safe_call implementation (where exceptions are handled) perform
ProxyCountryCode(self.proxy_country) and then build ProxyConfig(enabled=True,
country_code=ProxyCountryCode(...)); ensure you validate against the allowed
codes (US, GB, CA, DE, FR, JP, AU) or catch ValueError from ProxyCountryCode and
return a controlled tool error instead of letting the exception propagate.
---
Nitpick comments:
In @.github/workflows/crew-ai-ci.yml:
- Around line 35-39: Add a packaging smoke test to the CI steps by inserting a
run step that executes "python -m build" (so packaging errors fail the job)
alongside the existing run steps that call "python -m pip install -e . -r
requirements-dev.txt", "make lint", and "make test"; place the new "python -m
build" run immediately after the pip install step (or before make test) to
ensure the project can be built before running tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 243e2ece-a73a-42a9-954e-9192b8b3f907
📒 Files selected for processing (9)
.github/workflows/crew-ai-ci.ymlcrew-ai/.gitignorecrew-ai/Makefilecrew-ai/README.mdcrew-ai/pyproject.tomlcrew-ai/requirements-dev.txtcrew-ai/src/tinyfish_web_agent/__init__.pycrew-ai/src/tinyfish_web_agent/tool.pycrew-ai/tests/test_tool.py
Align Python requirements with TinyFish SDK, enforce fetch URL bounds, handle invalid proxy countries, support SDK data responses, and add CI build coverage.
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.
Summary
Tests