Repository navigation
feat(core): generate images and decisions through catalog models - #59420
Merged
Merged
Conversation
…rail scroll tests (#59400) Co-authored-by: rekram1-node <[email protected]>
Co-authored-by: Daniel Smolsky <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #59190, which defines the endpoints. This wires them up.
Problem
POST /api/experimental/generate/imageand/decisionsdecode their requests and then always fail with 501. Image and decision models are in the catalog, and since #59380 each one points at aproviders/<P>/imagesor/decisionsentrypoint with the samemodel(modelID, settings)contract as chat, but nothing loads or runs them.Change
Smaller pieces:
chat-completionsfirst and the images API second, and would otherwise resolve to the chat package.azure/images,google-vertex/imagesand the three Cloudflare entrypoints build their own URL, so they joinBUILDS_OWN_URLand ignore the catalog's templatedbase_url.usage.costfrom the host's reported cost, so decision results returncost.costis only what the provider reports. Image results have none yet, since per-image prices aren't in the catalog shape.Out of scope
chat-completions). They return 422 until there's an adapter for that./generate/texttoday.Verification
bun run checkpasses; protocol and clientcheck:generatedpass.packages/coretest/generate.test.ts: real catalog-shaped models through the real entrypoints with a fake HTTP client and a recorded OpenRouter System One response:Bearerkey from provider settings, model id; base64 result and token usagethinkingLevelreaches the request body, and a 400 maps toinvalid_requestUnsupportedModelError, an unknown ref givesModelNotFoundErrorpackages/core:test/model-resolver.test.ts,test/plugin,test/models.test.tspass (532).packages/servertest/generate.test.ts: unknown models give 404 on both routes, duplicate question names give 400.packages/ai,packages/plugin,packages/client:bun testpasses.Visual