Repository navigation
Show /v1/decisions examples for cloud typed-decision models - #242
Merged
Merged
Conversation
- Pass typed_decisions/decision_only to the gateway API dialog for cloud provider cards.
- Add POST /providers/{providerID}/v1/decisions; third-party providers and pools return a clear 400.
- Document the provider-scoped decisions route in OpenAPI.
Fixes #241.
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.
Problem
In the AI Gateway page, opening 调用方式 for the cloud model
convaiinnovations/layashowed only chat-completions examples, even thoughthe gateway advertises it as
typed-decisions(#241).Two gaps caused it:
AIGateway.tsxnever passedisDecision/isDecisionOnlytoApiInfoDialog, so it always rendered the chat examples.POST /providers/{providerID}/v1/decisions,so the URL in a decisions example would have returned 404.
Changes
typed_decisions/decision_onlyflags toApiInfoDialog.decisionsSupportedis explicitand only true for the cloud provider; third-party providers and provider
pools keep chat-only examples.
POST /providers/{providerID}/v1/decisionsis wired to the existing handler and honors the route source:
/providers/csghubskips the local-first lookup,/providers/localrequiresa downloaded model, and third-party providers, pools, cluster and node
routes return 400
decisions are only available for local and cloud models.openapi/local-api.jsonand its embedded copy document the newroute; the route-family sync test covers it.
POST /v1/decisionsbehavior is unchanged.Testing
go test ./internal/server— passes, including new cases for the cloudroute, third-party provider rejection, pool rejection and local-route
rejection.
cd web && npm test— 23 files, 90 tests pass.cd web && npm run build— passes.convaiinnovations/layashows only theDecisions example with
.../providers/csghub/v1/decisions; a chat modelstill shows chat examples; third-party/pool/local negative cases return 400.
web/distis gitignored; it was rebuilt and synced intointernal/server/staticonly for local preview.Fixes #241.