feat: image content#3887
Conversation
|
clsoing this out, as we have a new plan. |
|
wait, shit, i thought that was the old PR :D |
badlogic
left a comment
There was a problem hiding this comment.
overall squeaky clean! great job. left some minor comments.
| @@ -0,0 +1,202 @@ | |||
| import OpenAI from "openai"; | |||
There was a problem hiding this comment.
hmmm, i wonder if we should mvoe imagegen provider impls to their own subfolder, to separate them from the normal providers. how do you feel about that @cristinaponcela ?
| return provider.images(model, context, options as ImagesOptions); | ||
| } | ||
|
|
||
| export async function completeImages<TApi extends ImagesApi>( |
| @@ -0,0 +1,111 @@ | |||
| import { beforeEach, describe, expect, it, vi } from "vitest"; | |||
There was a problem hiding this comment.
we'll need an end-to-end test as well. see stream.test.ts as a sort of template.
- list of functions all provider specific tests can call into
- one describe per provider with "sub tests" calling into the functions with a known-good model from that provider
There was a problem hiding this comment.
Makes sense. Done, only 1 describe bc 1 provider (OpenRouter), using Gemini 2.5 flash image preview.
✅ 3728e4b
| @@ -1249,10 +1249,11 @@ Create a new provider file (for example `amazon-bedrock.ts`) that exports: | |||
| - Add credential detection in `env-api-keys.ts` for the new provider | |||
There was a problem hiding this comment.
ai/README.md needs a dedicated section on image generation explaining all the ins and outs and don'ts, following the style of the rest of the README.md.
There was a problem hiding this comment.
✅ 074747c
Do lmk if this needs more detail/ is too verbose, first time writing public docs :3
|
@cristinaponcela I think we should remove The OpenRouter provider sends Let's keep this as a one-shot API only:
Abort support is still needed. The current provider already passes Please also update |
|
looking good, cheers! |
补充缺失条目: - packages/ai: 图片输出功能 (PR earendil-works#3887), Bun WebSocket 代理修复, Fireworks 会话亲和性修复 - packages/tui: 列表项缩进包裹, 复选框渲染, 大文件 markdown 鲁棒性, 图片放置修复 - packages/coding-agent: TTY 异常恢复, .agents 来源保留, 跨包同步图片输出功能 ziye Co-Authored-By: ziye <ziye0180@outlook.com>
…e-outputs feat: image content
This PR adds a new API, closely mirroring the stream API, to support image blocks and image models (via Google/ OpenRouter) so the agent can output images.
With a simple (clanked) extension, you can test in the TUI: