Requirement: Inference API must support portable multi-turn context for chained Call 1 to Call 2 #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The current design makes two separate inference calls: Call 1 (vision) for taxonomy/species/attributes, and Call 2 (text) for title/description prose. We want to explore chaining them so Call 2 can retain Call 1's context window (including the downscaled images) instead of re-uploading, while explicitly labeling which dimensions, species, and attributes are confirmed vs. inferred.
Hard requirement
Any inference engine selected for this project MUST support portable multi-turn context for chaining Call 1 → Call 2. This is non-negotiable: the chosen provider must be able to continue the conversation thread (images + Call 1 reasoning) so Call 2 can ground its prose in the actual wood without re-uploading, or degrade cleanly to full resend.
Test-connection workflow must verify it
The existing test-inference / test-connection endpoint MUST be extended to probe this capability explicitly:
previous_response_id-style) from stateless (full resend required) and record which mode the selected engine uses.Default behavior
previous_response_id(or equivalent) only when the provider is detected as stateful.Provider notes
previous_response_id-style continuation.Acceptance criteria
previous_response_idis an opt-in optimization gated on provider capability detection.Context retention and cleanup
Caching and price optimization (explore, not blocking for POC)
Context
Discussed in conversation 2026-09-01. Related to option 2 of the Call 1/Call 2 chaining exploration (two calls, images provided to Call 2, confirmed/inferred framing). Elevated to a hard requirement: engine selection is gated on this capability.
Test cases needed once implementation exists:
previous_response_idin the request.confirmedon dimensions andconfirmed/inferredon taxonomy values. Labels match the actual provenance of each value.stateful; Call 2 usesprevious_response_id. Confirm the same conversation thread carries context.stateless; Call 2 uses full resend. Confirm the same results as stateful path.fail; Call 2 endpoint returns 422. Call 1 and inference-OFF still work.These tests are for the implementation PR, not the docs pass. No code exists yet.
Superseded: design went stateless-only. Full resend every call, no previous_response_id. test-inference returns "mode": "stateless" (inference.py:646).