Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

- Gemini Interactions mock now emits the SDK 2.x event protocol on both paths — streamed SSE (`step.*`, `interaction.created`/`completed`, tool args via `arguments_delta`) and non-streaming responses (`steps`/`output_text`); legacy 1.x recorded fixtures still parse (#279)

## [1.33.0] - 2026-06-23

### Added
Expand Down
60 changes: 32 additions & 28 deletions src/__tests__/drift/sdk-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,8 @@ export function geminiInteractionsResponseShape(): ShapeNode {
status: "completed",
model: "gemini-2.5-flash",
role: "model",
outputs: [{ type: "text", text: "Hello!" }],
output_text: "Hello!",
steps: [{ type: "model_output", content: [{ type: "text", text: "Hello!" }] }],
usage: { total_input_tokens: 0, total_output_tokens: 0, total_tokens: 0 },
});
}
Expand All @@ -1598,7 +1599,7 @@ export function geminiInteractionsToolCallResponseShape(): ShapeNode {
status: "requires_action",
model: "gemini-2.5-flash",
role: "model",
outputs: [
steps: [
{
type: "function_call",
id: "call_abc123",
Expand All @@ -1613,43 +1614,43 @@ export function geminiInteractionsToolCallResponseShape(): ShapeNode {
export function geminiInteractionsStreamEventShapes(): SSEEventShape[] {
return [
{
type: "interaction.start",
type: "interaction.created",
dataShape: extractShape({
event_type: "interaction.start",
event_type: "interaction.created",
interaction: { id: "int_abc123", status: "in_progress" },
event_id: "evt_1",
}),
},
{
type: "content.start",
type: "step.start",
dataShape: extractShape({
event_type: "content.start",
event_type: "step.start",
index: 0,
content: { type: "text" },
step: { type: "model_output" },
event_id: "evt_2",
}),
},
{
type: "content.delta",
type: "step.delta",
dataShape: extractShape({
event_type: "content.delta",
event_type: "step.delta",
index: 0,
delta: { type: "text", text: "Hello" },
event_id: "evt_3",
}),
},
{
type: "content.stop",
type: "step.stop",
dataShape: extractShape({
event_type: "content.stop",
event_type: "step.stop",
index: 0,
event_id: "evt_4",
}),
},
{
type: "interaction.complete",
type: "interaction.completed",
dataShape: extractShape({
event_type: "interaction.complete",
event_type: "interaction.completed",
interaction: {
id: "int_abc123",
status: "completed",
Expand All @@ -1664,48 +1665,51 @@ export function geminiInteractionsStreamEventShapes(): SSEEventShape[] {
export function geminiInteractionsToolCallStreamEventShapes(): SSEEventShape[] {
return [
{
type: "interaction.start",
type: "interaction.created",
dataShape: extractShape({
event_type: "interaction.start",
event_type: "interaction.created",
interaction: { id: "int_abc123", status: "in_progress" },
event_id: "evt_1",
}),
},
{
type: "content.start",
type: "step.start",
dataShape: extractShape({
event_type: "content.start",
event_type: "step.start",
index: 0,
content: { type: "function_call" },
step: {
type: "function_call",
id: "call_abc123",
name: "get_weather",
arguments: {},
},
event_id: "evt_2",
}),
},
{
type: "content.delta",
type: "step.delta",
dataShape: extractShape({
event_type: "content.delta",
event_type: "step.delta",
index: 0,
delta: {
type: "function_call",
id: "call_abc123",
name: "get_weather",
arguments: { city: "Paris" },
type: "arguments_delta",
arguments: '{"city":"Paris"}',
},
event_id: "evt_3",
}),
},
{
type: "content.stop",
type: "step.stop",
dataShape: extractShape({
event_type: "content.stop",
event_type: "step.stop",
index: 0,
event_id: "evt_4",
}),
},
{
type: "interaction.complete",
type: "interaction.completed",
dataShape: extractShape({
event_type: "interaction.complete",
event_type: "interaction.completed",
interaction: {
id: "int_abc123",
status: "requires_action",
Expand Down
Loading
Loading