Skip to content

Conversation

@puyujian
Copy link

No description provided.

puyujian and others added 11 commits November 11, 2025 16:48
…rt routing to image, image-to-image, and video generation

Implements OpenAI chat/message parsing and intelligent routing so the /v1/chat/completions endpoint now fully supports text-to-image, image-to-image, text-to-video, and image-to-video tasks. Unified multimodal input parsing—URLs and base64 images—enables seamless compatibility with OpenAI-style message arrays, including streaming output. Video/image routines, file uploading, and buffer handling are updated for maximum format flexibility. New README guides usage and best practices.

This change unifies the API for all creative tasks through smart message/content analysis, supporting multi-modal prompts and robust parameter options for AI image and video generation.

Closes #59
…l-routing-params

feat(chat): support OpenAI Chat-format compatibility and unified AI multimodal routing
…at requests

Fixes a bug where requests containing both text and images (multimodal prompts)
were incorrectly routed to text-to-image API, causing Jimeng API errors. Now ensures
that prompts are always strings before image generation, and that requests with images
route to the image-to-image endpoint with correct parameters.

- Adds type/structure validation for prompts in chat and image generation functions
- Improves logging for smart routing decisions and debugging
- Provides user-facing and developer-facing error messages for common routing mistakes
- Adds safety net if message parsing yields images but no usable image array
- Deeper warning and info logs added to stream and standard completion handlers

No breaking changes, fixes user-visible API error and prevents malformed requests from being sent.
Fix: Robust image-to-image routing and validation for chat multimodal requests
…e-to-image streaming output

This change adds support for the OpenAI-style `size` parameter to the chat completion API. The size parameter is parsed and mapped to the internal `ratio` parameter, improving compatibility with OpenAI-like clients. Additionally, the streaming output for image-to-image (图生图) generation now omits intermediate text prompts and outputs only the image results, providing a cleaner and less disruptive user experience, especially for non-streaming consumers. These updates enhance third-party API compatibility and result clarity.
- Allow 'size' param to accept direct ratio format (e.g. 3:4) or pixel format (e.g. 1024x1024)
- Ensures smoother API integration for clients who specify ratios directly
…mg-placeholder

feat(chat): support OpenAI size param and clean up 图生图 streaming output
fix(response): 修复 FailureBody 中 httpStatusCode 的默认值逻辑
fix(package): 移除不必要的 peer 属性
fix(yarn): 更新 esbuild 和 rollup 的平台依赖
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