Skip to content

Merge RC1 into planner#10

Merged
ddobrin merged 12 commits intoplannerfrom
main
Mar 20, 2026
Merged

Merge RC1 into planner#10
ddobrin merged 12 commits intoplannerfrom
main

Conversation

@ddobrin
Copy link
Owner

@ddobrin ddobrin commented Mar 20, 2026

No description provided.

OwenDavisBC and others added 12 commits March 11, 2026 14:41
PiperOrigin-RevId: 886764077
Merge google#1067

🤖 I have created a release *beep* *boop*
---

### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

COPYBARA_INTEGRATE_REVIEW=google#1067 from google:release-please--branches--main 0b85f5b
PiperOrigin-RevId: 886764460
This CL enables the simultaneous use of `output_schema` (structured output) and `tools` for models that do not natively support both features at once (specifically Gemini 1.x and 2.x on Vertex AI).

### Core Logic
The CL implements a workaround for models with this limitation:
1.  **Synthetic Tooling**: Instead of passing the `output_schema` directly to the model's configuration, it introduces a synthetic tool called `set_model_response`.
2.  **Schema Injection**: The parameters of this tool are set to the requested `output_schema`.
3.  **Instruction Prompting**: System instructions are appended, directing the model to provide its final response using this specific tool in the required format.
4.  **Response Interception**: The `BaseLlmFlow` is updated to check if `set_model_response` was called. If so, it extracts the JSON arguments and converts them into a standard model response event.

### Key Changes
*   **`OutputSchema.java` (New)**: A new `RequestProcessor` that detects when the workaround is needed, adds the `SetModelResponseTool`, and provides utilities for extracting the structured response.
*   **`SetModelResponseTool.java` (New)**: A marker tool that simply returns its input arguments, used to "capture" the structured output from the model.
*   **`ModelNameUtils.java`**: Added logic to identify Gemini 1.x and 2.x models and determine if they can handle native `output_schema` alongside tools.
*   **`BaseLlmFlow.java`**: Updated the flow logic to detect the synthetic tool response and generate the final output event.
*   **`Basic.java`**: Updated to prevent native `outputSchema` configuration when the workaround is active.
*   **`SingleFlow.java`**: Registered the new `OutputSchema` processor.

PiperOrigin-RevId: 886769688
@ddobrin ddobrin merged commit 9ca4384 into planner Mar 20, 2026
0 of 2 checks passed
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.

6 participants