@tanstack/ai-gemini 0.17.3 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/experimental/text-interactions/adapter.js +248 -95
- package/dist/esm/experimental/text-interactions/adapter.js.map +1 -1
- package/dist/esm/experimental/text-interactions/events.d.ts +29 -23
- package/dist/esm/experimental/text-interactions/provider-options.d.ts +1 -1
- package/package.json +6 -5
- package/src/experimental/text-interactions/adapter.ts +304 -100
- package/src/experimental/text-interactions/events.ts +29 -23
- package/src/experimental/text-interactions/provider-options.ts +0 -1
|
@@ -15,55 +15,60 @@ export interface GeminiInteractionIdEvent extends Omit<
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* `CUSTOM` event carrying a raw `google_search_call`
|
|
18
|
+
* `CUSTOM` event carrying a raw `google_search_call` Step from the
|
|
19
19
|
* Interactions API. Payload shape is owned by `@google/genai`.
|
|
20
|
+
*
|
|
21
|
+
* SDK 2.x: server-side tool activity is now first-class `Step`s (emitted
|
|
22
|
+
* via `step.start`) rather than content deltas, so each variant below
|
|
23
|
+
* carries the full Step (with its `id` / `call_id`) instead of a delta
|
|
24
|
+
* fragment.
|
|
20
25
|
*/
|
|
21
26
|
export interface GeminiGoogleSearchCallEvent extends Omit<
|
|
22
27
|
CustomEvent,
|
|
23
28
|
'name' | 'value'
|
|
24
29
|
> {
|
|
25
30
|
name: 'gemini.googleSearchCall'
|
|
26
|
-
value: Interactions.
|
|
31
|
+
value: Interactions.GoogleSearchCallStep
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
|
-
* `CUSTOM` event carrying a raw `google_search_result`
|
|
31
|
-
*
|
|
35
|
+
* `CUSTOM` event carrying a raw `google_search_result` Step from the
|
|
36
|
+
* Interactions API.
|
|
32
37
|
*/
|
|
33
38
|
export interface GeminiGoogleSearchResultEvent extends Omit<
|
|
34
39
|
CustomEvent,
|
|
35
40
|
'name' | 'value'
|
|
36
41
|
> {
|
|
37
42
|
name: 'gemini.googleSearchResult'
|
|
38
|
-
value: Interactions.
|
|
43
|
+
value: Interactions.GoogleSearchResultStep
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
/**
|
|
42
|
-
* `CUSTOM` event carrying a raw `code_execution_call`
|
|
43
|
-
*
|
|
47
|
+
* `CUSTOM` event carrying a raw `code_execution_call` Step from the
|
|
48
|
+
* Interactions API.
|
|
44
49
|
*/
|
|
45
50
|
export interface GeminiCodeExecutionCallEvent extends Omit<
|
|
46
51
|
CustomEvent,
|
|
47
52
|
'name' | 'value'
|
|
48
53
|
> {
|
|
49
54
|
name: 'gemini.codeExecutionCall'
|
|
50
|
-
value: Interactions.
|
|
55
|
+
value: Interactions.CodeExecutionCallStep
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
/**
|
|
54
|
-
* `CUSTOM` event carrying a raw `code_execution_result`
|
|
55
|
-
*
|
|
59
|
+
* `CUSTOM` event carrying a raw `code_execution_result` Step from the
|
|
60
|
+
* Interactions API.
|
|
56
61
|
*/
|
|
57
62
|
export interface GeminiCodeExecutionResultEvent extends Omit<
|
|
58
63
|
CustomEvent,
|
|
59
64
|
'name' | 'value'
|
|
60
65
|
> {
|
|
61
66
|
name: 'gemini.codeExecutionResult'
|
|
62
|
-
value: Interactions.
|
|
67
|
+
value: Interactions.CodeExecutionResultStep
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
/**
|
|
66
|
-
* `CUSTOM` event carrying a raw `url_context_call`
|
|
71
|
+
* `CUSTOM` event carrying a raw `url_context_call` Step from the
|
|
67
72
|
* Interactions API.
|
|
68
73
|
*/
|
|
69
74
|
export interface GeminiUrlContextCallEvent extends Omit<
|
|
@@ -71,11 +76,11 @@ export interface GeminiUrlContextCallEvent extends Omit<
|
|
|
71
76
|
'name' | 'value'
|
|
72
77
|
> {
|
|
73
78
|
name: 'gemini.urlContextCall'
|
|
74
|
-
value: Interactions.
|
|
79
|
+
value: Interactions.URLContextCallStep
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
/**
|
|
78
|
-
* `CUSTOM` event carrying a raw `url_context_result`
|
|
83
|
+
* `CUSTOM` event carrying a raw `url_context_result` Step from the
|
|
79
84
|
* Interactions API.
|
|
80
85
|
*/
|
|
81
86
|
export interface GeminiUrlContextResultEvent extends Omit<
|
|
@@ -83,11 +88,11 @@ export interface GeminiUrlContextResultEvent extends Omit<
|
|
|
83
88
|
'name' | 'value'
|
|
84
89
|
> {
|
|
85
90
|
name: 'gemini.urlContextResult'
|
|
86
|
-
value: Interactions.
|
|
91
|
+
value: Interactions.URLContextResultStep
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
/**
|
|
90
|
-
* `CUSTOM` event carrying a raw `file_search_call`
|
|
95
|
+
* `CUSTOM` event carrying a raw `file_search_call` Step from the
|
|
91
96
|
* Interactions API.
|
|
92
97
|
*/
|
|
93
98
|
export interface GeminiFileSearchCallEvent extends Omit<
|
|
@@ -95,11 +100,11 @@ export interface GeminiFileSearchCallEvent extends Omit<
|
|
|
95
100
|
'name' | 'value'
|
|
96
101
|
> {
|
|
97
102
|
name: 'gemini.fileSearchCall'
|
|
98
|
-
value: Interactions.
|
|
103
|
+
value: Interactions.FileSearchCallStep
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
/**
|
|
102
|
-
* `CUSTOM` event carrying a raw `file_search_result`
|
|
107
|
+
* `CUSTOM` event carrying a raw `file_search_result` Step from the
|
|
103
108
|
* Interactions API.
|
|
104
109
|
*/
|
|
105
110
|
export interface GeminiFileSearchResultEvent extends Omit<
|
|
@@ -107,7 +112,7 @@ export interface GeminiFileSearchResultEvent extends Omit<
|
|
|
107
112
|
'name' | 'value'
|
|
108
113
|
> {
|
|
109
114
|
name: 'gemini.fileSearchResult'
|
|
110
|
-
value: Interactions.
|
|
115
|
+
value: Interactions.FileSearchResultStep
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
/**
|
|
@@ -127,12 +132,13 @@ export interface GeminiFileSearchResultEvent extends Omit<
|
|
|
127
132
|
* }
|
|
128
133
|
* ```
|
|
129
134
|
*
|
|
130
|
-
* The four tool
|
|
135
|
+
* The four tool variant pairs (`google_search`, `code_execution`,
|
|
131
136
|
* `url_context`, `file_search`) forward the raw
|
|
132
|
-
* `Interactions
|
|
133
|
-
*
|
|
137
|
+
* `Interactions.*CallStep` / `Interactions.*ResultStep` payload from
|
|
138
|
+
* `@google/genai`. SDK 2.x emits these as full Steps via `step.start`
|
|
139
|
+
* (carrying the call's `id` / `call_id`) rather than as content deltas.
|
|
134
140
|
* `computer_use` is accepted as a request tool but the API does not
|
|
135
|
-
*
|
|
141
|
+
* surface a dedicated CUSTOM event for it.
|
|
136
142
|
*/
|
|
137
143
|
export type GeminiInteractionsCustomEvent =
|
|
138
144
|
| GeminiInteractionIdEvent
|