Skip to content
Back to search

agi-super-team

Evidence-backed AI team packs for reviewable workflows

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/aAAaqwq/AGI-Super-Team with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/aAAaqwq/AGI-Super-Team'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/aaaaqwq--agi-super-team/badge.svg)](/listings/aaaaqwq--agi-super-team)

HTML

<a href="/listings/aaaaqwq--agi-super-team"><img src="/api/listings/aaaaqwq--agi-super-team/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Paste this entire prompt into Claude Code, Codex, OpenClaw, or another coding agent. It authorizes installation only after a clean preview.

Install AGI Super Team from https://github.com/aAAaqwq/AGI-Super-Team into this coding-agent environment.

1. Detect the current client and run `npx -y agi-super-team@latest --list-tools`.
2. Choose exactly one matching adapter. Never use `--all-tools` for this installation.
3. If this client supports native subagents, include `--all-subagents`; otherwise omit it and state the limitation.
4. Run the selected command without `--install` first. Show the resolved package version, destinations, managed files, and conflicts.
5. If the target is unambiguous and the preview is clean, run the same selection with `--install --connect`, then run a separate `--doctor` check.
6. Stop instead of overwriting unmanaged files, using credentials, or guessing when the framework or destination is unclear.
7. Report what was installed, whether native delegation is available, and whether I must restart or open a new task.

This is one-prompt installation, not blind installation. Ambiguity, unsafe destinations, or conflicts still stop the workflow.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 21 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "agi-super-team",
  3. "description": "Evidence-backed AI team packs for reviewable workflows",
  4. "owner": {
  5. "name": "Daniel Li"
  6. },
  7. "plugins": [
  8. {
  9. "name": "agi-super-team",
  10. "description": "Evidence-backed role packs and reusable skills with explicit installation and review boundaries.",
  11. "version": "1.8.0",
  12. "source": "./"
  13. },
  14. {
  15. "name": "agi-super-team-claudecode",
  16. "description": "Evidence-backed Claude Code package: 14 ast-* subagents, the orchestrator Skill, and a connection spec. Ships no Skill bodies -- install through the generic installer for those.",
  17. "version": "1.8.0",
  18. "source": "./plugins/agi-super-team-claudecode"
  19. }
  20. ]
  21. }
README.md · README · 523 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="right"><a href="./README_CN.md">🇨🇳 中文</a> · <a href="./README.es-ES.md">Español</a></p>
  2. <p align="center">
  3. <img src="docs/assets/team-intelligence.webp" alt="AGI Super Team: an organized cross-harness team of agents and skills" width="900">
  4. </p>
  5. <p align="center"><img src="docs/assets/logo-intelligence.webp" width="64" height="64" alt="AGI Super Team logo"></p>
  6. <h1 align="center">AGI Super Team</h1>
  7. <p align="center"><strong>An organized, installable team of Agents + Skills for local AI agent frameworks.</strong></p>
  8. <p align="center">
  9. Start with an outcome. Let the CEO route executives, executives dispatch specialists, Skills supply methods, and the Governor verify the result.
  10. </p>
  11. AGI Super Team is not a Codex-only plugin. It is a versioned, organized **Agents + Skills team system** for Claude Code, Codex, OpenClaw, Hermes, and other mainstream local AI agent frameworks through 22 explicit adapters.
  12. The same organizational contract travels across frameworks: 14 top-level roles, 92 opt-in specialists, reusable Skills, eight outcome Teams, independent review, and explicit human approval.
  13. Each adapter maps that contract to the capabilities its target actually supports.
  14. ## See what your team actually does
  15. Ask for a landing page. Get a scoped brief, working files, and a review you can inspect. This is an illustrative workflow, not a claim of a completed run.
  16. ![Example workflow: CEO and CPO scope a landing page; PE and specialists build it; Governor reviews; you decide the next step.](./docs/assets/team-workflow.svg)
  17. | Your goal | Work to expect | Team |
  18. |---|---|---|
  19. | Build a product | Product brief → implementation → review | [product-delivery](./starter-kits/product-delivery/) |
  20. | Create a content series | Source notes → channel-ready drafts → claims review | [content-creator](./starter-kits/content-creator/) |
  21. | Research a decision | Question → evidence map → decision memo | [research-decision](./starter-kits/research-decision/) |
  22. [**Explore the website →**](https://aaaaqwq.github.io/AGI-Super-Team/)
  23. **Version note:** No version number is written here on purpose — a hardcoded one goes stale at the next release. `@latest` installs whatever npm currently publishes, which may differ from this checkout. Resolve both yourself instead of trusting prose:
  24. ```bash
  25. npm view agi-super-team version # the version `@latest` resolves to
  26. node -p "require('./package.json').version" # this source tree
  27. ```
  28. Dist-tags other than `latest` are not guaranteed to point at a current release. For one dated example of a source/registry divergence and its recovery, see the [1.5.0 release diagnosis](./docs/guides/npm-release-status.md).
  29. <a id="coding-agent-quick-start"></a>
  30. ## ⚡ Quick Start for Coding Agents
  31. Paste this entire prompt into Claude Code, Codex, OpenClaw, or another coding agent. It authorizes installation only after a clean preview.
  32. ```text
  33. Install AGI Super Team from https://github.com/aAAaqwq/AGI-Super-Team into this coding-agent environment.
  34. 1. Detect the current client and run `npx -y agi-super-team@latest --list-tools`.
  35. 2. Choose exactly one matching adapter. Never use `--all-tools` for this installation.
  36. 3. If this client supports native subagents, include `--all-subagents`; otherwise omit it and state the limitation.
  37. 4. Run the selected command without `--install` first. Show the resolved package version, destinations, managed files, and conflicts.
  38. 5. If the target is unambiguous and the preview is clean, run the same selection with `--install --connect`, then run a separate `--doctor` check.
  39. 6. Stop instead of overwriting unmanaged files, using credentials, or guessing when the framework or destination is unclear.
  40. 7. Report what was installed, whether native delegation is available, and whether I must restart or open a new task.
  41. ```
  42. This is one-prompt installation, not blind installation. Ambiguity, unsafe destinations, or conflicts still stop the workflow.
  43. ## 🐝 Run your first swarm
  44. After installation, restart the client or open a new task. Start with this reusable prompt:
  45. ```text
  46. Swarm agents: <your outcome>
  47. Act as the CEO coordinator.
  48. - Define the outcome and acceptance checks.
  49. - Choose the smallest sufficient team.
  50. - Parallelize only independent work with explicit file ownership.
  51. - Use Skills as methods and require an independent Governor review.
  52. - Synthesize one verified result.
  53. If native multi-agent delegation is unavailable, execute the same role plan sequentially and say so. Do not publish, deploy, spend money, use credentials, or take irreversible action without my approval.
  54. ```
  55. `Swarm agents:` is the routing cue, not a promise of unlimited parallelism. The installed framework controls actual concurrency, nesting, tools, and model access.
  56. <a id="install-into-your-agent-framework"></a>
  57. ## 🛠️ Manual CLI installation
  58. List all 22 adapter targets, preview one target, then apply the same selection:
  59. ```bash
  60. npx -y agi-super-team@latest --list-tools
  61. npx -y agi-super-team@latest --tool claude-code
  62. npx -y agi-super-team@latest --tool claude-code --install --connect
  63. npx -y agi-super-team@latest --tool claude-code --doctor
  64. npx -y agi-super-team@latest --list-categories
  65. npx -y agi-super-team@latest --list-skills --category finance-trading-markets
  66. npx -y agi-super-team@latest --tool pi --skill-pack software-engineering --install
  67. ```
  68. The commands above use the public npm package. For reproducible automation, do not leave `@latest` in a pinned pipeline — resolve an exact published version first and pin that, so a later release cannot change what your run installs:
  69. ```bash
  70. AGI_VERSION="$(npm view agi-super-team version)"
  71. npx -y "agi-super-team@${AGI_VERSION}" --tool claude-code --install --connect
  72. ```
  73. The npm distribution carries the full Skill library and keeps its `SKILL.md` entrypoints discoverable, together with `catalog/skill-index.json`. By default it installs only the Skills assigned to the selected Agents by `config/team-manifest.json`; use `--skill <name>` for individual Skills, `--all-skills` for the whole library, and `--list-skills` to list every name. Browse the provenance-backed [Daniel's Original Skills](./skills/original/) collection for reviewed first-party work.
  74. Replace `claude-code` with an ID from `--list-tools`. Use `--all-tools` only when you intentionally want every global and project adapter. A no-argument run remains the legacy Codex preview; new automation should always name `--tool` or `--all-tools`.
  75. ### Pick your framework
  76. Every command below has the same shape. Substitute the `--tool` ID for whichever client you already use — no framework is a prerequisite for another:
  77. ```bash
  78. npx -y agi-super-team@latest --tool <id> # preview, writes nothing
  79. npx -y agi-super-team@latest --tool <id> --install # apply
  80. npx -y agi-super-team@latest --tool <id> --install --connect
  81. npx -y agi-super-team@latest --tool <id> --doctor # verify what landed
  82. ```
  83. Five frameworks carry the full harness Adapter contract, including native Agent generation and a connection receipt:
  84. | Platform | `--tool` | Preview command | Installed capability |
  85. |---|---|---|---|
  86. | Claude Code | `claude-code` | `npx -y agi-super-team@latest --tool claude-code` | Native Markdown Agents + canonical Skills + Claude orchestrator |
  87. | Codex | `codex` | `npx -y agi-super-team@latest --tool codex` | Main-session CEO + native TOML Agents + canonical Skills |
  88. | OpenClaw | `openclaw` | `npx -y agi-super-team@latest --tool openclaw` | Namespaced Agent workspaces + canonical Skills + safe config merge |
  89. | Hermes Agent | `hermes` | `npx -y agi-super-team@latest --tool hermes` | Role Skills + canonical Skills + Profiles/Kanban blueprints |
  90. | DeepSeek Harness | `dsh` | `npx -y agi-super-team@latest --tool dsh` | Declarative cordis patch enabling the Skill root + AGENTS.md CEO block + preset |
  91. The other seventeen targets use the generic installer — same commands, same preview-first safety, without the external Adapter module. See [all 22 targets](#all-22-adapter-targets).
  92. `--install` materializes files; `--install --connect` also writes a connection receipt. OpenClaw dry-runs and then upserts managed `agents.list` entries while preserving unmanaged Agents and creating no channel bindings. Claude and Codex use filesystem discovery. Hermes emits blueprints but does not create Profiles, Cron jobs, or a Gateway. See the [primary harness Adapter guide](./docs/guides/harness-adapters.md) for paths, permissions, and receipt requirements.
  93. OpenClaw `2026.7.1-2` requires Node.js `>=22.22.3 <23`, `>=24.15.0 <25`, or `>=25.9.0`. AGI Super Team itself still supports Node.js 18+, so this stricter prerequisite applies only when invoking the current OpenClaw CLI.
  94. Claude Code, Codex, OpenClaw, Hermes, and DeepSeek Harness are first-class entry points to the same team system, not separate editions with different organizations.
  95. Delivery format varies because each framework exposes different native Agent and Skill primitives.
  96. ### Install executive subagent groups
  97. The default remains the 14 top-level roles. Add one executive pyramid, or all 92 optional specialists — these flags work identically for every `--tool`:
  98. ```bash
  99. npx -y agi-super-team@latest --tool <id> --with-subagents cto
  100. npx -y agi-super-team@latest --tool <id> --with-subagents cfo --with-subagents clo
  101. npx -y agi-super-team@latest --tool <id> --all-subagents --install
  102. ```
  103. The hierarchy is CEO → eleven manager executives → leaf specialists. CTO also references the existing canonical PE as delivery lead; it does not create a second PE identity. All 92 source files under `agents/*/subagents/*/AGENTS.md` are byte-for-byte copies from pinned `jnMetaCode/agency-agents-zh`; local routing and safety envelopes remain separate. CEO retains coordination authority, Governor remains an independent reviewer, and PE remains CTO's canonical delivery leaf rather than another manager. See [`config/agent-sources.lock.json`](./config/agent-sources.lock.json) for source URLs and SHA-256 digests. Nested Codex routing requires `max_depth = 2`; with four threads, run one manager plus at most two children per wave.
  104. These are **22 AI client/runtime adapter targets**, not 22 interchangeable CLIs. An adapter can install native Agents, native Skills, project rules/context, or role packs degraded to Agent-as-Skill. File placement does not by itself prove that a current client loaded or executed the content.
  105. ### All 22 adapter targets
  106. Global adapters normally resolve from the selected OS-home base; project adapters resolve from the selected project directory. OpenClaw and Hermes instead honor their native runtime roots, as shown below.
  107. | ID | Client/runtime | Scope | Agent delivery | Skill delivery | Status |
  108. |---|---|---|---|---|---|
  109. | `claude-code` | Claude Code | Global | Native Markdown Agent: `.claude/agents` | Canonical: `.claude/skills` | Structurally connected; runtime pending |
  110. | `codex` | Codex | Global | Main-session CEO + TOML: `.codex/agents` | Canonical: `.agents/skills` | Structurally connected; runtime pending |
  111. | `openclaw` | OpenClaw | Global | Native workspace: `<active config dir>/agency-agents/agi-super-team` | Canonical: `<active config dir>/skills/agi-super-team` | Structurally connected; runtime pending |
  112. | `hermes` | Hermes Agent | Global | Role Skills: `$HERMES_HOME/skills/agi-super-team-agents` | Canonical: `$HERMES_HOME/skills/agi-super-team` | Blueprint connected; runtime pending |
  113. | `dsh` | DeepSeek Harness | Global | Preset: `.dsh/.agent-presets/ast-team` | Canonical: `.dsh/skills/agi-super-team` | Structurally connected; runtime pending |
  114. | `pi` | Pi | Global | Agent-as-Skill: `.pi/agent/skills/<id>/SKILL.md` | Native: `.pi/agent/skills` | Adapter |
  115. | `oh-my-pi` | Oh My Pi | Global | Markdown Agent: `.omp/agent/agents` | Native: `.omp/agent/skills` | Adapter |
  116. | `grok-build` | Grok Build | Global | Markdown Agent: `.grok/agents` | Native: `.grok/skills` | Adapter |
  117. | `copilot` | GitHub Copilot | Global | Markdown Agent: `.github/agents`, `.copilot/agents` | Native: `.copilot/skills` | Adapter |
  118. | `antigravity` | Antigravity | Global | Agent: `.gemini/config/agents` | Native: `.gemini/config/skills` | **Experimental** |
  119. | `gemini-cli` | Gemini CLI | Global | Markdown Agent: `.gemini/agents` | Native: `.gemini/skills` | Adapter |
  120. | `opencode` | OpenCode | Global | Markdown Agent: `.config/opencode/agents` | Native: `.config/opencode/skills` | Adapter |
  121. | `cursor` | Cursor | Global | Markdown Agent: `.cursor/agents` | Native: `.cursor/skills` | **Experimental** |
  122. | `trae` | Trae | Project | Project rule: `.trae/rules` | Native: `.trae/skills` | Project adapter |
  123. | `aider` | Aider | Project | Combined project rules: `CONVENTIONS.md` | Combined into the same project context | Project adapter |
  124. | `windsurf` | Windsurf | Project | Combined project rules: `.windsurfrules` | Combined into the same project context | Project adapter |
  125. | `qwen` | Qwen Code | Global | Markdown Agent: `.qwen/agents` | Native: `.qwen/skills` | Adapter |
  126. | `deerflow` | DeerFlow | Project | Agent-as-Skill: `skills/custom/agi-super-team-agents` | Native: `skills/custom/agi-super-team` | Project adapter |
  127. | `workbuddy` | WorkBuddy | Global | Agent-as-Skill: `.workbuddy/skills/agi-super-team-agents` | Native: `.workbuddy/skills/agi-super-team` | Adapter |
  128. | `codewhale` | CodeWhale | Global | Agent-as-Skill: `.codewhale/skills/agi-super-team-agents` | Native: `.codewhale/skills/agi-super-team` | Adapter |
  129. | `kiro` | Kiro | Global | Markdown Agent: `.kiro/agents` | Native: `.kiro/skills` | Adapter |
  130. | `qoder` | Qoder | Global | Markdown Agent: `.qoder/agents` | Native: `.qoder/skills` | Adapter |
  131. The matrix describes the adapter contract in [`config/cli-adapters.json`](./config/cli-adapters.json), not a claim that all 22 clients have been runtime-verified. Cursor and Antigravity are explicitly experimental.
  132. ### Ecosystem plugins
  133. Beyond file placement, some clients also support installing this repository as a native plugin through their own marketplace. The repository carries the manifests for these:
  134. | Client | Mechanism | Manifest | Status |
  135. |---|---|---|---|
  136. | Codex | `codex plugin marketplace add aAAaqwq/AGI-Super-Team` | [`.agents/plugins/marketplace.json`](./.agents/plugins/marketplace.json) | Verified end-to-end |
  137. | Claude Code | marketplace at [`.claude-plugin/marketplace.json`](./.claude-plugin/marketplace.json) | `claude plugin validate .` | Manifest validates clean |
  138. | Kimi | `plugin.json` at `.kimi-plugin/` or `kimi.plugin.json` | [`.kimi-plugin/plugin.json`](./.kimi-plugin/plugin.json) | Manifest valid, but only as an install source — plugins are user-scoped and run from a managed copy |
  139. | Cursor | `.cursor-plugin/plugin.json` | [`.cursor-plugin/plugin.json`](./.cursor-plugin/plugin.json) | Manifest fields corrected to the official schema (`skills`); client load not yet verified |
  140. | Gemini CLI | `gemini extensions install <repo>` | [`gemini-extension.json`](./gemini-extension.json) | Manifest valid; mechanism documented, end-to-end unverified |
  141. | DeepSeek Harness | `npx -y agi-super-team@latest --tool dsh --install` | — | Adapter present; runtime evidence `pending` |
  142. Skills interoperate because `SKILL.md` follows the [agentskills.io](https://agentskills.io) open standard, which these clients share. The `~/.agents/skills/` root in particular is read by more than one client, so a single install can serve several.
  143. Which mechanisms each client actually honors is documented in [Coding agent assembly](./docs/researchs/coding-agent-assembly.md), including which claims are verified and which are not.
  144. Use the canonical [`orchestrate-agi-super-team`](./skills/orchestrate-agi-super-team/SKILL.md) Skill when a task needs the complete Team → C-suite → Skills/Subagents → Governor → CEO → human-approval flow. It detects the current framework's real delegation limits and records any flat or sequential fallback instead of pretending native nesting occurred.
  145. ### Select destinations, refresh, and verify
  146. Use `--home` to redirect the OS-home base and `--project-dir` for project-scoped targets (the project directory defaults to the current directory). Hermes gives a non-empty `HERMES_HOME` precedence; OpenClaw follows `OPENCLAW_HOME`, `OPENCLAW_STATE_DIR`, and `OPENCLAW_CONFIG_PATH`. Combining `--home` with a conflicting runtime override fails before any write. This makes a disposable audit easy:
  147. ```bash
  148. AGI_AUDIT_HOME="$(mktemp -d "${TMPDIR:-/tmp}/agi-super-team-home.XXXXXX")"
  149. AGI_AUDIT_PROJECT="$(mktemp -d "${TMPDIR:-/tmp}/agi-super-team-project.XXXXXX")"
  150. npx -y agi-super-team@latest --tool openclaw \
  151. --home "$AGI_AUDIT_HOME" --project-dir "$AGI_AUDIT_PROJECT"
  152. npx -y agi-super-team@latest --tool openclaw \
  153. --home "$AGI_AUDIT_HOME" --project-dir "$AGI_AUDIT_PROJECT" --install
  154. npx -y agi-super-team@latest --tool openclaw \
  155. --home "$AGI_AUDIT_HOME" --project-dir "$AGI_AUDIT_PROJECT" --doctor
  156. ```
  157. Run the same `--install` command again to refresh managed content; use `--install --connect` when the connection and pending receipt should also be refreshed, then repeat `--doctor`. Restart or open a new task in the target client and verify that it discovers the expected Agent/Skill surface. `--doctor` verifies installed adapter artifacts, not model behavior or task quality.
  158. ### Safety and update limits
  159. - Preview is the default and performs no writes; `--install` is the explicit write boundary.
  160. - Reapplying the same selection is designed to be idempotent. Differing managed destinations are backed up before replacement; unrelated client files are outside the managed selection.
  161. - Backups are local recovery aids, not a complete snapshot or uninstall system. Review the preview and keep your own version-control or filesystem backup for important configuration.
  162. - Symlinked or unsafe destinations are refused. `--no-agents` and `--no-skills` can narrow the payload when needed.
  163. - This project does not use a remote-script pipe installer; the commands above use npm's package runner and still deserve normal dependency review.
  164. - Installation proves file materialization only. Runtime evidence for all four primary Adapters remains `pending` until a clean-client canary is bound to a clean source revision.
  165. The adapter design was inspired in part by [`jnMetaCode/agency-agents-zh`](https://github.com/jnMetaCode/agency-agents-zh) at fixed commit [`2ecfabf8`](https://github.com/jnMetaCode/agency-agents-zh/commit/2ecfabf8e944ccdfed63ad8c44d5241290af6977). AGI Super Team's manifest, payload mapping, safety behavior, and evidence boundaries are maintained here.
  166. <p align="center">
  167. <a href="#coding-agent-quick-start"><strong>Install the team</strong></a>&nbsp;&nbsp;|&nbsp;&nbsp;
  168. <a href="./.codex/INDEX.md">Inspect the Codex package</a>
  169. </p>
  170. ## 🧠 The system in one minute
  171. | Layer | What you get | Why it matters |
  172. |---|---|---|
  173. | **🧩 Skills** | Canonical physical `SKILL.md` files grouped into 14 outcome categories | Reuse focused playbooks instead of rebuilding instructions for every task |
  174. | **🤖 Agents** | 14 top-level role packs plus 92 optional direct specialists with exact routing and source locks | Give planning, engineering, product, content, research, and review clear ownership |
  175. | **🔁 Team packs** | 8 manifest-driven outcome Teams, from Solo Founder to Full Team | Start with the smallest team that can own the outcome instead of loading everything |
  176. <p>
  177. <a href="https://github.com/aAAaqwq/AGI-Super-Team/actions/workflows/validate-repository.yml"><img src="https://github.com/aAAaqwq/AGI-Super-Team/actions/workflows/validate-repository.yml/badge.svg" alt="Repository contracts"></a>
  178. <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-2563eb" alt="MIT license"></a>
  179. <img src="https://img.shields.io/badge/outcome%20fixture-validation%20pending-64748b" alt="Outcome fixture validation pending">
  180. </p>
  181. Team, C-suite, Subagents, and Skills form an outcome-driven graph rather than a directory inheritance chain. A Team selects the smallest sufficient C-suite; each executive receives assigned Skills on one branch and an allowlisted specialist roster on another; all evidence flows through an independent Governor gate.
  182. ```mermaid
  183. flowchart TD
  184. O["Outcome / Brief"] --> C["Coordinator scopes"]
  185. C --> T["Team Kit<br/>roster, outputs, checks"]
  186. T --> CEO["CEO coordinator"]
  187. CEO --> M["Smallest sufficient C-suite"]
  188. CEO --> G["Independent Governor"]
  189. M -->|"role assignment"| SK["Canonical Skills<br/>reusable methods"]
  190. M -->|"bounded delegation"| L["Direct Subagents<br/>domain specialists"]
  191. L --> RI["Specialist role contract<br/>trigger, inputs, outputs, boundary"]
  192. SK --> W["Evidence-backed work"]
  193. RI --> W
  194. W --> G
  195. G --> CEO
  196. CEO --> H["Human approval<br/>release, money, credentials, irreversible actions"]
  197. ```
  198. Skills and Subagents are parallel capability branches beneath a C-suite role, not an automatic `Subagent → Skill` inheritance chain. See [How Teams, C-suite Agents, Subagents, and Skills connect](./docs/guides/team-agent-skill-architecture.md) for the contract compiler, runtime sequence, framework mappings, and invariants.
  199. AGI Super Team owns the versioned content, selection rules, safe copying, and repository checks. Your configured coding-agent harness owns the model, credentials, tools, execution, and final task output.
  200. ## 🎯 Start with an outcome
  201. Choose the army that matches the outcome. Each Team has a CEO coordinator, a bounded executive core, an independent Governor gate, and access to additional executives or specialists when a named evidence gap requires them.
  202. | Team army | Give it | Intended evaluation outputs | Core team |
  203. |---|---|---|---|
  204. | [🚀 Solo Founder](./starter-kits/solo-founder/) | A bounded product idea or launch brief | Product decision, test-first plan, launch evidence, Governor decision | CEO, CPO, PE, Governor |
  205. | [✍️ Content Creator](./starter-kits/content-creator/) | Approved sources, audience, and channel | Evidence brief, channel-ready drafts, measurement plan, claims review | CEO, CRO, CCO, CMO, Governor |
  206. | [📊 Quant Research](./starter-kits/quant-trader/) | A hypothesis and historical data | Reproducible backtest specification, risk memo, independent gate | CEO, CQO, CDO, CFO, Governor |
  207. | [🧱 Product Delivery](./starter-kits/product-delivery/) | A validated user problem and delivery constraints | Product brief, architecture decision, tested change, release handoff | CEO, CPO, CTO, PE, Governor |
  208. | [🔬 Research Decision](./starter-kits/research-decision/) | A consequential question and decision criteria | Research plan, evidence map, cited synthesis, decision memo | CEO, CRO, CDO, Governor |
  209. | [📣 Go To Market](./starter-kits/go-to-market/) | Validated positioning and a launch/revenue objective | Positioning brief, launch assets, revenue experiment, risk gate | CEO, CPO, CMO, CCO, CSO, Governor |
  210. | [🚨 Operations Response](./starter-kits/operations-response/) | A bounded incident or delivery failure | Incident scope, containment, verified recovery, post-incident review | CEO, COO, CTO, PE, Governor |
  211. | [🏛️ Executive Team](./starter-kits/full-team/) | A cross-functional company brief | Executive routing plan, specialist artifacts, independent review, verified handoff | All 14 top-level roles available; CEO coordinates, Governor reviews |
  212. Start with the smallest complete army that can own the outcome. `full-team` makes all 14 top-level roles eligible, but the CEO still dispatches only the roles and specialists justified by the brief.
  213. ## ⚡ Legacy generic workspace materializer
  214. The multi-client npm installer above is the primary entry point. The older `install.sh` path remains useful when you want harness-neutral, inspectable role workspaces instead of a client adapter. Clone `main` and preview Solo Founder; preview is the default and writes nothing:
  215. ```bash
  216. git clone --depth 1 --branch main https://github.com/aAAaqwq/AGI-Super-Team.git
  217. cd AGI-Super-Team
  218. git rev-parse HEAD
  219. ./install.sh --source "$PWD" --destination /path/to/review-workspace solo-founder
  220. ```
  221. Inspect the selected Agents and destinations. Apply only when they match your intent:
  222. ```bash
  223. ./install.sh --source "$PWD" --destination /path/to/review-workspace --apply solo-founder
  224. ```
  225. The generic installer validates every required file before publishing staged workspaces. It preserves existing persona and skill files and rejects dangerous source or destination symlinks. See [setup.md](./setup.md) for prerequisites, updates, and recovery.
  226. The manifest separates portable `required`/`optional` Skills from `harnessSpecific` catalog entries and unbundled external recommendations. Generic installs copy only classes that pass the current portability contract; the complete copied payload is scanned for known host paths and runtime-only commands.
  227. **Success:** the preview writes nothing; apply creates three inspectable role workspaces without overwriting existing files.
  228. ## ✨ Browse Skills by provenance
  229. Choose a trust boundary before browsing by topic. Provenance labels describe reviewed origin evidence; they do not claim runtime verification.
  230. | [Project original](./catalog/#project-original-skills) | [Adapted](./catalog/#adapted-skills) | [Collected](./catalog/#collected-skills) | [Unknown origin](./catalog/#unknown-origin-skills) |
  231. |---|---|---|---|
  232. | Digest-backed first-party work | Modified from a named source | Preserved from a named source | Awaiting source review |
  233. ## 🧭 Browse skills by outcome
  234. The root README stays curated. Use the generated catalog when you need the complete, searchable inventory.
  235. | Build and operate | Reach and create | Decide and automate |
  236. |---|---|---|
  237. | [🤖 AI Agents & Orchestration](./catalog/#ai-agents-orchestration) | [📈 Marketing, SEO & Growth](./catalog/#marketing-seo-growth) | [📊 Data, Analytics & Research](./catalog/#data-analytics-research) |
  238. | [💻 Software Engineering](./catalog/#software-engineering) | [✍️ Content, Media & Publishing](./catalog/#content-media-publishing) | [🧭 Business Operations & Strategy](./catalog/#business-operations-strategy) |
  239. | [☁️ Cloud, DevOps & Reliability](./catalog/#cloud-devops-reliability) | [🤝 Sales, CRM & Customer Success](./catalog/#sales-crm-customer-success) | [⚙️ Apps & Workflow Automation](./catalog/#apps-workflow-automation) |
  240. | [🛡️ Security, Privacy & Legal](./catalog/#security-privacy-legal) | [🎨 Product, Design & UX](./catalog/#product-design-ux) | [💹 Finance, Trading & Markets](./catalog/#finance-trading-markets) |
  241. | [🧰 Specialized Domains & Utilities](./catalog/#general-utilities) | [🇨🇳 Chinese Platform Workflows](./catalog/#chinese-platform-workflows) | |
  242. Explore the repository by depth:
  243. | Path | Best for |
  244. |---|---|
  245. | [Skills overview](./skills/) | Support levels, bounded starting points, and discovery guidance |
  246. | [Generated skill catalog](./catalog/) | Every canonical physical skill grouped by task outcome |
  247. | [Agents](./agents/) | Persona, identity, workflow, and tool guidance |
  248. | [Practical guides](./docs/guides/) | Codex, Claude Code, compatibility, team choice, and workflow boundaries |
  249. | [Cookbooks](./cookbook/) | Longer material for content, prompts, research, and quantitative workflows |
  250. | [Architecture map](./ARCHITECTURE.md) | Sources of truth, generated outputs, public entry points, and change ownership |
  251. | [Team / Agent / Skill linking model](./docs/guides/team-agent-skill-architecture.md) | Team selection, Manager routing, Skill assignment, Adapter compilation, and runtime delegation |
  252. | [Shared language](./CONTEXT.md) | Module, Interface, Adapter, evidence, and product terminology |
  253. ### 🔎 Find high-quality skill sources
  254. [`agent-skill-repository-index`](./skills/agent-skill-repository-index/) turns Daniel's reviewed source list into a safe selection workflow. Compare one candidate, inspect its permissions and provenance, then install or remove it without globally activating entire repositories.
  255. | Need | Maintained reference |
  256. |---|---|
  257. | Compare reviewed sources | [Source matrix](./skills/agent-skill-repository-index/references/repositories.md) |
  258. | Inspect the dated popularity signal | [Star snapshot](./skills/agent-skill-repository-index/references/star-snapshot.md) |
  259. | Install one candidate safely | [Installation workflow](./skills/agent-skill-repository-index/references/installing.md) |
  260. Stars help with discovery, not trust. The matrix records `DAILY`, `LIBRARY`, and `QUARANTINE` boundaries; catalogs and runtimes are never bulk-installed.
  261. ## ✅ What is useful today
  262. You can already browse a deterministic skill catalog, inspect every Agent instruction, preview a manifest-selected team, and assemble local role workspaces without overwriting existing files.
  263. | Claim | Evidence | Status |
  264. |---|---|---|
  265. | Repository inventory, counts, and references | `npm run validate -- --warnings-as-errors` | **Verified in this checkout** |
  266. | Generic installer preview, preflight, no-clobber, and staging | `npm test` | **Verified in this checkout** |
  267. | Generated catalog covers the canonical inventory | `npm run check:skills` | **Verified in this checkout** |
  268. | Primary-outcome classification agrees with the fixed reviewed set | [Gold Set method](./docs/skill-taxonomy-gold-set.md) + [generated report](./catalog/skill-taxonomy-evaluation.json) | **Reviewed-set gate passed in this checkout** |
  269. | Client loading for an adapter without a matching receipt | Revision-matched harness receipt | **Validation pending** |
  270. | Task quality or business outcome | Public fixture, baseline, rubric, and artifacts | **Validation pending** |
  271. ## 🧾 Reproducible installation receipt
  272. Create a disposable destination, prove preview wrote nothing, apply, and verify the three expected Solo Founder workspaces:
  273. ```bash
  274. AGI_SOLO_DEST="$(mktemp -d "${TMPDIR:-/tmp}/agi-solo-founder.XXXXXX")"
  275. ./install.sh --source "$PWD" --destination "$AGI_SOLO_DEST" solo-founder
  276. test -z "$(find "$AGI_SOLO_DEST" -mindepth 1 -print -quit)"
  277. ./install.sh --source "$PWD" --destination "$AGI_SOLO_DEST" --apply solo-founder
  278. test -f "$AGI_SOLO_DEST/workspace-ceo/SOUL.md"
  279. test -f "$AGI_SOLO_DEST/workspace-pe/SOUL.md"
  280. test -f "$AGI_SOLO_DEST/workspace-cco/SOUL.md"
  281. python3 -m venv .venv
  282. . .venv/bin/activate
  283. python -m pip install --requirement requirements-dev.txt
  284. npm test
  285. npm run validate -- --warnings-as-errors
  286. npm run check:skills
  287. npm run check:taxonomy-evaluation
  288. npm run check:architecture
  289. ```
  290. This receipt proves manifest-driven selection, preview safety, staged copying, and repository integrity for the inspected checkout and destination state. It does not prove harness loading, task quality, or business outcomes.
  291. <details>
  292. <summary><strong>👀 See the preview → apply → verify storyboard</strong></summary>
  293. <p align="center">
  294. <img src="assets/demo-install.gif" alt="Terminal storyboard showing a read-only preview, explicit apply, and repository checks" width="900">
  295. </p>
  296. The animation uses sanitized paths and is illustrative, not runtime evidence. Read the [storyboard transcript](./assets/demo-install.txt).
  297. </details>
  298. ## 🔌 Choose a distribution
  299. Use the [one-prompt Coding Agent installer](#coding-agent-quick-start) or the manual 19-target npm installer above for a named Agent framework.
  300. Use the [curated Codex package](./.codex/INDEX.md) for Codex-specific details, or the legacy generic workspace materializer for harness-neutral files.
  301. The [Claude Code guide](./docs/guides/claude-code-install.html) and [Harness compatibility guide](./docs/guides/harness-compatibility.html) provide background. Current Adapter manifests and commit-matched receipts govern support claims.
  302. The generic path requires Bash and Node.js; repository verification also requires npm and Python 3. Exact operating-system and client-version support remains bounded by CI and published receipts. Adapter presence never establishes feature parity.
  303. ## 🗂️ Repository architecture
  304. ```mermaid
  305. flowchart LR
  306. subgraph R["AGI Super Team repository: versioned content, not a runtime"]
  307. S["skills/<br/>reusable playbooks"]
  308. A["agents/<br/>14 top-level roles + 92 optional specialists"]
  309. M["team-manifest.json<br/>8 kits + skill mappings"]
  310. C["plugins/agi-super-team-codex/<br/>curated Codex package"]
  311. end
  312. S --> I["install.sh<br/>preview → preflight → staged copy"]
  313. A --> I
  314. M --> I
  315. I --> W["workspace-agent<br/>inspectable local files"]
  316. W --> H["External harness<br/>model + tools + execution"]
  317. C --> H
  318. H --> O["Task artifacts<br/>behavioral evidence pending"]
  319. S --> G["Catalog generator"]
  320. M --> G
  321. G --> K["catalog/<br/>generated discovery index"]
  322. S --> V["Validator + tests"]
  323. A --> V
  324. M --> V
  325. I --> V
  326. V --> E["Repository receipt<br/>structure + install safety"]
  327. ```
  328. | File or directory | Responsibility |
  329. |---|---|
  330. | [`config/team-manifest.json`](./config/team-manifest.json) | Source of truth for Agents, kits, and portable, harness-specific, or external Skill assignments |
  331. | [`config/repository-architecture.json`](./config/repository-architecture.json) | Machine-readable Modules, path owners, generated lineage, and Adapter status |
  332. | [`agents/`](./agents/) and [`skills/`](./skills/) | Authored, versioned inputs; only manifest-classified portable payloads enter generic workspaces |
  333. | [`docs/guides/team-agent-skill-architecture.md`](./docs/guides/team-agent-skill-architecture.md) | Team, C-suite, Subagent, Skill, Governor, and human-approval linking principles |
  334. | [`.codex/INDEX.md`](./.codex/INDEX.md) | Installation guide and Codex package index |
  335. | [`plugins/agi-super-team-codex/`](./plugins/agi-super-team-codex/) | Actual curated Codex plugin, skills, and bundled agent roles |
  336. | [`install.sh`](./install.sh) | Preview-first selection, preflight, staging, and no-clobber publishing |
  337. | [`scripts/repository_model.py`](./scripts/repository_model.py) | Shared inventory and manifest model used by validation and generation |
  338. | [`catalog/`](./catalog/) | Generated discovery output; never an inventory source |
  339. | [`tests/`](./tests/) | Repository, installer, site-data, and SEO contracts |
  340. | [`docs/`](./docs/) | Project site, verification data, and editorial guides |
  341. For the authored-input, generated-output, distribution, and evidence boundaries, read the full [repository architecture map](./ARCHITECTURE.md), [shared language](./CONTEXT.md), and [decision records](./docs/adr/).
  342. [`config/external-skill-sources.json`](./config/external-skill-sources.json) records tombstones for removed machine-local links, including unresolved provenance fields. README text and generated catalog files are not inventory sources.
  343. ## 🧠 Team topology
  344. ```text
  345. Founder / operator
  346. └── CEO: coordination and quality gates
  347. ├── CTO / PE: architecture and implementation
  348. ├── CPO / CCO / CMO: product, content, and growth
  349. ├── CQO / CFO / CDO: quantitative research, finance, and data
  350. ├── CLO / CRO / CSO / COO: legal, research, sales, and operations
  351. └── Governor: independent review and escalation
  352. ```
  353. Mentor names are creative framing. They do not imply affiliation, endorsement, or guaranteed imitation.
  354. ## 🛡️ Boundaries and human approval
  355. AGI Super Team is not a model, autonomous orchestrator, or agent runtime. Installing files does not make a harness load or execute them automatically.
  356. - Inspect third-party commands and dependencies before execution.
  357. - Never place credentials, private data, browser sessions, or production configuration in a skill or issue.
  358. - Keep financial workflows in research or paper-trading environments until independently validated.
  359. - Require explicit human approval for posts, messages, transactions, deployments, and destructive operations.
  360. - Report vulnerabilities privately through [GitHub Security Advisories](https://github.com/aAAaqwq/AGI-Super-Team/security/advisories/new).
  361. ## 🤝 Contribute and get help
  362. - [Report a reproducible issue](https://github.com/aAAaqwq/AGI-Super-Team/issues/new/choose)
  363. - [Contributing and provenance](./CONTRIBUTING.md)
  364. - [Setup and recovery](./setup.md)
  365. - [Security policy](./SECURITY.md)
  366. - [MIT License](./LICENSE)
  367. Eight datasets in this repository — the skill catalog, agent indexes, harness packages, quality and taxonomy reports among them — are generated from `skills/` and `config/` and committed alongside them. Enable the pre-commit hook once per clone so that editing either directory regenerates them instead of letting them drift:
  368. ```bash
  369. git config core.hooksPath .githooks
  370. ```
  371. The hook regenerates that derived data on commits touching `skills/` or `config/`, stages what it rewrote, and blocks the commit when a generator fails or when the change pushes a metric past the quality-baseline ratchet. It is not enabled by default — `core.hooksPath` is per-clone state — so run the command above after cloning. See [CONTRIBUTING.md](./CONTRIBUTING.md) for both guards and the manual fallback.
  372. ## ⭐ GitHub Stars
  373. Track AGI Super Team's public star trend over time. The live visualization is provided by Star History; click the chart to inspect the interactive timeline.
  374. <p align="center">
  375. <a href="https://www.star-history.com/?type=date&amp;legend=top-left&amp;repos=aAAaqwq%2FAGI-Super-Team">
  376. <img src="https://api.star-history.com/svg?repos=aAAaqwq/AGI-Super-Team&amp;type=Date&amp;legend=top-left" alt="AGI Super Team Star History chart">
  377. </a>
  378. <br>
  379. <sub>Live chart by Star History · <a href="https://github.com/aAAaqwq/AGI-Super-Team/stargazers">View Stargazers on GitHub</a></sub>
  380. </p>
  381. If AGI Super Team has genuinely saved you time, feel free to [Star the repository](https://github.com/aAAaqwq/AGI-Super-Team) so you can find it again.
skills/aigc-director/aigc-claw/backend/tool/llm_gemini.py · Bundled script · 122 lines · 2 findings marked
  1. # -*- coding: utf-8 -*-
  2. """
  3. Google Gemini LLM 客户端 (OpenAI 兼容格式)
  4. 支持 gemini-2.5-flash, gemini-2.5-pro 等模型
  5. 可用模型:
  6. - gemini-2.5-flash (性价比高)
  7. - gemini-2.5-flash-preview
  8. - gemini-2.5-pro (效果最好)
  9. - gemini-2.5-pro-preview
  10. - gemini-2.0-flash
  11. """
  12. import os
  13. import time
  14. from openai import OpenAI
  15. from typing import List
  16. class Gemini:
  17. """
  18. Gemini LLM 客户端,使用 OpenAI 兼容格式调用
  19. """
  20. def __init__(self, base_url: str = "", api_key: str = ""):
  21. """
  22. 初始化 Gemini 客户端
  23. :param base_url: OpenAI 兼容的 Base URL
  24. :param api_key: Gemini API Key
  25. """
  26. # 确保 base_url 以 /v1 结尾
  27. default_url = "http://35.164.11.19:3887/v1"
    • Warning: Talks to a raw IP address or throwaway host, where malware is often staged
    • Line 30 on GitHub
  28. self.base_url = base_url or os.getenv("GOOGLE_GEMINI_BASE_URL", default_url)
  29. if self.base_url and not self.base_url.endswith("/v1"):
  30. self.base_url = self.base_url.rstrip("/") + "/v1"
  31. self.api_key = api_key or os.getenv("GEMINI_API_KEY", "")
  32. self.client = OpenAI(api_key=self.api_key, base_url=self.base_url)
  33. self.max_attempts = 10
  34. self.max_tokens = 20000
  35. def query(self, prompt: str, image_urls: List[str] = [], model: str = "gemini-2.5-flash") -> str:
  36. """
  37. 调用 Gemini LLM
  38. :param prompt: 文本提示
  39. :param image_urls: 图片 URL 列表(可选,用于多模态模型)
  40. :param model: 模型名
  41. :return: 生成的文本
  42. """
  43. if not model:
  44. model = "gemini-2.5-flash"
  45. # 构建消息格式
  46. content: list = [{"type": "text", "text": prompt}]
  47. # 添加图片 (如果有多模态模型支持)
  48. if image_urls:
  49. for img_url in image_urls:
  50. if img_url.startswith("http"):
  51. content.append({
  52. "type": "image_url",
  53. "image_url": {"url": img_url}
  54. })
  55. messages = [{"role": "user", "content": content}]
  56. attempts = 0
  57. while attempts < self.max_attempts:
  58. try:
  59. # 直接使用模型名(代理服务会处理格式转换)
  60. response = self.client.chat.completions.create(
  61. model=model,
  62. messages=messages,
  63. max_tokens=self.max_tokens,
  64. temperature=0.7
  65. )
  66. # 检查响应类型
  67. if isinstance(response, str):
  68. print(f"Gemini 返回字符串响应: {response}")
  69. raise Exception(f"API 返回错误: {response}")
  70. if response.choices and len(response.choices) > 0:
  71. return response.choices[0].message.content
  72. except Exception as e:
  73. print(f"Gemini 请求错误: {e}")
  74. attempts += 1
  75. if attempts < self.max_attempts:
  76. time.sleep(10)
  77. raise Exception("Gemini: 达到最大重试次数,仍未获得有效响应。")
  78. if __name__ == "__main__":
  79. import sys
  80. sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  81. from config import Config
  82. # 支持的模型列表
  83. MODELS = ["gemini-2.5-flash", "gemini-2.0-flash"]
  84. print("=== Gemini LLM 可用性测试 ===")
  85. api_key = Config.GEMINI_API_KEY
  86. base_url = Config.GOOGLE_GEMINI_BASE_URL
  87. if not api_key:
  88. print("✗ GEMINI_API_KEY 未设置,跳过")
  89. sys.exit(1)
  90. print(f" API Key: {api_key[:6]}***")
  91. # 实际使用的 URL(会自动添加 /v1)
  92. actual_url = base_url if base_url and base_url.endswith("/v1") else (base_url + "/v1" if base_url else "http://35.164.11.19:3887/v1")
    • Warning: Talks to a raw IP address or throwaway host, where malware is often staged
    • Line 108 on GitHub
  93. print(f" Base URL: {actual_url}")
  94. client = Gemini(api_key=api_key, base_url=base_url)
  95. prompt = "用一句话介绍你自己。"
  96. print(f" Prompt: {prompt}")
  97. for model in MODELS:
  98. print(f"\n--- 测试模型: {model} ---")
  99. t0 = time.time()
  100. try:
  101. resp = client.query(prompt, model=model)
  102. elapsed = time.time() - t0
  103. print(f"✓ 响应 ({elapsed:.1f}s): {resp.strip()[:200]}")
  104. except Exception as e:
  105. print(f"✗ 失败: {e}")
skills/aigc-director/aigc-claw/backend/tool/vlm_gemini.py · Bundled script · 159 lines · 1 finding marked
  1. # -*- coding: utf-8 -*-
  2. """
  3. Google Gemini 多模态大模型 API 客户端 (OpenAI 兼容格式)
  4. 支持 gemini-2.5-flash-image, gemini-2.5-pro 等视觉模型
  5. 可用模型:
  6. - gemini-2.5-flash-image (性价比最高)
  7. - gemini-2.5-pro (效果最好)
  8. - gemini-3-pro-preview
  9. - gemini-3-pro-image-preview
  10. """
  11. import os
  12. import time
  13. import base64
  14. from openai import OpenAI
  15. from typing import Dict, List, Optional
  16. class GeminiVLClient:
  17. """
  18. Gemini VLM 客户端,使用 OpenAI 兼容格式调用
  19. """
  20. def __init__(self, api_key: Optional[str] = None, base_url: Optional[str] = None):
  21. """
  22. Gemini 多模态客户端
  23. :param api_key: Gemini API Key
  24. :param base_url: 自定义 Base URL(可选,用于代理)
  25. """
  26. self.api_key = api_key or os.getenv("GEMINI_API_KEY")
  27. default_url = "http://35.164.11.19:3887/v1"
    • Warning: Talks to a raw IP address or throwaway host, where malware is often staged
    • Line 30 on GitHub
  28. self.base_url = base_url or os.getenv("GOOGLE_GEMINI_BASE_URL", default_url)
  29. if self.base_url and not self.base_url.endswith("/v1"):
  30. self.base_url = self.base_url.rstrip("/") + "/v1"
  31. self.client = OpenAI(api_key=self.api_key, base_url=self.base_url)
  32. self.max_attempts = 10
  33. self.max_tokens = 20000
  34. def _encode_image(self, image_path: str) -> str:
  35. """将本地图片编码为 base64"""
  36. abs_path = os.path.abspath(image_path)
  37. with open(abs_path, "rb") as f:
  38. return base64.b64encode(f.read()).decode("utf-8")
  39. def _get_mime_type(self, image_path: str) -> str:
  40. """根据文件扩展名获取 MIME 类型"""
  41. ext = os.path.splitext(image_path)[1].lower()
  42. mime_types = {
  43. ".jpg": "image/jpeg",
  44. ".jpeg": "image/jpeg",
  45. ".png": "image/png",
  46. ".webp": "image/webp",
  47. ".gif": "image/gif"
  48. }
  49. return mime_types.get(ext, "image/jpeg")
  50. def chat(self, text: str, images: List[str], model: str = "gemini-2.5-flash-image",
  51. parameters: Optional[Dict] = None) -> str:
  52. """
  53. 使用 Gemini 进行多模态对话(文本+图片)
  54. :param text: 文本内容
  55. :param images: 图片路径列表(支持本地路径或URL)
  56. :param model: 模型名(如 gemini-2.5-flash-image, gemini-2.5-pro)
  57. :param parameters: 其他API参数
  58. :return: API响应内容
  59. """
  60. # 构建消息格式
  61. content: list = [{"type": "text", "text": text}]
  62. # 处理图片
  63. if images:
  64. for img_path in images:
  65. if img_path.startswith("data:"):
  66. # Base64 数据 URL,直接使用
  67. content.append({
  68. "type": "image_url",
  69. "image_url": {"url": img_path}
  70. })
  71. elif img_path.startswith("http"):
  72. # URL 图片
  73. content.append({
  74. "type": "image_url",
  75. "image_url": {"url": img_path}
  76. })
  77. else:
  78. # 本地图片 - 转为 base64
  79. mime_type = self._get_mime_type(img_path)
  80. base64_data = self._encode_image(img_path)
  81. data_url = f"data:{mime_type};base64,{base64_data}"
  82. content.append({
  83. "type": "image_url",
  84. "image_url": {"url": data_url}
  85. })
  86. messages = [{"role": "user", "content": content}]
  87. attempts = 0
  88. while attempts < self.max_attempts:
  89. try:
  90. # 直接使用模型名
  91. response = self.client.chat.completions.create(
  92. model=model,
  93. messages=messages,
  94. max_tokens=self.max_tokens,
  95. temperature=parameters.get("temperature", 0.7) if parameters else 0.7
  96. )
  97. if response.choices and len(response.choices) > 0:
  98. return response.choices[0].message.content
  99. except Exception as e:
  100. print(f"GeminiVL 请求错误: {e}")
  101. attempts += 1
  102. if attempts < self.max_attempts:
  103. time.sleep(10)
  104. raise Exception("GeminiVL: 达到最大重试次数,仍未获得有效响应。")
  105. if __name__ == "__main__":
  106. import sys
  107. sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  108. from config import Config
  109. # 支持的 VLM 模型列表
  110. MODELS = ["gemini-2.5-flash-image", "gemini-2.0-flash"]
  111. print("=== Gemini VL 多模态可用性测试 ===")
  112. api_key = Config.GEMINI_API_KEY
  113. if not api_key:
  114. print("✗ GEMINI_API_KEY 未设置,跳过")
  115. sys.exit(1)
  116. print(f" API Key: {api_key[:6]}***")
  117. client = GeminiVLClient(api_key=api_key)
  118. # 测试图片(使用示例图片)
  119. img_path = ""
  120. if not os.path.exists(img_path):
  121. print(f"✗ 测试图片不存在: {img_path}")
  122. img_path = "backend/code/result/image/test_avail/test_input.png"
  123. if not os.path.exists(img_path):
  124. print("✗ 跳过图片测试(无测试图片)")
  125. sys.exit(0)
  126. text = "请描述这张图片的内容"
  127. print(f"\n[多模态] Prompt: {text}")
  128. print(f" 图片: {img_path}")
  129. for model in MODELS:
  130. print(f"\n--- 测试模型: {model} ---")
  131. t0 = time.time()
  132. try:
  133. result = client.chat(text=text, images=[img_path], model=model)
  134. elapsed = time.time() - t0
  135. if result:
  136. print(f"✓ 返回结果 ({elapsed:.1f}s): {result[:200]}")
  137. else:
  138. print(f"✗ 返回空结果 ({elapsed:.1f}s)")
  139. except Exception as e:
  140. print(f"✗ 失败: {e}")

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.