Add runnable helper scripts, prompt templates, and prompt component reference for agnes-ai-models - #2
Open
oh-summy wants to merge 3 commits into
Open
Conversation
Contribution proposed in AgnesAI-Labs#1, following the structure requested by the maintainer: - scripts/image_understand.py: image analysis via chat completions (agnes-2.5-flash); text/structured/JSON output; local files sent as data URLs. - scripts/image_generate.py: text-to-image and image-to-image via agnes-image-2.1-flash; writes files only when --output is given. - scripts/video_understand.py: frame sampling with ffmpeg plus multi-image chat completions analysis; URL inputs are fetched into a temporary directory that is removed on exit. - scripts/video_generate.py: agnes-video-v2.0 task creation and video_id status polling via direct HTTP requests (httpx), as recommended by SKILL.md for endpoints the SDK does not expose; downloads only when --output is given. - references/prompt-templates.md: prompt templates, structured output schemas, and parameter guidance for all four workflows. All helpers resolve AGNES_API_KEY from the environment (covering shell rc files on macOS/Linux and system settings on Windows) with a .env file fallback (./.env.local, ./.env, skill dir, home dir), and support AGNES_BASE_URL (default https://apihub.agnes-ai.com/v1) with a one-time switch to the alternate international route on network-level failures only. Transient HTTP errors (408/429/5xx) are retried with exponential backoff; HTTP 400/401/403/422/429 never switch routes. Downloads use explicit timeouts. Secrets are never logged. Style mirrors scripts/smoke_chat.py. Offered under the MIT License, adapted from https://github.com/oh-summy/skills. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Resolves #1
This PR adds the helper scripts + prompt templates discussed in #1, plus a condensed prompt component reference and a Prompt Enhancement section in the skill.
What this PR adds
1. Runnable helper scripts (
scripts/)Drop-in shell + Python wrappers that call the same endpoints the skill already documents. Each script honors
AGNES_API_KEYandAGNES_BASE_URLand prints JSON unless an output path is given.scripts/image_understand.pyagnes-2.5-flashscripts/image_generate.pyagnes-image-2.1-flashscripts/video_understand.pyagnes-2.5-flashscripts/video_generate.pyagnes-video-v2.0scripts/smoke_chat.pyagnes-2.5-flash2.
references/prompt-templates.mdReady-made prompt templates and structured-output schemas for all four modalities, plus JSON-output patterns for image and video generation.
3.
references/prompt-components.md(new)Condensed (~155 lines) prompt-assembly vocabulary for
agnes-image-2.1-flashandagnes-video-v2.0: assembly formulas, 10 styles, 3-tier quality boosters, 8 lighting types, 8 composition types, categorized negative prompts (universal / human / video / style conflicts), and 8 camera-movement keywords. Mirrors the structure of the larger prompt-components skill but trimmed for this repo.4. SKILL.md updates
## Runnable Helper Scriptssection that documents the new scripts and their usage.## Prompt Enhancementsection that points agents atreferences/prompt-components.mdand codifies the three-step interaction model (clear request → assemble, partial request → suggest, vague → ask up to 3 focused questions).agnes-2.5-flash.Why this is compatible
AGNES_API_KEYenv var the existing skill documents.openai(already standard) andffmpegfor video understanding.Notes for review
LICENSEstyle.🤖 Generated with Claude Code