Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/python-crewai/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
apify < 4.0.0
apify-client
langchain-apify < 1.0.0
crewai[tools] < 1.0.0
crewai[tools] < 2.0.0
9 changes: 6 additions & 3 deletions templates/python-crewai/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ async def main() -> None:
Raises:
ValueError: If the input is missing required attributes.
"""
# Disable crewAI tracing to prevent stdin read issues at shutdown
os.environ['CREWAI_TRACING_ENABLED'] = 'false'

async with Actor:
apify_token = os.getenv('APIFY_TOKEN')
if not apify_token:
Expand All @@ -39,10 +42,10 @@ async def main() -> None:
actor_input = await Actor.get_input()

query = actor_input.get('query')
model_name = actor_input.get('modelName', 'gpt-4o-mini')
if not query:
msg = 'Missing "query" attribute in input!'
raise ValueError(msg)
raise ValueError('Missing "query" attribute in input!')

model_name = actor_input.get('modelName', 'gpt-4o-mini')

# Create a toolkit for the agent
# containing the Instagram scraper tool
Expand Down
Loading