pi-media-models 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +62 -128
  2. package/SKILL.md +115 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,117 +1,83 @@
1
1
  # pi-media-models
2
2
 
3
- Pi Coding Agent 的 Provider-neutral 多模态生成 Extension。只注册 6 个稳定 Tool;模型和 Provider 的变化被隔离在 Capability Router 与 Adapter 内。
3
+ [![npm version](https://img.shields.io/npm/v/pi-media-models.svg)](https://www.npmjs.com/package/pi-media-models)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- ## 架构
6
+ **Provider-neutral multimodal generation extension for Pi Coding Agent.**
6
7
 
7
- ```text
8
- Pi Tool
9
- → Capability Router
10
- → Provider Adapter (Provider 与模型厂商分离)
11
- → MediaJob (poll/backoff/timeout/AbortSignal/cancel-if-supported)
12
- → Normalized Result
13
- → Download (~/.pi/agent/media/outputs, .part + atomic rename)
14
- ```
15
-
16
- Provider 原始大 JSON 不进入 LLM 上下文。Tool 只返回 Provider/模型、capability、任务 ID(如有)、本地文件路径或 STT 文本。
8
+ This extension seamlessly bridges Pi's reasoning capabilities with top-tier AI media generation platforms. It abstracts away complex multi-part uploads, background task polling, CDN hosting, and API differences, exposing exactly **6 unified tools** for the agent.
17
9
 
18
- ## Tools
10
+ ## ✨ Features
19
11
 
20
- - `media_models`:列出 Provider、已知模型/厂商和显式 capability
21
- - `image_generate`:文生图、图生图、多参考图。
22
- - `image_edit`:图片编辑、多图编辑、mask(按 Provider 支持情况)。
23
- - `video_generate`:统一参数 `prompt`、`provider`、`model`、`inputImage`、`endImage`、`referenceImages`、`referenceVideos`、`referenceAudios`、`inputVideo`、`duration`、`resolution`、`aspectRatio`、`seed`、`generateAudio`、`operation`、`providerOptions`;自动映射 T2V/I2V/首尾帧/reference/edit/extend。
24
- - `audio_generate`:音乐或模型原生音频生成(不是 TTS)。
25
- - `speech_generate`:`operation=tts|stt`。
12
+ - **Unified Interface**: One request format (`provider`, `model`, `prompt`, `referenceImages`, etc.) maps automatically to the correct capability across providers.
13
+ - **Auto-Download**: Output media (images, videos, audio) is automatically downloaded and saved to a local directory (`~/.pi/agent/media/outputs/`) using atomic `.part` renames. LLM context remains pristine and only receives local file paths.
14
+ - **Smart Input Resolution**: Pass local paths (`C:/...`), file URIs (`file://`), standard URLs (`http(s)://`), or base64 (`data:...`). The router transparently handles multipart uploads, base64 encoding, or CDN pre-uploading (e.g., for `fal.ai`).
15
+ - **Resilient Polling**: Advanced `MediaJob` processing handles asynchronous Long-Running Operations (LROs), 429 rate limits (respecting `Retry-After`), and timeouts. Supports remote job cancellation where supported by the provider.
26
16
 
27
- 所有输入文件字段接受本地路径、`file://`、`http(s)://` data URI。Adapter 会按接口转为 data URI、base64、multipart 或上传 URL。fal 本地输入先上传 fal CDN;需要公网 URL 且没有文档化上传接口的 Provider 会使用 data URI,最终是否接受仍取决于具体模型。
17
+ ## 📦 Installation
28
18
 
29
- ## Provider
30
-
31
- | Provider | Adapter | 能力摘要 | Key |
32
- |---|---|---|---|
33
- | OpenRouter | `OpenRouterAdapter` | Images API、视频异步任务、TTS | `OPENROUTER_API_KEY` |
34
- | fal.ai | `FalAdapter` | 任意 endpoint 的图片/视频/音频/TTS/STT;Queue + CDN upload | `FAL_KEY` |
35
- | 百炼/DashScope | `DashScopeAdapter` | Qwen/Wan 图片、Wan 视频参考/编辑/延长/原生音频、Fun-Music、TTS/STT | `DASHSCOPE_API_KEY` |
36
- | QwenCloud | `DashScopeAdapter`(国际 endpoint) | 同 DashScope 协议 | `DASHSCOPE_API_KEY` |
37
- | OpenAI API | `OpenAIAdapter` | 图片生成/编辑、TTS/STT;**不实现 Sora/OpenAI Video** | `OPENAI_API_KEY` |
38
- | Gemini API | `GoogleMediaAdapter` | Gemini/Imagen 图片、Veo、Lyria、TTS/STT | `GEMINI_API_KEY` |
39
- | Vertex AI | `GoogleMediaAdapter` | ADC、Imagen/Gemini、Veo、Lyria、TTS/STT | ADC |
40
- | xAI | 独立 `XAIAdapter` | Grok Imagine 图片生成/多图编辑、T2V/I2V/reference-to-video、video edit/extend | `XAI_API_KEY` |
41
- | Atlas | 独立 `AtlasAdapter` | 文档化图片同步/异步/编辑、视频任务及 reference image/video/audio、原生音频 | `ATLAS_API_KEY` |
42
- | 自定义 OpenAI-compatible | `CustomOpenAICompatibleAdapter` | 仅用户显式声明的 model/capability/endpoint | 用户声明的 env 名 |
19
+ This extension is built for the **Pi Coding Agent**. It includes both the executable extension logic and the LLM `SKILL.md` prompt context.
43
20
 
44
- ## 安装
45
-
46
- 本目录已位于 Pi 全局自动发现位置:
21
+ Install natively inside your Pi environment:
47
22
 
48
23
  ```bash
49
- cd ~/.pi/agent/extensions/pi-media
50
- npm install
51
- npm run check
52
- ```
53
-
54
- 在 Pi 中运行 `/reload`,或启动时显式加载:
24
+ # Install via NPM (Recommended)
25
+ pi install npm:pi-media-models
55
26
 
56
- ```bash
57
- pi -e ~/.pi/agent/extensions/pi-media/index.ts
27
+ # Or install directly from GitHub
28
+ pi install git:github.com/luffysolution-svg/pi-media-models
58
29
  ```
59
30
 
60
- 生成结果默认立即下载到:
31
+ Once installed, simply type `/reload` in your active Pi session to apply the extension.
61
32
 
62
- ```text
63
- ~/.pi/agent/media/outputs/
64
- ```
33
+ ## 🔌 Supported Providers
34
+
35
+ | Provider | Adapter | Supported Capabilities | Required Env Var |
36
+ |---|---|---|---|
37
+ | **OpenRouter** | `OpenRouterAdapter` | Image Generation, Async Video, TTS | `OPENROUTER_API_KEY` |
38
+ | **fal.ai** | `FalAdapter` | Images, Video, Audio, TTS, STT (Queue/CDN integration) | `FAL_KEY` |
39
+ | **Google Gemini API** | `GoogleMediaAdapter` | Gemini/Imagen, Veo, Lyria, TTS, STT | `GEMINI_API_KEY` |
40
+ | **Google Vertex AI** | `GoogleMediaAdapter` | ADC, Imagen/Gemini, Veo, Lyria, TTS, STT | ADC credentials |
41
+ | **DashScope / 百炼** | `DashScopeAdapter` | Qwen/Wan Images, Wan Video, Fun-Music, TTS/STT | `DASHSCOPE_API_KEY` |
42
+ | **QwenCloud** | `DashScopeAdapter` | Same as DashScope (International endpoints) | `DASHSCOPE_API_KEY` |
43
+ | **OpenAI API** | `OpenAIAdapter` | Image Gen/Edit (DALL-E), TTS, STT (Whisper) | `OPENAI_API_KEY` |
44
+ | **xAI (Grok Imagine)** | `XAIAdapter` | Image Gen/Edit, T2V/I2V, Reference-to-Video, Edit, Extend | `XAI_API_KEY` |
45
+ | **Atlas API** | `AtlasAdapter` | Sync/Async Image Gen & Edit, Video LROs | `ATLAS_API_KEY` |
65
46
 
66
- ## 配置
47
+ ## ⚙️ Configuration
67
48
 
68
- API Key 只从环境变量读取,不写 JSON。可选配置:
49
+ API Keys can be provided as standard environment variables. Alternatively, you can configure them (along with advanced options) via JSON configuration.
69
50
 
70
- - 全局:`~/.pi/agent/media-models.json`
71
- - 项目:`<repo>/.pi/media-models.json`(只有 Pi 信任项目后才读取)
51
+ **Configuration Path**:
52
+ `~/.pi/agent/media-models.json` (Global) or `<project_root>/.pi/media-models.json` (Project-specific).
72
53
 
73
54
  ```json
74
55
  {
75
- "outputDir": "D:/media-output",
56
+ "outputDir": "/path/to/custom/output/directory",
76
57
  "providerOptions": {
58
+ "vertex": {
59
+ "credentialsFile": "/path/to/vertex-service-account.json",
60
+ "project": "my-gcp-project",
61
+ "location": "us-central1"
62
+ },
77
63
  "dashscope": {
78
- "baseUrl": "https://WORKSPACE_ID.cn-beijing.maas.aliyuncs.com"
64
+ "baseUrl": "https://<workspace_id>.cn-beijing.maas.aliyuncs.com"
79
65
  }
80
66
  },
81
67
  "customProviders": [
82
68
  {
83
- "id": "my-media",
84
- "name": "My explicit media gateway",
85
- "baseUrl": "https://media.example.com/v1",
86
- "apiKeyEnv": "MY_MEDIA_API_KEY",
69
+ "id": "my-custom-ai",
70
+ "name": "Internal AI Gateway",
71
+ "baseUrl": "https://api.internal.com/v1",
72
+ "apiKeyEnv": "MY_INTERNAL_KEY",
87
73
  "auth": "bearer",
88
74
  "models": [
89
75
  {
90
- "id": "vendor/image-model",
91
- "vendor": "vendor",
92
- "capabilities": ["image.text_to_image"],
93
- "endpoints": {
94
- "image.text_to_image": "/images/generations"
95
- }
96
- },
97
- {
98
- "id": "vendor/video-model",
99
- "vendor": "vendor",
76
+ "id": "internal-video-pro",
77
+ "vendor": "internal",
100
78
  "capabilities": ["video.text_to_video"],
101
79
  "endpoints": {
102
- "video.text_to_video": {
103
- "path": "/videos",
104
- "format": "json",
105
- "async": {
106
- "idPath": "id",
107
- "statusPath": "status",
108
- "pollEndpoint": "/videos/{id}",
109
- "resultPath": "result",
110
- "cancelEndpoint": "/videos/{id}/cancel",
111
- "successValues": ["completed"],
112
- "failureValues": ["failed", "cancelled"]
113
- }
114
- }
80
+ "video.text_to_video": "/videos/generations"
115
81
  }
116
82
  }
117
83
  ]
@@ -120,55 +86,23 @@ API Key 只从环境变量读取,不写 JSON。可选配置:
120
86
  }
121
87
  ```
122
88
 
123
- 自定义 Provider **不会**请求或信任 `GET /models` 来推断能力;每个模型必须同时声明 `capabilities` 与对应 `endpoints`。
124
-
125
- ## 使用示例
126
-
127
- 先调用 `media_models` 查看 capability,再调用统一 Tool。例如:
128
-
129
- ```json
130
- {
131
- "provider": "xai",
132
- "model": "grok-imagine-video-1.5",
133
- "prompt": "A paper boat drifting down a rainy street",
134
- "inputImage": "C:/assets/boat.png",
135
- "duration": 8,
136
- "resolution": "720p",
137
- "aspectRatio": "16:9",
138
- "generateAudio": true
139
- }
140
- ```
141
-
142
- Atlas 多模态 reference-to-video:
143
-
144
- ```json
145
- {
146
- "provider": "atlas",
147
- "model": "bytedance/seedance-2.0/text-to-video",
148
- "prompt": "Product launch film",
149
- "referenceImages": ["https://example.com/product.png"],
150
- "referenceVideos": ["https://example.com/motion.mp4"],
151
- "referenceAudios": ["https://example.com/voice.mp3"],
152
- "generateAudio": true
153
- }
154
- ```
89
+ *Note: Custom OpenAI-compatible endpoints require explicit capability mapping in the configuration, avoiding hallucinated unsupported paths from standard `/models` probing.*
155
90
 
156
- ## 安全与可靠性
91
+ ## 🛠️ Exposed Tools
157
92
 
158
- - Key 仅取环境变量;错误消息自动脱敏,不记录请求头或完整 Provider JSON。
159
- - HTTP 请求有超时;幂等请求对 429/5xx 退避重试并尊重 `Retry-After`。为避免重复计费,非幂等生成 POST 默认不自动重试。
160
- - 异步任务统一支持 polling、backoff、总超时和 `AbortSignal`;仅在 Provider 文档明确提供 cancel 时调用远端取消(fal、DashScope、自定义显式 cancel)。
161
- - 测试进程设置 `PI_MEDIA_TEST_MODE=1`,未注入 mock fetch 时真实网络请求会直接失败,避免付费误调用。
93
+ The extension registers the following unified tools for the reasoning agent:
162
94
 
163
- ## 已知限制
95
+ 1. `media_models`: Lists providers, configured models, and capabilities.
96
+ 2. `image_generate`: Generate images from text, image, or multiple reference inputs.
97
+ 3. `image_edit`: Edit existing images (supports masks and multiple references).
98
+ 4. `video_generate`: Generates, edits, or extends videos. Automatically maps inputs (`referenceImages`, `inputVideo`, `duration`, `generateAudio`, etc.) to the provider's exact capability.
99
+ 5. `audio_generate`: Generate music or raw audio (separate from TTS).
100
+ 6. `speech_generate`: Handle TTS (Text-to-Speech) and STT (Speech-to-Text).
164
101
 
165
- - 媒体模型与参数变化很快;`media_models` 中内置列表是已知入口,不是实时价格/可用性保证。具体模型、区域和账户权限仍由 Provider 校验。
166
- - fal 的输入/输出 schema 按 endpoint 变化,通用字段可通过 `providerOptions` 覆盖;应按所选 endpoint 文档传原生字段。
167
- - xAI 官方未公开视频任务 cancel;中止只停止本地 polling。自定义音频 reference 可能要求 trusted-partner 权限。
168
- - Gemini/Veo 和 Atlas 未公开视频任务 cancel。Atlas 文档未声明独立 TTS/STT、视频 edit/extend,因此不虚构这些 capability。
169
- - Vertex Veo REST 使用 `:fetchPredictOperation`;GCS 输出需要调用身份有对象读取权限。建议配置 Provider 原生输出到可读 GCS 或返回 base64。
170
- - 本仓库测试不进行真实付费生成;真实 Key、配额、内容策略和临时 URL 生命周期需在用户明确授权后做 smoke test。
102
+ ## 🔒 Security & Privacy
171
103
 
172
- ## 文档基线
104
+ - **No Key Logging**: API keys and Bearer tokens are redacted (`[REDACTED]`) from all error logs and HTTP outputs before being returned to the LLM.
105
+ - **Stateless Configuration**: Configuration does not hardcode user secrets if initialized via environment variables.
173
106
 
174
- Atlas 以用户指定的 <https://doc.aixoras.com/jieruwendang/1-jiekouwendang.html> 为准。其余实现基于 OpenAI、OpenRouter、fal.ai、Alibaba/QwenCloud、Google/Vertex 和 xAI 官方文档(检查日期:2026-08-31)。
107
+ ---
108
+ *Built for production multimodal orchestration inside Pi.*
package/SKILL.md CHANGED
@@ -1 +1,115 @@
1
- ---\nname: pi-media\ndescription: 统一的多模态媒体生成能力(文生图、图生图、图片编辑、文生视频、图生视频、视频延长、原声音频、TTS、STT等)。支持 OpenAI, Gemini, Vertex, xAI, Atlas, DashScope, QwenCloud, fal.ai, OpenRouter 等。当用户要求生成、编辑媒体内容时,使用该技能提供的媒体生成工具。\n---\n\n# Pi Media Models (Multimodal Generation)\n\nThis extension provides a unified, provider-neutral set of tools to generate, edit, and manipulate multimodal content (images, videos, audio, speech) across leading AI API providers.\n\n## 核心工作流 (Core Workflow)\n\n当你收到用户的多模态生成、编辑需求(如“画一张图”、“生成一段视频”、“把这段话读出来”等)时,请遵循以下步骤:\n\n1. **确认模型和能力**:\n 如果用户没有指定具体的模型,或者你不确定哪个平台支持当前操作,请先调用 `media_models` 工具,查看当前已配置(`configured: true`)的 Provider 以及它们支持的 capabilities。\n *提示:绝不要凭空捏造模型名称或能力,一定要查阅 `media_models` 返回的支持列表。*\n\n2. **调用生成工具**:\n 根据任务类型,调用对应的生成工具:\n - `image_generate`:用于生成全新的图片、或者带有参考图的生成。\n - `image_edit`:用于编辑现有图片(支持局部重绘、背景替换等,取决于平台)。\n - `video_generate`:用于文生视频、图生视频、首尾帧视频、参考视频、视频编辑、视频延长。\n - `audio_generate`:用于生成音乐、音效或模型原生的声音表达。\n - `speech_generate`:用于传统的 TTS(文字转语音)或 STT(语音转文字)。\n\n3. **处理输入文件 (Input Files)**:\n 如果用户提供了参考图片、音频或视频的**本地绝对路径**,或者是公网 URL,请直接将它们填入 `inputImage`、`referenceImages`、`inputVideo` 等参数中。底层的媒体路由会自动处理路径解析、文件读取、Multipart 构建甚至 CDN 预先上传(例如针对 fal.ai)。你不需要自己去读文件内容并转换为 Base64。\n\n4. **输出产物 (Output)**:\n 所有的工具调用都会**自动下载**生成的媒体文件,并将其保存在本地磁盘(通常在 `~/.pi/agent/media/outputs/`)。工具的返回结果会包含这些绝对路径。你只需要在回复中清晰地将这个路径展示给用户即可,不需要做额外的文件提取操作。\n\n## 可用参数指南\n\n对于 `video_generate` 或其他多模态生成任务,你可能需要使用丰富的控制参数:\n* `prompt`: 必需。描述你想要的画面或声音。\n* `aspectRatio`: 画面比例,如 \"16:9\", \"9:16\", \"1:1\" 等。\n* `resolution`: 画面分辨率或尺寸,如 \"720p\", \"1080p\", \"1024x1024\"。\n* `duration`: 视频或音频的时长(秒),如 5, 8。\n* `generateAudio`: 布尔值,用于那些同时支持生成画面的伴随音效的模型(如 xAI, Veo, Atlas)。\n* `providerOptions`: 如果某个特定 Provider 有其独占的高级参数(例如 fal.ai 的 endpoints 专属参数,或者设置单独的 `apiKey`),可以放在这里。例如 `{\"apiKey\": \"sk-...\"}`。\n\n## API Key 配置说明\n\n如果用户询问如何配置密钥,请告诉他们有两种方式:\n\n1. **系统环境变量**:直接 export 对应的 KEY,如 `OPENAI_API_KEY`, `FAL_KEY`, `XAI_API_KEY`, `GEMINI_API_KEY`, `DASHSCOPE_API_KEY`, `ATLAS_API_KEY`,或者用于 Vertex 的 `GOOGLE_APPLICATION_CREDENTIALS`。\n2. **配置文件 (media-models.json)**:在 `~/.pi/agent/media-models.json` (或项目下的 `.pi/media-models.json`) 中,可以直接配置特定厂商的 `apiKey`。\n ```json\n {\n \"providerOptions\": {\n \"xai\": {\n \"apiKey\": \"xai-xxxxxxxx\"\n },\n \"vertex\": {\n \"credentialsFile\": \"C:/path/to/vertex-service-account.json\",\n \"project\": \"my-gcp-project\"\n }\n }\n }\n ```\n 此方法方便在项目中进行独立配置,而不会污染全局环境变量。\n
1
+ ---
2
+ name: pi-media
3
+ description: Multimodal media generation for Pi — images, video, audio, and speech across OpenAI, Gemini, Vertex AI, xAI, Atlas, DashScope, fal.ai, and OpenRouter. Use whenever the user asks to generate, edit, or transform media content of any kind.
4
+ ---
5
+
6
+ # Pi Media Models
7
+
8
+ This skill activates the `pi-media-models` extension, which exposes six unified tools for multimodal generation across all configured providers. Read this skill before making any media tool call.
9
+
10
+ ## Available Tools
11
+
12
+ | Tool | When to use |
13
+ |---|---|
14
+ | `media_models` | List available providers, models, and capabilities |
15
+ | `image_generate` | Generate images from text or reference images |
16
+ | `image_edit` | Edit an existing image (inpainting, style, background) |
17
+ | `video_generate` | Text-to-video, image-to-video, extend, or edit video |
18
+ | `audio_generate` | Generate music or raw audio (not TTS) |
19
+ | `speech_generate` | TTS (text → speech) or STT (audio → transcript) |
20
+
21
+ ## Workflow
22
+
23
+ ### 1. Discover what is configured
24
+
25
+ When the user has not specified a provider and model, call `media_models` first to see which providers have `configured: true` and which capabilities they support. Never invent model names.
26
+
27
+ ```
28
+ media_models({ capability: "image.text_to_image" })
29
+ ```
30
+
31
+ ### 2. Call the right tool
32
+
33
+ Pick the tool that matches the request, then pass `provider`, `model`, and `prompt` at minimum. Add optional parameters as needed.
34
+
35
+ ```
36
+ image_generate({
37
+ provider: "fal",
38
+ model: "fal-ai/flux/schnell",
39
+ prompt: "a sunset over misty mountains",
40
+ aspectRatio: "16:9"
41
+ })
42
+ ```
43
+
44
+ ### 3. Pass input files as-is
45
+
46
+ Do **not** read files yourself or convert them to base64. The extension handles all file resolution internally. Pass:
47
+
48
+ - Absolute local path: `/Users/alice/photo.jpg` or `C:\Users\alice\photo.jpg`
49
+ - File URI: `file:///Users/alice/photo.jpg`
50
+ - Remote URL: `https://example.com/image.png`
51
+ - Data URI: `data:image/png;base64,...`
52
+
53
+ ```
54
+ image_edit({
55
+ provider: "openai",
56
+ model: "gpt-image-1",
57
+ prompt: "remove the background",
58
+ inputImage: "/Users/alice/photo.jpg"
59
+ })
60
+ ```
61
+
62
+ ### 4. Report the output path
63
+
64
+ All generated media is automatically downloaded to `~/.pi/agent/media/outputs/`. The tool returns local `path` values — show these to the user directly.
65
+
66
+ ## Common Parameters
67
+
68
+ | Parameter | Description |
69
+ |---|---|
70
+ | `provider` | Provider id: `openai`, `gemini`, `vertex`, `xai`, `atlas`, `dashscope`, `qwencloud`, `fal`, `openrouter` |
71
+ | `model` | Exact model id as returned by `media_models` |
72
+ | `prompt` | Required. Describe the desired output |
73
+ | `aspectRatio` | `"16:9"`, `"9:16"`, `"1:1"`, `"4:3"`, etc. |
74
+ | `resolution` | `"1024x1024"`, `"720p"`, `"1080p"` |
75
+ | `duration` | Seconds (number). For video and audio |
76
+ | `generateAudio` | `true` to include audio track with video (xAI, Veo, Atlas) |
77
+ | `referenceImages` | Array of image inputs for style or subject reference |
78
+ | `inputImage` | Single input image for edit tasks |
79
+ | `inputVideo` | Input video for extend or edit tasks |
80
+ | `seed` | Integer seed for reproducibility |
81
+ | `providerOptions` | Provider-specific overrides (e.g. `{ "async": false }`) |
82
+
83
+ ## Key Configuration
84
+
85
+ If the user asks how to set up API keys, there are two methods:
86
+
87
+ **Environment variables** (any shell or system env):
88
+
89
+ | Provider | Variable |
90
+ |---|---|
91
+ | OpenAI | `OPENAI_API_KEY` |
92
+ | fal.ai | `FAL_KEY` |
93
+ | Gemini | `GEMINI_API_KEY` |
94
+ | Vertex AI | `GOOGLE_APPLICATION_CREDENTIALS` (ADC) |
95
+ | xAI | `XAI_API_KEY` |
96
+ | DashScope / QwenCloud | `DASHSCOPE_API_KEY` |
97
+ | OpenRouter | `OPENROUTER_API_KEY` |
98
+ | Atlas | `ATLAS_API_KEY` |
99
+
100
+ **Config file** (`~/.pi/agent/media-models.json` or `.pi/media-models.json` in the project root):
101
+
102
+ ```json
103
+ {
104
+ "outputDir": "/path/to/output",
105
+ "providerOptions": {
106
+ "xai": { "apiKey": "xai-..." },
107
+ "vertex": {
108
+ "credentialsFile": "/path/to/service-account.json",
109
+ "project": "my-gcp-project"
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ Keys in `providerOptions` take precedence over environment variables for that provider.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-media-models",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Provider-neutral multimodal generation tools for Pi Coding Agent",
6
6
  "pi": {