feat(js/plugins/google-genai): 'Steps' for Interactions (googleAI only)#5317
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Google Generative AI and Vertex AI plugins to use a new interaction-based API structure, introducing interaction-converters.ts and interaction-types.ts while updating client.ts and model definitions. The feedback focuses on improving the robustness of the new converters by suggesting fallbacks for potentially missing data in tool requests, tool responses, and Google Search arguments to prevent runtime parsing errors. Additionally, it is recommended to avoid throwing hard errors for unknown content types or part types to ensure the system remains resilient as the underlying API evolves, and to ensure unique IDs are generated for Google Search and code execution calls to avoid collisions.
Gemini API announced breaking changes to Interactions API which is used for several models (deep research, lyria 3).
This PR adds the opt-in header and switches to Steps based responses.
We needed to split the previous 'common' interactions converters & types because while VertexAI will eventually also
use steps (and we can go back to common at that point), the timeline for the rollout is different and has not started yet.
Checklist (if applicable):