Skip to content

docs: use non-deprecated fields in generate examples - #173

Merged
davidhu2000 merged 3 commits into
mainfrom
docs/non-deprecated-example-fields
Sep 24, 2026
Merged

davidhu2000 merged 3 commits into
mainfrom
docs/non-deprecated-example-fields

Conversation

@davidhu2000

@davidhu2000 davidhu2000 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

These README generate examples feed web-app's API code samples through the sample sync automation. Several used deprecated fields or didn't match the method signature.

What (docs only, no code changes)

  • ai_image_generator, text_to_video (sync examples): orientation → aspect_ratio; resolution="auto" → "1k".
  • ai_image_upscaler: deprecated style.enhancement → style={"mode": "balanced"}.
  • character_replace: examples wrapped every field in data={...}, which generate() doesn't accept (TypeError). They now pass keyword arguments.

The async examples for ai_image_generator and text_to_video still pass orientation, because the generated async generate() still requires it. That needs a fix in the generated code, not in these docs.

🤖 Generated with Claude Code

davidhu2000 and others added 3 commits September 23, 2026 20:27
- ai_image_generator: orientation -> aspect_ratio, resolution "auto" -> "1k"
- ai_image_upscaler: style.enhancement -> style.mode
- text_to_video: orientation -> aspect_ratio
- character_replace: pass fields as kwargs instead of an unsupported data= dict
- make orientation optional in async text_to_video/ai_image_generator generate()
  so the examples run without it; widen generate() resolution hint to match create()

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reverts the client.py edits. Async generate() still requires orientation,
so the async examples keep it until the generated signature changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@davidhu2000
davidhu2000 merged commit 295e11b into main Sep 24, 2026
6 checks passed
@davidhu2000
davidhu2000 deleted the docs/non-deprecated-example-fields branch September 24, 2026 03:34
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