镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(llmgw): add decisions.create() for the gateway's /v1/decisions - #292

Merged
dmorrissey-aai merged 4 commits into
masterfrom
dmorrissey/llmgw-decisions
Nov 12, 2026
Merged

dmorrissey-aai merged 4 commits into
masterfrom
dmorrissey/llmgw-decisions

Conversation

@dmorrissey-aai

Copy link
Copy Markdown
Contributor

Adds gateway.decisions.create() to LLMGateway and AsyncLLMGateway. It calls the gateway's POST /v1/decisions, which answers predicate, choice, and score questions about an input.

  • Request: questions are plain dicts typed by LLMGatewayDecisionQuestionParam. Optional settings are named in the signature so IDEs show them, and any other kwarg is forwarded unchanged. The gateway rejects unknown fields itself.
  • Response: LLMGatewayDecisionResponse / LLMGatewayDecisionAnswer. It has its own usage model, because decisions doesn't return prompt_tokens/completion_tokens. probabilities[].value is typed Any: on pydantic v1, a Union[str, int] would coerce one of the two.
  • Tests and docs: unit tests for sync and async; examples in CLAUDE.md and README.md.

Testing

  • Unit suite passes on pydantic 2 and on pydantic 1.10 (gateway tests).
  • Live run against production with gpt-6-luna:
    • sync and async calls, with both a string input and a list of input items
    • all three question types parsed, with choice values as str and level indexes as int
    • a 400 validation error and an unknown kwarg each surface as LLMGatewayError with .errors

🤖 Generated with Claude Code

- New `decisions` resource on LLMGateway/AsyncLLMGateway: TypedDict question param, named optionals for discoverability, extra kwargs forwarded as-is.
- Typed response models; probabilities[].value stays Any so pydantic v1 keeps str choice values and int level indexes.
- Unit tests (sync + async) and CLAUDE.md/README docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmorrissey-aai
dmorrissey-aai marked this pull request as ready for review November 12, 2026 17:49
Comment thread assemblyai/__version__.py Resolved
@dmorrissey-aai
dmorrissey-aai merged commit b987d7a into master Nov 12, 2026
8 checks passed
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.

2 participants