Skip to content

feat: add ali qwen models#596

Merged
zijiren233 merged 1 commit into
labring:mainfrom
zijiren233:ali-models
May 27, 2026
Merged

feat: add ali qwen models#596
zijiren233 merged 1 commit into
labring:mainfrom
zijiren233:ali-models

Conversation

@zijiren233
Copy link
Copy Markdown
Member

No description provided.

@zijiren233 zijiren233 merged commit 1854775 into labring:main May 27, 2026
15 checks passed
@zijiren233 zijiren233 requested a review from Copilot May 27, 2026 16:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands Alibaba (Ali) Qwen model support by adding many new builtin model definitions (including Qwen 3 / VL / Omni variants) and introducing an input_media usage/price condition flag so pricing can differentiate pure-text vs multimodal requests across backend logic and the web UI.

Changes:

  • Add input_media as a first-class conditional pricing and usage-context signal (core + web), including display and editing support in the UI.
  • Extend Ali adaptor to derive InputMedia / InputVideo / OutputAudio usage context from both usage tokens and request bodies, and apply sensible defaults for pricing selection.
  • Greatly expand core/relay/adaptor/ali/constants.go with additional Qwen/Qwen-VL/Qwen-Omni model configs and update/validate their conditional pricing.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
web/src/validation/model.ts Extends zod validation for price conditions to accept input_media.
web/src/types/model.ts Adds input_media to the PriceCondition TypeScript type.
web/src/types/log.ts Adds input_media to the log usage-context type for UI rendering.
web/src/feature/model/components/ModelTable.tsx Wires an “edit from builtin” path into the model dialog flow.
web/src/feature/model/components/BuiltinModelsDialog.tsx Adds per-row actions (create/edit/import) for builtin models and introduces row-level import state.
web/src/feature/log/components/ExpandedLogContent.tsx Displays input_media in expanded log usage context.
web/src/components/price/PriceFormFields.tsx Adds an Input Has Media selector to conditional pricing form fields.
web/src/components/price/PriceDisplay.tsx Includes input_media in conditional-price summaries.
web/public/locales/zh/translation.json Adds i18n strings for builtin-model actions and inputMedia labels (ZH).
web/public/locales/en/translation.json Adds i18n strings for builtin-model actions and inputMedia labels (EN).
core/relay/adaptor/ali/constants.go Adds/updates a large set of Ali Qwen model definitions and conditional prices (incl. InputMedia / OutputAudio cases).
core/relay/adaptor/ali/constants_test.go Adds validation for all Ali model conditional prices and tests Omni media/audio pricing behavior and request detection.
core/relay/adaptor/ali/chat.go Populates Ali chat UsageContext fields (input media/video + output audio), with fallbacks from request body and defaults for pricing.
core/model/usage.go Adds InputMedia to PriceCondition/UsageContext and integrates it into matching, specificity, fallback, and validation logic.
core/model/usage_test.go Adds unit coverage for selecting/validating conditional prices involving InputMedia.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

className="h-7 px-2 text-xs"
onClick={(event) => {
event.stopPropagation();
onEditFromBuiltin(model);
Comment on lines +293 to +297
const handleAddBuiltin = async (row: BuiltinModelRow) => {
const rowKey = getBuiltinModelRowKey(row);
setSavingRowKey(rowKey);

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants