feat(run_config): add model_input_context for transient context in LLM requests#5991
feat(run_config): add model_input_context for transient context in LLM requests#5991nicolasmota wants to merge 1 commit into
Conversation
|
I have completed a thorough, strictly read-only analysis of PR #5991 and the linked Issue #5990 according to the The full, structured premium report has been compiled and saved as an artifact at: Highlights & Key Decisions
Open Nit / Decision Point
Summary of Work Done
|
…M requests This update introduces a new attribute, model_input_context, to the RunConfig class, allowing callers to provide transient context for each invocation without altering the conversation history. Additionally, the LLM request processing has been updated to incorporate this context appropriately. Unit tests have been added to verify the correct behavior of this feature.
b0c3bdd to
a31c1d2
Compare
|
I am going to check the instructions for the The full structured premium report has been compiled and saved as an artifact at: Highlights & Key Decisions
Open Nit / Decision Point
Summary of Work Done
|
Add Transient Model Input Context to RunConfig
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
Host applications sometimes need to provide request-scoped context to an agent for a single invocation without persisting that context into
session.events.Before this change, callers had to either append synthetic session events or merge application context into the user message. Both approaches blur the boundary between durable conversation history and transient model input.
Solution:
This change adds
RunConfig.model_input_context, a list ofgoogle.genai.types.Contentvalues that are injected into the LLM request for the current invocation only.The context is deep-copied before insertion, added before the invocation user content, and never appended to
session.events. The insertion path is separate from instruction-related content so the transient context keeps a stable position across tool-call loops and multi-agentinclude_contents="none"flows.Testing Plan
Unit Tests:
Passed locally:
Additional checks:
Manual End-to-End (E2E) Tests:
Not run. This change is covered by focused unit tests around LLM request construction and session persistence.
Checklist
Additional context
The unit coverage verifies that transient context:
include_contents="none"in a sequential flow;RunConfigastypes.Content.