明确图片目标计算函数返回的硬上限与软目标

This commit is contained in:
creatixchu committed 2026-11-19 10:19:49 +08:00
1 parent ee7813eecc
commit 08b7d59ec8
2 files changed
+5 -6

No files matched your search

@@ -54,7 +54,7 @@ declare module '@deepseek-ai/cordis' {
* Project a configured screenshot target onto one stored image.
* @param configured - Validated `screenshotTarget`.
* @param image - Durable normalized screenshot.
* @returns The request target for that image: the long edge capped at the configured value, the configured byte budget.
* @returns Maximum screenshot dimensions, with the configured byte value as both the hard limit and the soft target.
*/
export function fixedScreenshotTarget(configured: CuaScreenshotTargetConfig, image: ImageAttachmentRef): ImageRequestTarget {
return {
@@ -42,13 +42,12 @@ export function resolveRequestImageTargetBytes(model: DeepSeekCatalogModel): num
}
/**
* Resolve the deterministic request target one DeepSeek model route chooses
* for one source image: the published token grid unless the model overrides
* it with a pixel budget, then the provider per-side limit, then the route's
* encoded-byte target. Small images are never enlarged.
* Resolve maximum request dimensions from the published token grid or the
* model's pixel budget, capped by the provider per-side limit. Small images
* are never enlarged. Byte limits remain separate from the dimension bounds.
* @param model - Advertised model route and its optional image overrides.
* @param source - intrinsic dimensions of the normalized attachment.
* @returns Complete request dimensions and encoded-byte target.
* @returns Maximum request dimensions, the fixed provider hard byte limit, and the model's soft encoded-byte target.
* @internal
*/
export function resolveRequestImageTarget(