anthropic support - dymanic window size / window popup (#2284)

This commit is contained in:
Shuchang Zheng
2025-05-04 00:40:16 -07:00
committed by GitHub
parent a851e8fdd8
commit 8b834436b5
4 changed files with 36 additions and 6 deletions

View File

@@ -22,7 +22,9 @@ def get_resize_target_dimension(
ratio = window_size["width"] / window_size["height"]
for dimension in max_scaling_targets.values():
if abs(dimension["width"] / dimension["height"] - ratio) < 0.02:
return dimension
if dimension["width"] < window_size["width"]:
# we only return the dimension if it's smaller than the window size
return dimension
return window_size