Skip to content

Bypassing State Injection in Instruction #275

@DevTomek-pl

Description

@DevTomek-pl

Is there a way to bypass state injection in adk-java, similar to Python?
https://google.github.io/adk-docs/sessions/state/#bypassing-state-injection-with-instructionprovider

I tried something like this, but it doesn't work

(...)
.description("Any description")
.instruction( Instruction.Provider { context ->
  Single.just("Any {state_object}")
})

From what I see, InstructionUtils.injectSessionState is always called, regardless of the instruction type:
https://github.com/google/adk-java/blob/v0.2.0/core/src/main/java/com/google/adk/flows/llmflows/Instructions.java#L70

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions