Skip to content

feat(providers): add Evolink image generation provider - #13

Open
EvoLinkAI wants to merge 2 commits into
BytePioneer-AI:mainfrom
EvoLinkAI:feat/evolink-provider
Open

feat(providers): add Evolink image generation provider#13
EvoLinkAI wants to merge 2 commits into
BytePioneer-AI:mainfrom
EvoLinkAI:feat/evolink-provider

Conversation

@EvoLinkAI

Copy link
Copy Markdown

Description

Add a dedicated Evolink provider for image generation via EvoLink.ai API.

EvoLink's image API uses an async submit/poll pattern:

  • Submit: POST https://api.evolink.ai/v1/images/generations → returns task id
  • Poll: GET https://api.evolink.ai/v1/tasks/{task_id}status + results[]

This pattern differs from ClawMate's existing providers (OpenAI-compatible sync, Volcengine ARK sync, Gemini SDK sync), so a dedicated provider is needed — the http-async provider's hardcoded body format and status values are incompatible with EvoLink's API.

Changes (2 files, +329)

File Change
src/core/providers/evolink.ts (new) Dedicated async submit/poll provider
src/core/providers/registry.ts Register evolink type + auto-detection via api.evolink.ai base URL

Provider Features

  • Async task submission with configurable polling interval/timeout
  • Configurable model, size, quality parameters
  • Supports EVOLINK_API_KEY environment variable fallback
  • Auto-detection from baseUrl containing api.evolink.ai
  • Graceful degradation: missing API key creates unavailable provider (no crash)

Available Models

EvoLink offers 20+ image models via a unified API: GPT Image (1.5/2), Midjourney V7, Nano Banana (Beta/Pro), Qwen Image Edit, Seedream (4.0/4.5/5.0 Lite), WAN 2.5, Z Image Turbo, and more.

Config Example

{
  "defaultProvider": "evolink",
  "providers": {
    "evolink": {
      "type": "evolink",
      "apiKey": "sk-...",
      "model": "gpt-image-1.5",
      "size": "1024x1024",
      "quality": "high"
    }
  }
}

Testing

  • ✅ Provider loads and registers successfully
  • ✅ Auto-detection via baseUrl heuristic works
  • ✅ Missing API key creates unavailable provider (no crash)
  • EVOLINK_API_KEY env var fallback works
  • ✅ Manifest consistency check (npm run clawmate:plugin:check) passes
  • ✅ HTTP request format verified (server responds with proper error, not malformed request)

API Documentation


🤖 Generated with Claude Code

Add dedicated Evolink provider supporting EvoLink's async image generation
API (POST /v1/images/generations → poll GET /v1/tasks/{task_id}).

- New evolink.ts: async submit/poll provider with configurable model, size,
  quality; supports EVOLINK_API_KEY env var fallback
- Registry: register 'evolink' type with auto-detection via api.evolink.ai
  base URL heuristic; PROVIDER_CONFIG_INVALID creates unavailable provider

Config example:
  "evolink": {
    "type": "evolink",
    "apiKey": "sk-...",
    "model": "gpt-image-1.5",
    "size": "1024x1024",
    "quality": "high"
  }

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@EvoLinkAI

Copy link
Copy Markdown
Author

✅ 真实验证通过

用真实 EvoLink API key 跑通了完整的端到端生图流程:

curl 直接验证

POST https://api.evolink.ai/v1/images/generations → 200 (task created)
GET  https://api.evolink.ai/v1/tasks/{task_id}   → 200 (polling)

结果:19 次轮询后 status: completed,图片 URL 正常返回。

Provider 代码端到端

createEvolinkProvider({ model: 'gpt-image-1.5', size: '1024x1024', quality: 'medium' })
  → generate({ prompt: 'A fluffy white cat...' })
  → ✅ SUCCESS (39.8s)

生成图片:
evo-test

本地校验汇总

检查项 状态
Provider 加载注册
baseUrl 自动检测
缺失 API key → unavailable
EVOLINK_API_KEY 环境变量回退
异步 submit/poll 轮询
status: processing (进行中)
status: completed (成功)
npm run clawmate:plugin:check
真实 API 端到端

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant