Skip to content

a couple of suggestions for the middleware PR - #170

Merged
xavidop merged 2 commits into
xavier/middleware-v2from
pj/middlware-pr-suggestions
May 8, 2026
Merged

a couple of suggestions for the middleware PR#170
xavidop merged 2 commits into
xavier/middleware-v2from
pj/middlware-pr-suggestions

Conversation

@pavelgj

@pavelgj pavelgj commented May 7, 2026

Copy link
Copy Markdown
Member

No description provided.

pavelgj added 2 commits May 7, 2026 16:48
…el classes

Move GenerateActionOptions and OutputConfig from inner classes of
GenerateAction into standalone files. Update GenerateParams to hold
GenerateActionOptions instead of ModelRequest, better reflecting
the generation pipeline's data flow. Update middleware interfaces
and tests accordingly.
…acking

Add `messageIndex` field to `GenerateParams` to track the position in the
conversation that the next model response will occupy. This mirrors the
JS SDK's `messageIndex` and supports streaming chunk attribution and
middleware that needs to track conversation position.

- Add 3-arg constructor and `withMessageIndex()` to `GenerateParams`
- Default `messageIndex` to message count when using 2-arg constructor
- Update `withRequest()` to preserve `messageIndex`
- Increment `messageIndex` during tool-loop iterations in `Genkit`
- Add corresponding unit tests
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@xavidop
xavidop merged commit a12106a into xavier/middleware-v2 May 8, 2026
3 of 4 checks passed
@xavidop
xavidop deleted the pj/middlware-pr-suggestions branch May 18, 2026 16:45
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