agent-recipes 0.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_recipes/__init__.py +27 -0
- agent_recipes/recipe_runtime/__init__.py +28 -0
- agent_recipes/recipe_runtime/core.py +385 -0
- agent_recipes/templates/ai-ab-hook-tester/recipe.yaml +45 -0
- agent_recipes/templates/ai-ab-hook-tester/tools.py +169 -0
- agent_recipes/templates/ai-angle-generator/recipe.yaml +49 -0
- agent_recipes/templates/ai-angle-generator/tools.py +182 -0
- agent_recipes/templates/ai-api-doc-generator/README.md +59 -0
- agent_recipes/templates/ai-api-doc-generator/TEMPLATE.yaml +29 -0
- agent_recipes/templates/ai-api-tester/README.md +60 -0
- agent_recipes/templates/ai-api-tester/TEMPLATE.yaml +29 -0
- agent_recipes/templates/ai-audio-enhancer/README.md +59 -0
- agent_recipes/templates/ai-audio-enhancer/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-audio-normalizer/README.md +13 -0
- agent_recipes/templates/ai-audio-normalizer/TEMPLATE.yaml +44 -0
- agent_recipes/templates/ai-audio-splitter/README.md +14 -0
- agent_recipes/templates/ai-audio-splitter/TEMPLATE.yaml +47 -0
- agent_recipes/templates/ai-background-music-generator/README.md +59 -0
- agent_recipes/templates/ai-background-music-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-background-remover/README.md +60 -0
- agent_recipes/templates/ai-background-remover/TEMPLATE.yaml +27 -0
- agent_recipes/templates/ai-barcode-scanner/README.md +60 -0
- agent_recipes/templates/ai-barcode-scanner/TEMPLATE.yaml +26 -0
- agent_recipes/templates/ai-blog-generator/README.md +59 -0
- agent_recipes/templates/ai-blog-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-brief-generator/recipe.yaml +52 -0
- agent_recipes/templates/ai-brief-generator/tools.py +231 -0
- agent_recipes/templates/ai-broll-builder/recipe.yaml +47 -0
- agent_recipes/templates/ai-broll-builder/tools.py +204 -0
- agent_recipes/templates/ai-calendar-scheduler/README.md +60 -0
- agent_recipes/templates/ai-calendar-scheduler/TEMPLATE.yaml +29 -0
- agent_recipes/templates/ai-changelog-generator/README.md +14 -0
- agent_recipes/templates/ai-changelog-generator/TEMPLATE.yaml +46 -0
- agent_recipes/templates/ai-chart-generator/README.md +61 -0
- agent_recipes/templates/ai-chart-generator/TEMPLATE.yaml +32 -0
- agent_recipes/templates/ai-code-documenter/README.md +12 -0
- agent_recipes/templates/ai-code-documenter/TEMPLATE.yaml +37 -0
- agent_recipes/templates/ai-code-refactorer/README.md +59 -0
- agent_recipes/templates/ai-code-refactorer/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-code-reviewer/README.md +59 -0
- agent_recipes/templates/ai-code-reviewer/TEMPLATE.yaml +31 -0
- agent_recipes/templates/ai-color-palette-extractor/README.md +60 -0
- agent_recipes/templates/ai-color-palette-extractor/TEMPLATE.yaml +27 -0
- agent_recipes/templates/ai-comment-miner/recipe.yaml +40 -0
- agent_recipes/templates/ai-comment-miner/tools.py +141 -0
- agent_recipes/templates/ai-commit-message-generator/README.md +59 -0
- agent_recipes/templates/ai-commit-message-generator/TEMPLATE.yaml +31 -0
- agent_recipes/templates/ai-content-calendar/recipe.yaml +43 -0
- agent_recipes/templates/ai-content-calendar/tools.py +170 -0
- agent_recipes/templates/ai-context-enricher/recipe.yaml +48 -0
- agent_recipes/templates/ai-context-enricher/tools.py +258 -0
- agent_recipes/templates/ai-contract-analyzer/README.md +60 -0
- agent_recipes/templates/ai-contract-analyzer/TEMPLATE.yaml +34 -0
- agent_recipes/templates/ai-csv-cleaner/README.md +13 -0
- agent_recipes/templates/ai-csv-cleaner/TEMPLATE.yaml +45 -0
- agent_recipes/templates/ai-cta-generator/recipe.yaml +54 -0
- agent_recipes/templates/ai-cta-generator/tools.py +174 -0
- agent_recipes/templates/ai-daily-news-show/recipe.yaml +103 -0
- agent_recipes/templates/ai-daily-news-show/tools.py +308 -0
- agent_recipes/templates/ai-data-anonymizer/README.md +60 -0
- agent_recipes/templates/ai-data-anonymizer/TEMPLATE.yaml +31 -0
- agent_recipes/templates/ai-data-profiler/README.md +14 -0
- agent_recipes/templates/ai-data-profiler/TEMPLATE.yaml +42 -0
- agent_recipes/templates/ai-dependency-auditor/README.md +12 -0
- agent_recipes/templates/ai-dependency-auditor/TEMPLATE.yaml +37 -0
- agent_recipes/templates/ai-doc-translator/README.md +12 -0
- agent_recipes/templates/ai-doc-translator/TEMPLATE.yaml +41 -0
- agent_recipes/templates/ai-duplicate-finder/README.md +59 -0
- agent_recipes/templates/ai-duplicate-finder/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-ebook-converter/README.md +60 -0
- agent_recipes/templates/ai-ebook-converter/TEMPLATE.yaml +27 -0
- agent_recipes/templates/ai-email-parser/README.md +59 -0
- agent_recipes/templates/ai-email-parser/TEMPLATE.yaml +29 -0
- agent_recipes/templates/ai-etl-pipeline/README.md +60 -0
- agent_recipes/templates/ai-etl-pipeline/TEMPLATE.yaml +30 -0
- agent_recipes/templates/ai-excel-formula-generator/README.md +59 -0
- agent_recipes/templates/ai-excel-formula-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-face-blur/README.md +60 -0
- agent_recipes/templates/ai-face-blur/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-fact-checker/recipe.yaml +52 -0
- agent_recipes/templates/ai-fact-checker/tools.py +279 -0
- agent_recipes/templates/ai-faq-generator/README.md +59 -0
- agent_recipes/templates/ai-faq-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-file-organizer/README.md +59 -0
- agent_recipes/templates/ai-file-organizer/TEMPLATE.yaml +29 -0
- agent_recipes/templates/ai-folder-packager/README.md +15 -0
- agent_recipes/templates/ai-folder-packager/TEMPLATE.yaml +48 -0
- agent_recipes/templates/ai-form-filler/README.md +60 -0
- agent_recipes/templates/ai-form-filler/TEMPLATE.yaml +30 -0
- agent_recipes/templates/ai-hashtag-optimizer/recipe.yaml +45 -0
- agent_recipes/templates/ai-hashtag-optimizer/tools.py +134 -0
- agent_recipes/templates/ai-hook-generator/recipe.yaml +50 -0
- agent_recipes/templates/ai-hook-generator/tools.py +177 -0
- agent_recipes/templates/ai-image-captioner/README.md +59 -0
- agent_recipes/templates/ai-image-captioner/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-image-cataloger/README.md +13 -0
- agent_recipes/templates/ai-image-cataloger/TEMPLATE.yaml +39 -0
- agent_recipes/templates/ai-image-optimizer/README.md +13 -0
- agent_recipes/templates/ai-image-optimizer/TEMPLATE.yaml +43 -0
- agent_recipes/templates/ai-image-resizer/README.md +12 -0
- agent_recipes/templates/ai-image-resizer/TEMPLATE.yaml +39 -0
- agent_recipes/templates/ai-image-tagger/README.md +59 -0
- agent_recipes/templates/ai-image-tagger/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-image-upscaler/README.md +60 -0
- agent_recipes/templates/ai-image-upscaler/TEMPLATE.yaml +27 -0
- agent_recipes/templates/ai-invoice-processor/README.md +60 -0
- agent_recipes/templates/ai-invoice-processor/TEMPLATE.yaml +34 -0
- agent_recipes/templates/ai-json-to-csv/README.md +12 -0
- agent_recipes/templates/ai-json-to-csv/TEMPLATE.yaml +36 -0
- agent_recipes/templates/ai-log-analyzer/README.md +59 -0
- agent_recipes/templates/ai-log-analyzer/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-markdown-to-pdf/README.md +12 -0
- agent_recipes/templates/ai-markdown-to-pdf/TEMPLATE.yaml +40 -0
- agent_recipes/templates/ai-meeting-summarizer/README.md +59 -0
- agent_recipes/templates/ai-meeting-summarizer/TEMPLATE.yaml +32 -0
- agent_recipes/templates/ai-meta-tag-generator/README.md +59 -0
- agent_recipes/templates/ai-meta-tag-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-news-capture-pack/recipe.yaml +42 -0
- agent_recipes/templates/ai-news-capture-pack/tools.py +150 -0
- agent_recipes/templates/ai-news-crawler/recipe.yaml +99 -0
- agent_recipes/templates/ai-news-crawler/tools.py +417 -0
- agent_recipes/templates/ai-news-deduper/recipe.yaml +47 -0
- agent_recipes/templates/ai-news-deduper/tools.py +235 -0
- agent_recipes/templates/ai-newsletter-generator/README.md +59 -0
- agent_recipes/templates/ai-newsletter-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-note-summarizer/README.md +59 -0
- agent_recipes/templates/ai-note-summarizer/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-pdf-summarizer/README.md +12 -0
- agent_recipes/templates/ai-pdf-summarizer/TEMPLATE.yaml +40 -0
- agent_recipes/templates/ai-pdf-to-markdown/README.md +19 -0
- agent_recipes/templates/ai-pdf-to-markdown/TEMPLATE.yaml +63 -0
- agent_recipes/templates/ai-performance-analyzer/recipe.yaml +45 -0
- agent_recipes/templates/ai-performance-analyzer/tools.py +159 -0
- agent_recipes/templates/ai-podcast-cleaner/README.md +117 -0
- agent_recipes/templates/ai-podcast-cleaner/TEMPLATE.yaml +117 -0
- agent_recipes/templates/ai-podcast-cleaner/agents.yaml +59 -0
- agent_recipes/templates/ai-podcast-cleaner/workflow.yaml +77 -0
- agent_recipes/templates/ai-podcast-transcriber/README.md +59 -0
- agent_recipes/templates/ai-podcast-transcriber/TEMPLATE.yaml +32 -0
- agent_recipes/templates/ai-post-copy-generator/recipe.yaml +41 -0
- agent_recipes/templates/ai-post-copy-generator/tools.py +105 -0
- agent_recipes/templates/ai-product-description-generator/README.md +59 -0
- agent_recipes/templates/ai-product-description-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-publisher-pack/recipe.yaml +44 -0
- agent_recipes/templates/ai-publisher-pack/tools.py +252 -0
- agent_recipes/templates/ai-qr-code-generator/README.md +60 -0
- agent_recipes/templates/ai-qr-code-generator/TEMPLATE.yaml +26 -0
- agent_recipes/templates/ai-regex-generator/README.md +59 -0
- agent_recipes/templates/ai-regex-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-repo-readme/README.md +13 -0
- agent_recipes/templates/ai-repo-readme/TEMPLATE.yaml +42 -0
- agent_recipes/templates/ai-report-generator/README.md +61 -0
- agent_recipes/templates/ai-report-generator/TEMPLATE.yaml +32 -0
- agent_recipes/templates/ai-resume-parser/README.md +60 -0
- agent_recipes/templates/ai-resume-parser/TEMPLATE.yaml +33 -0
- agent_recipes/templates/ai-rss-aggregator/README.md +60 -0
- agent_recipes/templates/ai-rss-aggregator/TEMPLATE.yaml +30 -0
- agent_recipes/templates/ai-schema-generator/README.md +12 -0
- agent_recipes/templates/ai-schema-generator/TEMPLATE.yaml +34 -0
- agent_recipes/templates/ai-screen-recorder/recipe.yaml +43 -0
- agent_recipes/templates/ai-screen-recorder/tools.py +184 -0
- agent_recipes/templates/ai-screenshot-capture/recipe.yaml +45 -0
- agent_recipes/templates/ai-screenshot-capture/tools.py +231 -0
- agent_recipes/templates/ai-screenshot-ocr/README.md +12 -0
- agent_recipes/templates/ai-screenshot-ocr/TEMPLATE.yaml +37 -0
- agent_recipes/templates/ai-script-writer/recipe.yaml +58 -0
- agent_recipes/templates/ai-script-writer/tools.py +297 -0
- agent_recipes/templates/ai-sentiment-analyzer/README.md +59 -0
- agent_recipes/templates/ai-sentiment-analyzer/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-seo-optimizer/README.md +59 -0
- agent_recipes/templates/ai-seo-optimizer/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-signal-ranker/recipe.yaml +54 -0
- agent_recipes/templates/ai-signal-ranker/tools.py +256 -0
- agent_recipes/templates/ai-sitemap-generator/README.md +59 -0
- agent_recipes/templates/ai-sitemap-generator/TEMPLATE.yaml +26 -0
- agent_recipes/templates/ai-sitemap-scraper/README.md +13 -0
- agent_recipes/templates/ai-sitemap-scraper/TEMPLATE.yaml +41 -0
- agent_recipes/templates/ai-slide-generator/README.md +60 -0
- agent_recipes/templates/ai-slide-generator/TEMPLATE.yaml +29 -0
- agent_recipes/templates/ai-slide-to-notes/README.md +12 -0
- agent_recipes/templates/ai-slide-to-notes/TEMPLATE.yaml +37 -0
- agent_recipes/templates/ai-social-media-generator/README.md +59 -0
- agent_recipes/templates/ai-social-media-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-sql-generator/README.md +59 -0
- agent_recipes/templates/ai-sql-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-subtitle-generator/README.md +59 -0
- agent_recipes/templates/ai-subtitle-generator/TEMPLATE.yaml +31 -0
- agent_recipes/templates/ai-test-generator/README.md +59 -0
- agent_recipes/templates/ai-test-generator/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-translation-batch/README.md +59 -0
- agent_recipes/templates/ai-translation-batch/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-url-to-markdown/README.md +14 -0
- agent_recipes/templates/ai-url-to-markdown/TEMPLATE.yaml +44 -0
- agent_recipes/templates/ai-video-chapter-generator/README.md +59 -0
- agent_recipes/templates/ai-video-chapter-generator/TEMPLATE.yaml +32 -0
- agent_recipes/templates/ai-video-compressor/README.md +59 -0
- agent_recipes/templates/ai-video-compressor/TEMPLATE.yaml +28 -0
- agent_recipes/templates/ai-video-editor/README.md +254 -0
- agent_recipes/templates/ai-video-editor/TEMPLATE.yaml +139 -0
- agent_recipes/templates/ai-video-editor/agents.yaml +36 -0
- agent_recipes/templates/ai-video-editor/requirements.txt +8 -0
- agent_recipes/templates/ai-video-editor/scripts/run.sh +10 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__init__.py +45 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__main__.py +8 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/__init__.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/cli.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/config.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/ffmpeg_probe.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/heuristics.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/llm_plan.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/models.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/pipeline.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/render.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/timeline.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/transcribe.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/__pycache__/utils.cpython-312.pyc +0 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/cli.py +343 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/config.py +102 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/ffmpeg_probe.py +92 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/heuristics.py +119 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/llm_plan.py +277 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/models.py +343 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/pipeline.py +287 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/render.py +274 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/timeline.py +278 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/transcribe.py +233 -0
- agent_recipes/templates/ai-video-editor/src/ai_video_editor/utils.py +222 -0
- agent_recipes/templates/ai-video-editor/src/input.mov +0 -0
- agent_recipes/templates/ai-video-editor/src/out.mp4 +0 -0
- agent_recipes/templates/ai-video-editor/tests/test_heuristics.py +130 -0
- agent_recipes/templates/ai-video-editor/tests/test_models.py +152 -0
- agent_recipes/templates/ai-video-editor/tests/test_timeline.py +105 -0
- agent_recipes/templates/ai-video-editor/workflow.yaml +51 -0
- agent_recipes/templates/ai-video-highlight-extractor/README.md +60 -0
- agent_recipes/templates/ai-video-highlight-extractor/TEMPLATE.yaml +33 -0
- agent_recipes/templates/ai-video-merger/recipe.yaml +40 -0
- agent_recipes/templates/ai-video-merger/tools.py +172 -0
- agent_recipes/templates/ai-video-thumbnails/README.md +16 -0
- agent_recipes/templates/ai-video-thumbnails/TEMPLATE.yaml +53 -0
- agent_recipes/templates/ai-video-to-gif/README.md +14 -0
- agent_recipes/templates/ai-video-to-gif/TEMPLATE.yaml +64 -0
- agent_recipes/templates/ai-voice-cloner/README.md +59 -0
- agent_recipes/templates/ai-voice-cloner/TEMPLATE.yaml +31 -0
- agent_recipes/templates/ai-voiceover-generator/recipe.yaml +41 -0
- agent_recipes/templates/ai-voiceover-generator/tools.py +194 -0
- agent_recipes/templates/ai-watermark-adder/README.md +59 -0
- agent_recipes/templates/ai-watermark-adder/TEMPLATE.yaml +26 -0
- agent_recipes/templates/ai-watermark-remover/README.md +60 -0
- agent_recipes/templates/ai-watermark-remover/TEMPLATE.yaml +32 -0
- agent_recipes/templates/data-transformer/README.md +75 -0
- agent_recipes/templates/data-transformer/TEMPLATE.yaml +63 -0
- agent_recipes/templates/data-transformer/agents.yaml +70 -0
- agent_recipes/templates/data-transformer/workflow.yaml +92 -0
- agent_recipes/templates/shorts-generator/README.md +61 -0
- agent_recipes/templates/shorts-generator/TEMPLATE.yaml +65 -0
- agent_recipes/templates/shorts-generator/agents.yaml +66 -0
- agent_recipes/templates/shorts-generator/workflow.yaml +86 -0
- agent_recipes/templates/transcript-generator/README.md +103 -0
- agent_recipes/templates/transcript-generator/TEMPLATE.yaml +57 -0
- agent_recipes/templates/transcript-generator/agents.yaml +62 -0
- agent_recipes/templates/transcript-generator/workflow.yaml +82 -0
- agent_recipes/templates/video-editor/README.md +70 -0
- agent_recipes/templates/video-editor/TEMPLATE.yaml +55 -0
- agent_recipes/templates/video-editor/agents.yaml +68 -0
- agent_recipes/templates/video-editor/workflow.yaml +92 -0
- agent_recipes-0.0.5.dist-info/METADATA +145 -0
- agent_recipes-0.0.5.dist-info/RECORD +269 -0
- agent_recipes-0.0.5.dist-info/WHEEL +5 -0
- agent_recipes-0.0.5.dist-info/top_level.txt +1 -0
- /236/326/177nE/243/231/214/232/265/322m/201/253/353/022C/372/321/266/b/225^=/272/017t/262/3337/310@/315wb/341pB/277z/216/330/314/004/265B/213/375/236/203/026/373/307/354z41/347#/374q/262/22589/032/276 /277/244Vh/322/017/004/224/215/004/367/377/375/335/n +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AI Screenshot Capture Tools
|
|
3
|
+
|
|
4
|
+
High-resolution screenshot capture with:
|
|
5
|
+
- Full page capture
|
|
6
|
+
- Element highlighting
|
|
7
|
+
- Auto-scroll
|
|
8
|
+
- Multiple format support
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import logging
|
|
12
|
+
import os
|
|
13
|
+
from datetime import datetime, timezone
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any, Dict, List, Optional
|
|
16
|
+
|
|
17
|
+
logger = logging.getLogger(__name__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def capture_screenshot(
|
|
21
|
+
url: str,
|
|
22
|
+
output_path: Optional[str] = None,
|
|
23
|
+
width: int = 1920,
|
|
24
|
+
height: int = 1080,
|
|
25
|
+
full_page: bool = False,
|
|
26
|
+
quality: int = 95,
|
|
27
|
+
) -> Dict[str, Any]:
|
|
28
|
+
"""
|
|
29
|
+
Capture a screenshot of a URL.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
url: URL to capture
|
|
33
|
+
output_path: Path to save screenshot
|
|
34
|
+
width: Viewport width
|
|
35
|
+
height: Viewport height
|
|
36
|
+
full_page: Capture full page
|
|
37
|
+
quality: Image quality (1-100)
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
Dictionary with screenshot info
|
|
41
|
+
"""
|
|
42
|
+
try:
|
|
43
|
+
from playwright.sync_api import sync_playwright
|
|
44
|
+
except ImportError:
|
|
45
|
+
logger.error("Playwright not installed. Run: pip install playwright && playwright install")
|
|
46
|
+
return {"error": "Playwright not installed"}
|
|
47
|
+
|
|
48
|
+
if not output_path:
|
|
49
|
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
50
|
+
output_path = f"screenshot_{timestamp}.png"
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
with sync_playwright() as p:
|
|
54
|
+
browser = p.chromium.launch(headless=True)
|
|
55
|
+
page = browser.new_page(viewport={"width": width, "height": height})
|
|
56
|
+
page.goto(url, wait_until="networkidle")
|
|
57
|
+
|
|
58
|
+
page.screenshot(
|
|
59
|
+
path=output_path,
|
|
60
|
+
full_page=full_page,
|
|
61
|
+
quality=quality if output_path.endswith(".jpg") else None,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
browser.close()
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
"path": output_path,
|
|
68
|
+
"url": url,
|
|
69
|
+
"width": width,
|
|
70
|
+
"height": height,
|
|
71
|
+
"full_page": full_page,
|
|
72
|
+
"captured_at": datetime.now(timezone.utc).isoformat(),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
except Exception as e:
|
|
76
|
+
logger.error(f"Error capturing screenshot: {e}")
|
|
77
|
+
return {"error": str(e)}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def capture_full_page(
|
|
81
|
+
url: str,
|
|
82
|
+
output_dir: Optional[str] = None,
|
|
83
|
+
scroll_delay: float = 0.5,
|
|
84
|
+
) -> Dict[str, Any]:
|
|
85
|
+
"""
|
|
86
|
+
Capture full page with auto-scroll.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
url: URL to capture
|
|
90
|
+
output_dir: Directory to save screenshots
|
|
91
|
+
scroll_delay: Delay between scrolls
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
Dictionary with capture info
|
|
95
|
+
"""
|
|
96
|
+
output_dir = output_dir or "./screenshots"
|
|
97
|
+
Path(output_dir).mkdir(parents=True, exist_ok=True)
|
|
98
|
+
|
|
99
|
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
100
|
+
output_path = os.path.join(output_dir, f"fullpage_{timestamp}.png")
|
|
101
|
+
|
|
102
|
+
return capture_screenshot(url, output_path, full_page=True)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def highlight_and_capture(
|
|
106
|
+
url: str,
|
|
107
|
+
selectors: List[str],
|
|
108
|
+
output_dir: Optional[str] = None,
|
|
109
|
+
highlight_color: str = "yellow",
|
|
110
|
+
) -> Dict[str, Any]:
|
|
111
|
+
"""
|
|
112
|
+
Highlight elements and capture screenshots.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
url: URL to capture
|
|
116
|
+
selectors: CSS selectors to highlight
|
|
117
|
+
output_dir: Directory to save screenshots
|
|
118
|
+
highlight_color: Highlight color
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
Dictionary with captures
|
|
122
|
+
"""
|
|
123
|
+
try:
|
|
124
|
+
from playwright.sync_api import sync_playwright
|
|
125
|
+
except ImportError:
|
|
126
|
+
return {"error": "Playwright not installed"}
|
|
127
|
+
|
|
128
|
+
output_dir = output_dir or "./screenshots"
|
|
129
|
+
Path(output_dir).mkdir(parents=True, exist_ok=True)
|
|
130
|
+
|
|
131
|
+
captures = []
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
with sync_playwright() as p:
|
|
135
|
+
browser = p.chromium.launch(headless=True)
|
|
136
|
+
page = browser.new_page(viewport={"width": 1920, "height": 1080})
|
|
137
|
+
page.goto(url, wait_until="networkidle")
|
|
138
|
+
|
|
139
|
+
for i, selector in enumerate(selectors):
|
|
140
|
+
try:
|
|
141
|
+
# Add highlight style
|
|
142
|
+
page.evaluate(f"""
|
|
143
|
+
const el = document.querySelector('{selector}');
|
|
144
|
+
if (el) {{
|
|
145
|
+
el.style.backgroundColor = '{highlight_color}';
|
|
146
|
+
el.style.outline = '3px solid red';
|
|
147
|
+
}}
|
|
148
|
+
""")
|
|
149
|
+
|
|
150
|
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
151
|
+
output_path = os.path.join(output_dir, f"highlight_{i}_{timestamp}.png")
|
|
152
|
+
|
|
153
|
+
page.screenshot(path=output_path)
|
|
154
|
+
|
|
155
|
+
captures.append({
|
|
156
|
+
"path": output_path,
|
|
157
|
+
"selector": selector,
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
# Remove highlight
|
|
161
|
+
page.evaluate(f"""
|
|
162
|
+
const el = document.querySelector('{selector}');
|
|
163
|
+
if (el) {{
|
|
164
|
+
el.style.backgroundColor = '';
|
|
165
|
+
el.style.outline = '';
|
|
166
|
+
}}
|
|
167
|
+
""")
|
|
168
|
+
|
|
169
|
+
except Exception as e:
|
|
170
|
+
logger.warning(f"Error highlighting {selector}: {e}")
|
|
171
|
+
|
|
172
|
+
browser.close()
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
"captures": captures,
|
|
176
|
+
"url": url,
|
|
177
|
+
"total": len(captures),
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
except Exception as e:
|
|
181
|
+
logger.error(f"Error in highlight capture: {e}")
|
|
182
|
+
return {"error": str(e)}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def bundle_captures(
|
|
186
|
+
captures: List[Dict[str, Any]],
|
|
187
|
+
output_dir: str,
|
|
188
|
+
bundle_name: str = "capture_pack",
|
|
189
|
+
) -> Dict[str, Any]:
|
|
190
|
+
"""
|
|
191
|
+
Bundle multiple captures into a pack.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
captures: List of capture dictionaries
|
|
195
|
+
output_dir: Output directory
|
|
196
|
+
bundle_name: Name for the bundle
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
Bundle info
|
|
200
|
+
"""
|
|
201
|
+
import json
|
|
202
|
+
import shutil
|
|
203
|
+
|
|
204
|
+
bundle_dir = os.path.join(output_dir, bundle_name)
|
|
205
|
+
Path(bundle_dir).mkdir(parents=True, exist_ok=True)
|
|
206
|
+
|
|
207
|
+
manifest = {
|
|
208
|
+
"name": bundle_name,
|
|
209
|
+
"created_at": datetime.now(timezone.utc).isoformat(),
|
|
210
|
+
"files": [],
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
for capture in captures:
|
|
214
|
+
if "path" in capture and os.path.exists(capture["path"]):
|
|
215
|
+
filename = os.path.basename(capture["path"])
|
|
216
|
+
dest = os.path.join(bundle_dir, filename)
|
|
217
|
+
shutil.copy2(capture["path"], dest)
|
|
218
|
+
manifest["files"].append({
|
|
219
|
+
"filename": filename,
|
|
220
|
+
"original": capture.get("url", ""),
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
manifest_path = os.path.join(bundle_dir, "manifest.json")
|
|
224
|
+
with open(manifest_path, "w") as f:
|
|
225
|
+
json.dump(manifest, f, indent=2)
|
|
226
|
+
|
|
227
|
+
return {
|
|
228
|
+
"bundle_dir": bundle_dir,
|
|
229
|
+
"manifest": manifest,
|
|
230
|
+
"file_count": len(manifest["files"]),
|
|
231
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: ai-screenshot-ocr
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Extract text from screenshots using OCR.
|
|
4
|
+
author: praisonai
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
tags: [screenshot, ocr, text-extraction]
|
|
7
|
+
|
|
8
|
+
requires:
|
|
9
|
+
tools: [shell_tool]
|
|
10
|
+
packages: [praisonai-tools]
|
|
11
|
+
env: [OPENAI_API_KEY]
|
|
12
|
+
|
|
13
|
+
config:
|
|
14
|
+
input:
|
|
15
|
+
type: string
|
|
16
|
+
required: true
|
|
17
|
+
output:
|
|
18
|
+
type: string
|
|
19
|
+
|
|
20
|
+
cli:
|
|
21
|
+
command: ai-screenshot-ocr
|
|
22
|
+
args:
|
|
23
|
+
- name: input
|
|
24
|
+
positional: true
|
|
25
|
+
required: true
|
|
26
|
+
- name: --output
|
|
27
|
+
short: -o
|
|
28
|
+
examples:
|
|
29
|
+
- "praison run ai-screenshot-ocr screenshot.png"
|
|
30
|
+
|
|
31
|
+
outputs:
|
|
32
|
+
- name: extracted-text.md
|
|
33
|
+
type: file
|
|
34
|
+
- name: structured.json
|
|
35
|
+
type: file
|
|
36
|
+
- name: run.json
|
|
37
|
+
type: file
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: ai-script-writer
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Multi-format script writer for YouTube long/short, X threads, LinkedIn posts, and image captions
|
|
4
|
+
author: PraisonAI
|
|
5
|
+
tags:
|
|
6
|
+
- script
|
|
7
|
+
- content
|
|
8
|
+
- youtube
|
|
9
|
+
- social-media
|
|
10
|
+
|
|
11
|
+
config:
|
|
12
|
+
formats:
|
|
13
|
+
- youtube_long
|
|
14
|
+
- youtube_short
|
|
15
|
+
- x_thread
|
|
16
|
+
- linkedin
|
|
17
|
+
- image_caption
|
|
18
|
+
- hook_30s
|
|
19
|
+
default_tone: educational
|
|
20
|
+
include_timestamps: true
|
|
21
|
+
|
|
22
|
+
input:
|
|
23
|
+
type: object
|
|
24
|
+
properties:
|
|
25
|
+
topic:
|
|
26
|
+
type: string
|
|
27
|
+
format:
|
|
28
|
+
type: string
|
|
29
|
+
enum: [youtube_long, youtube_short, x_thread, linkedin, image_caption, hook_30s]
|
|
30
|
+
target_length:
|
|
31
|
+
type: integer
|
|
32
|
+
tone:
|
|
33
|
+
type: string
|
|
34
|
+
key_points:
|
|
35
|
+
type: array
|
|
36
|
+
|
|
37
|
+
output:
|
|
38
|
+
type: object
|
|
39
|
+
properties:
|
|
40
|
+
script:
|
|
41
|
+
type: string
|
|
42
|
+
metadata:
|
|
43
|
+
type: object
|
|
44
|
+
|
|
45
|
+
requires:
|
|
46
|
+
env:
|
|
47
|
+
- OPENAI_API_KEY
|
|
48
|
+
|
|
49
|
+
workflow:
|
|
50
|
+
agents:
|
|
51
|
+
- name: script_writer
|
|
52
|
+
role: Content Script Writer
|
|
53
|
+
goal: Create engaging scripts for multiple platforms
|
|
54
|
+
tools:
|
|
55
|
+
- write_youtube_script
|
|
56
|
+
- write_short_script
|
|
57
|
+
- write_thread
|
|
58
|
+
- write_linkedin_post
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AI Script Writer Tools
|
|
3
|
+
|
|
4
|
+
Multi-format script generation for:
|
|
5
|
+
- YouTube long-form (10+ min)
|
|
6
|
+
- YouTube Shorts (60s)
|
|
7
|
+
- 30-second hooks
|
|
8
|
+
- X/Twitter threads
|
|
9
|
+
- LinkedIn posts
|
|
10
|
+
- Image captions
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import logging
|
|
14
|
+
import os
|
|
15
|
+
from typing import Any, Dict, List, Optional
|
|
16
|
+
|
|
17
|
+
logger = logging.getLogger(__name__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def call_llm(prompt: str, max_tokens: int = 2000) -> str:
|
|
21
|
+
"""Call OpenAI API for text generation."""
|
|
22
|
+
import requests
|
|
23
|
+
|
|
24
|
+
api_key = os.environ.get("OPENAI_API_KEY")
|
|
25
|
+
if not api_key:
|
|
26
|
+
raise ValueError("OPENAI_API_KEY not set")
|
|
27
|
+
|
|
28
|
+
response = requests.post(
|
|
29
|
+
"https://api.openai.com/v1/chat/completions",
|
|
30
|
+
headers={
|
|
31
|
+
"Authorization": f"Bearer {api_key}",
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
},
|
|
34
|
+
json={
|
|
35
|
+
"model": "gpt-4o-mini",
|
|
36
|
+
"messages": [{"role": "user", "content": prompt}],
|
|
37
|
+
"max_tokens": max_tokens,
|
|
38
|
+
"temperature": 0.8,
|
|
39
|
+
},
|
|
40
|
+
timeout=120,
|
|
41
|
+
)
|
|
42
|
+
response.raise_for_status()
|
|
43
|
+
return response.json()["choices"][0]["message"]["content"]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def write_youtube_script(
|
|
47
|
+
topic: str,
|
|
48
|
+
target_length: int = 600,
|
|
49
|
+
tone: str = "educational",
|
|
50
|
+
key_points: Optional[List[str]] = None,
|
|
51
|
+
include_timestamps: bool = True,
|
|
52
|
+
) -> Dict[str, Any]:
|
|
53
|
+
"""
|
|
54
|
+
Write a YouTube long-form video script.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
topic: Video topic
|
|
58
|
+
target_length: Target length in seconds
|
|
59
|
+
tone: Script tone (educational, entertaining, professional)
|
|
60
|
+
key_points: Key points to cover
|
|
61
|
+
include_timestamps: Include timestamp markers
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
Script with metadata
|
|
65
|
+
"""
|
|
66
|
+
key_points_text = "\n".join(f"- {p}" for p in (key_points or []))
|
|
67
|
+
|
|
68
|
+
prompt = f"""Write a YouTube video script about: {topic}
|
|
69
|
+
|
|
70
|
+
Target length: {target_length} seconds (~{target_length // 60} minutes)
|
|
71
|
+
Tone: {tone}
|
|
72
|
+
Key points to cover:
|
|
73
|
+
{key_points_text if key_points_text else "- Cover the main aspects of the topic"}
|
|
74
|
+
|
|
75
|
+
Structure the script with:
|
|
76
|
+
1. Hook (first 10 seconds) - grab attention immediately
|
|
77
|
+
2. Introduction - what viewers will learn
|
|
78
|
+
3. Main content - organized sections with clear transitions
|
|
79
|
+
4. Call to action - subscribe, comment, etc.
|
|
80
|
+
5. Outro
|
|
81
|
+
|
|
82
|
+
{"Include [TIMESTAMP: MM:SS] markers for each section." if include_timestamps else ""}
|
|
83
|
+
|
|
84
|
+
Write in a conversational, engaging style suitable for YouTube."""
|
|
85
|
+
|
|
86
|
+
script = call_llm(prompt, max_tokens=3000)
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
"script": script,
|
|
90
|
+
"format": "youtube_long",
|
|
91
|
+
"metadata": {
|
|
92
|
+
"topic": topic,
|
|
93
|
+
"target_length": target_length,
|
|
94
|
+
"tone": tone,
|
|
95
|
+
"word_count": len(script.split()),
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def write_short_script(
|
|
101
|
+
topic: str,
|
|
102
|
+
duration: int = 60,
|
|
103
|
+
style: str = "hook_first",
|
|
104
|
+
) -> Dict[str, Any]:
|
|
105
|
+
"""
|
|
106
|
+
Write a YouTube Shorts / TikTok / Reels script.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
topic: Video topic
|
|
110
|
+
duration: Duration in seconds (30 or 60)
|
|
111
|
+
style: Script style (hook_first, story, listicle)
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
Script with metadata
|
|
115
|
+
"""
|
|
116
|
+
prompt = f"""Write a {duration}-second short-form video script about: {topic}
|
|
117
|
+
|
|
118
|
+
Style: {style}
|
|
119
|
+
Platform: YouTube Shorts / TikTok / Reels
|
|
120
|
+
|
|
121
|
+
Requirements:
|
|
122
|
+
- Start with an attention-grabbing hook (first 2 seconds)
|
|
123
|
+
- Keep it punchy and fast-paced
|
|
124
|
+
- One clear message or takeaway
|
|
125
|
+
- End with a call to action or cliffhanger
|
|
126
|
+
|
|
127
|
+
Format:
|
|
128
|
+
[HOOK - 0:00]
|
|
129
|
+
(script)
|
|
130
|
+
|
|
131
|
+
[MAIN - 0:03]
|
|
132
|
+
(script)
|
|
133
|
+
|
|
134
|
+
[CTA - 0:{duration-5}]
|
|
135
|
+
(script)"""
|
|
136
|
+
|
|
137
|
+
script = call_llm(prompt, max_tokens=500)
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
"script": script,
|
|
141
|
+
"format": "youtube_short",
|
|
142
|
+
"metadata": {
|
|
143
|
+
"topic": topic,
|
|
144
|
+
"duration": duration,
|
|
145
|
+
"style": style,
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def write_thread(
|
|
151
|
+
topic: str,
|
|
152
|
+
num_tweets: int = 7,
|
|
153
|
+
include_hook: bool = True,
|
|
154
|
+
) -> Dict[str, Any]:
|
|
155
|
+
"""
|
|
156
|
+
Write an X/Twitter thread.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
topic: Thread topic
|
|
160
|
+
num_tweets: Number of tweets in thread
|
|
161
|
+
include_hook: Include a hook tweet
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Thread with metadata
|
|
165
|
+
"""
|
|
166
|
+
prompt = f"""Write a Twitter/X thread about: {topic}
|
|
167
|
+
|
|
168
|
+
Number of tweets: {num_tweets}
|
|
169
|
+
|
|
170
|
+
Requirements:
|
|
171
|
+
- Tweet 1: Strong hook that makes people want to read more
|
|
172
|
+
- Each tweet: Max 280 characters
|
|
173
|
+
- Use thread numbering (1/, 2/, etc.)
|
|
174
|
+
- Include a mix of insights, examples, and actionable tips
|
|
175
|
+
- Last tweet: Call to action (follow, retweet, etc.)
|
|
176
|
+
|
|
177
|
+
Format each tweet on its own line with the number prefix."""
|
|
178
|
+
|
|
179
|
+
script = call_llm(prompt, max_tokens=1500)
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
"script": script,
|
|
183
|
+
"format": "x_thread",
|
|
184
|
+
"metadata": {
|
|
185
|
+
"topic": topic,
|
|
186
|
+
"num_tweets": num_tweets,
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def write_linkedin_post(
|
|
192
|
+
topic: str,
|
|
193
|
+
style: str = "thought_leadership",
|
|
194
|
+
include_emoji: bool = True,
|
|
195
|
+
) -> Dict[str, Any]:
|
|
196
|
+
"""
|
|
197
|
+
Write a LinkedIn post.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
topic: Post topic
|
|
201
|
+
style: Post style (thought_leadership, story, tips, announcement)
|
|
202
|
+
include_emoji: Include emojis
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
Post with metadata
|
|
206
|
+
"""
|
|
207
|
+
prompt = f"""Write a LinkedIn post about: {topic}
|
|
208
|
+
|
|
209
|
+
Style: {style}
|
|
210
|
+
{"Include relevant emojis to break up text and add visual interest." if include_emoji else "No emojis."}
|
|
211
|
+
|
|
212
|
+
Requirements:
|
|
213
|
+
- Strong opening line (this shows in preview)
|
|
214
|
+
- Use line breaks for readability
|
|
215
|
+
- Include a personal angle or story
|
|
216
|
+
- End with a question to drive engagement
|
|
217
|
+
- Keep under 1300 characters for optimal engagement
|
|
218
|
+
|
|
219
|
+
Format for LinkedIn (short paragraphs, line breaks between sections)."""
|
|
220
|
+
|
|
221
|
+
script = call_llm(prompt, max_tokens=800)
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
"script": script,
|
|
225
|
+
"format": "linkedin",
|
|
226
|
+
"metadata": {
|
|
227
|
+
"topic": topic,
|
|
228
|
+
"style": style,
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def write_image_caption(
|
|
234
|
+
topic: str,
|
|
235
|
+
platform: str = "instagram",
|
|
236
|
+
include_hashtags: bool = True,
|
|
237
|
+
) -> Dict[str, Any]:
|
|
238
|
+
"""
|
|
239
|
+
Write an image caption for social media.
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
topic: Caption topic/context
|
|
243
|
+
platform: Target platform
|
|
244
|
+
include_hashtags: Include hashtags
|
|
245
|
+
|
|
246
|
+
Returns:
|
|
247
|
+
Caption with metadata
|
|
248
|
+
"""
|
|
249
|
+
prompt = f"""Write a {platform} image caption about: {topic}
|
|
250
|
+
|
|
251
|
+
Requirements:
|
|
252
|
+
- Engaging first line (shows in preview)
|
|
253
|
+
- Conversational tone
|
|
254
|
+
- Call to action
|
|
255
|
+
{"- Include 5-10 relevant hashtags at the end" if include_hashtags else ""}
|
|
256
|
+
|
|
257
|
+
Keep it concise but engaging."""
|
|
258
|
+
|
|
259
|
+
script = call_llm(prompt, max_tokens=300)
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
"script": script,
|
|
263
|
+
"format": "image_caption",
|
|
264
|
+
"metadata": {
|
|
265
|
+
"topic": topic,
|
|
266
|
+
"platform": platform,
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
def write_script(
|
|
272
|
+
topic: str,
|
|
273
|
+
format: str = "youtube_long",
|
|
274
|
+
**kwargs,
|
|
275
|
+
) -> Dict[str, Any]:
|
|
276
|
+
"""
|
|
277
|
+
Main entry point for script writing.
|
|
278
|
+
|
|
279
|
+
Args:
|
|
280
|
+
topic: Content topic
|
|
281
|
+
format: Output format
|
|
282
|
+
**kwargs: Format-specific options
|
|
283
|
+
|
|
284
|
+
Returns:
|
|
285
|
+
Script with metadata
|
|
286
|
+
"""
|
|
287
|
+
format_handlers = {
|
|
288
|
+
"youtube_long": write_youtube_script,
|
|
289
|
+
"youtube_short": write_short_script,
|
|
290
|
+
"x_thread": write_thread,
|
|
291
|
+
"linkedin": write_linkedin_post,
|
|
292
|
+
"image_caption": write_image_caption,
|
|
293
|
+
"hook_30s": lambda t, **kw: write_short_script(t, duration=30, **kw),
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
handler = format_handlers.get(format, write_youtube_script)
|
|
297
|
+
return handler(topic, **kwargs)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Sentiment Analyzer
|
|
2
|
+
|
|
3
|
+
Analyze sentiment in text data
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install agent-recipes
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## CLI Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Basic usage
|
|
15
|
+
praison recipes run ai-sentiment-analyzer <input>
|
|
16
|
+
|
|
17
|
+
# With output directory
|
|
18
|
+
praison recipes run ai-sentiment-analyzer <input> --output ./output/
|
|
19
|
+
|
|
20
|
+
# Dry run (check dependencies only)
|
|
21
|
+
praison recipes run ai-sentiment-analyzer <input> --dry-run
|
|
22
|
+
|
|
23
|
+
# Show recipe info
|
|
24
|
+
praison recipes info ai-sentiment-analyzer
|
|
25
|
+
|
|
26
|
+
# Check dependencies
|
|
27
|
+
praison recipes doctor ai-sentiment-analyzer
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Python Usage
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from praisonaiagents import Agent
|
|
34
|
+
from agent_recipes import load_recipe
|
|
35
|
+
|
|
36
|
+
# Load and run recipe
|
|
37
|
+
recipe = load_recipe("ai-sentiment-analyzer")
|
|
38
|
+
result = recipe.run(input="<your-input>")
|
|
39
|
+
print(result)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Requirements
|
|
43
|
+
|
|
44
|
+
### Packages
|
|
45
|
+
- openai
|
|
46
|
+
|
|
47
|
+
### Environment Variables
|
|
48
|
+
- OPENAI_API_KEY
|
|
49
|
+
|
|
50
|
+
### External Tools
|
|
51
|
+
- None
|
|
52
|
+
|
|
53
|
+
## Tags
|
|
54
|
+
|
|
55
|
+
`data`, `sentiment`, `nlp`
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
Apache-2.0
|