Repository navigation
Add Requesty as an image generation provider - #17
Thibaultjaigu wants to merge 2 commits into
Conversation
|
Thanks for the contribution — adding Requesty through the provider registry is a reasonable fit, and the response/data-URL path broadly matches the existing OpenRouter integration. I don't think this is merge-ready yet, though. Recommendation: request changes / do not merge yet. Blocking
Non-blocking improvements
The README/CONFIG/DISCOVERY/AGENT-GUIDE/IMAGE_PROVISIONERS/CHANGELOG coverage is otherwise in the right areas. Once the API IDs, sizing semantics, rebase, and contract tests are fixed, this should be straightforward to re-review. |
81aed40 to
485fe2a
Compare
|
Thanks for the detailed review, all of it was fair. Everything below is in 485fe2a on top of a rebase onto current 1. Rebase. Rebased onto 2. Model ids and payload. I checked the live catalog ( 3. Size mapping. 4. Coverage and gates. Added:
Ran on the rebased head: Non blocking items.
Docs updated to the same contract: |
485fe2a to
d18ce87
Compare
Mirror the existing OpenRouter image provider to add Requesty (https://router.requesty.ai/v1), an OpenAI-compatible router that serves image models via /chat/completions. Adds a dedicated requesty provider, registry entry (verified image models), factory case, tests, and docs. Signed-off-by: Thibault Jaigu <thibault.jaigu@gmail.com>
Address review feedback on the Requesty image provider. Models: register the ids the Requesty router actually serves (vertex/gemini-3.1-flash-image as default, vertex/gemini-3-pro-image, vertex/gemini-2.5-flash-image) instead of the -preview ids. Request: drop the OpenRouter modalities field and always send image_config with aspect_ratio and image_size, matching docs.requesty.ai/features/image-generation. Sizes: replace the reused OpenRouter size mapping with a Requesty specific parser. IMAGE_SIZE accepts an aspect ratio, a 1K/2K/4K tier, or an exact WIDTHxHEIGHT from the Requesty dimension table; anything else is a ConfigError instead of a silent substitution. Default is 1:1 at 1K, which is what Requesty applies when image_config is omitted. Errors: keep the router message and code (string or numeric) in the user facing message, add 403 forbidden and 402 payment_required as separate classes, map 404 to model_not_found and 400 to bad_request, and trim a trailing slash from a custom base URL. Tests: contract coverage for the request body, the full dimension table, unsupported size rejection, malformed JSON and data URLs, every error class, requesty/rq factory and registry lookups, config defaults for both names, and providers show rq --json. Docs: IMAGE_PROVISIONERS.md, CONFIG.md, FAQ.md and CHANGELOG updated to the same contract.
d18ce87 to
59fc03a
Compare
|
Rebased onto current main (fce5fa3, v3.8.0). The only conflict was CHANGELOG.md, and the Requesty entry stays under [Unreleased] above 3.8.0. The code is unchanged from the last round, so the review points are still covered: vertex/gemini-3.1-flash-image as the default, no modalities field, the Requesty size table with rejection of unsupported sizes, the trailing slash trim and the separate 402/403/404 error classes. Ran on the new head: gofmt -l . (clean), go vet ./..., GOCACHE=/tmp/md2wechat-go-build go test -count=1 ./... (all green) and make quality-gates (OK, golangci-lint 2.5.0 with 0 issues, versions aligned at 3.8.0, release-check OK). |
This adds Requesty as an image provider through the existing provider registry, available as
requestyorrq.Requesty (
https://router.requesty.ai/v1) is an OpenAI compatible router that serves image models via/chat/completions. The response carries the generated image as a base64 data URL inchoices[0].message.images[0].image_url.url, which is what this provider parses. HTTPS image URLs are not part of the contract and are rejected withparse_error. Contract reference: https://docs.requesty.ai/features/image-generationChanges:
internal/image/requesty.go: newRequestyProvider. The request sendsmodel,messagesandimage_configwithaspect_ratioandimage_size, nomodalities.IMAGE_SIZEaccepts an aspect ratio (16:9), a1K/2K/4Ktier, or an exactWIDTHxHEIGHTfrom the Requesty dimension table; anything else is aConfigErrorinstead of a silent substitution. Default is1:1at1K, matching what Requesty applies whenimage_configis omitted. Errors keep the router message and code and distinguishunauthorized,forbidden,payment_required,rate_limit,model_not_found,bad_request. A trailing slash on a custom base URL is trimmed.internal/image/provider.go:requestyregistry entry with the ids the router serves today:vertex/gemini-3.1-flash-image(default),vertex/gemini-3-pro-image,vertex/gemini-2.5-flash-image.internal/config/config.go: defaults for base URL, model and size.requesty/rqfactory and registry lookup, config defaults for both names,providers show rq --json.docs/IMAGE_PROVISIONERS.md(models, size table, error table),docs/CONFIG.md,docs/FAQ.md,docs/DISCOVERY.md,docs/AGENT-GUIDE.md,README.md,CHANGELOG.md.Verified locally on the rebased branch:
gofmt -l .,go vet ./..., golangci-lint 2.5.0 (0 issues),CGO_ENABLED=1 go test -count=1 ./...,npm pack --dry-run,make release-check. Smoke test against the live router withvertex/gemini-3.1-flash-image,image_config: {aspect_ratio: "16:9", image_size: "1K"}and nomodalitiesreturned a 1376x768 PNG data URL.Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.