Skip to content

Commit 4b2c559

Browse files
author
Abraham Lazaro Martinez
committed
Squashed commit of the following:
commit 91668ca Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:29:07 2025 +0000 chore: bump @genkit-ai/express version to @genkit-ai/[email protected] commit f6070b6 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:29:04 2025 +0000 chore: bump genkitx-mcp version to [email protected] commit ea45c38 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:29:01 2025 +0000 chore: bump @genkit-ai/checks version to @genkit-ai/[email protected] commit 1d5ad7d Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:58 2025 +0000 chore: bump @genkit-ai/vertexai version to @genkit-ai/[email protected] commit c1a3858 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:55 2025 +0000 chore: bump genkitx-pinecone version to [email protected] commit 3f284ea Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:52 2025 +0000 chore: bump genkitx-ollama version to [email protected] commit 591f4cf Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:48 2025 +0000 chore: bump @genkit-ai/next version to @genkit-ai/[email protected] commit fe9e461 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:45 2025 +0000 chore: bump genkitx-langchain version to [email protected] commit 9cae9be Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:42 2025 +0000 chore: bump @genkit-ai/googleai version to @genkit-ai/[email protected] commit 91d8b70 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:39 2025 +0000 chore: bump @genkit-ai/google-cloud version to @genkit-ai/[email protected] commit 8fbe770 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:36 2025 +0000 chore: bump @genkit-ai/firebase version to @genkit-ai/[email protected] commit b1c2159 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:33 2025 +0000 chore: bump @genkit-ai/evaluator version to @genkit-ai/[email protected] commit b9e6958 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:30 2025 +0000 chore: bump @genkit-ai/dev-local-vectorstore version to @genkit-ai/[email protected] commit f9a5b8a Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:27 2025 +0000 chore: bump genkitx-chromadb version to [email protected] commit efb1210 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:24 2025 +0000 chore: bump genkit version to [email protected] commit 689f7d3 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:21 2025 +0000 chore: bump @genkit-ai/ai version to @genkit-ai/[email protected] commit e335e9c Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:28:18 2025 +0000 chore: bump @genkit-ai/core version to @genkit-ai/[email protected] commit edc2031 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:26:30 2025 +0000 chore: bump @genkit-ai/telemetry-server version to @genkit-ai/[email protected] commit 9d8ee81 Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:26:27 2025 +0000 chore: bump genkit-cli version to [email protected] commit 9cfbf1f Author: Automated Version Bump <[email protected]> Date: Wed May 21 17:26:25 2025 +0000 chore: bump @genkit-ai/tools-common version to @genkit-ai/[email protected] commit 469707b Author: Pavel Jbanov <[email protected]> Date: Wed May 21 12:40:03 2025 -0400 feat(js): added reasoning part type and implemented for googleai and vertexai (#2945) commit 9f5c76b Author: Abraham J. Lázaro <[email protected]> Date: Tue May 20 14:27:18 2025 -0600 feat(py): Dynamic model registration for Gemini (#2908) (#2917) Co-authored-by: Abraham Lazaro Martinez <[email protected]> commit 7cfec0a Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:26:02 2025 +0000 chore: bump @genkit-ai/express version to @genkit-ai/[email protected] commit 1ec8344 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:26:00 2025 +0000 chore: bump genkitx-mcp version to [email protected] commit a1bd18d Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:57 2025 +0000 chore: bump @genkit-ai/checks version to @genkit-ai/[email protected] commit fcf77ee Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:55 2025 +0000 chore: bump @genkit-ai/vertexai version to @genkit-ai/[email protected] commit 1e85633 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:53 2025 +0000 chore: bump genkitx-pinecone version to [email protected] commit 5a75337 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:51 2025 +0000 chore: bump genkitx-ollama version to [email protected] commit 76b3860 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:49 2025 +0000 chore: bump @genkit-ai/next version to @genkit-ai/[email protected] commit 008aaf4 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:46 2025 +0000 chore: bump genkitx-langchain version to [email protected] commit 9abdda4 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:44 2025 +0000 chore: bump @genkit-ai/googleai version to @genkit-ai/[email protected] commit 9887cb1 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:42 2025 +0000 chore: bump @genkit-ai/google-cloud version to @genkit-ai/[email protected] commit 079cd24 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:39 2025 +0000 chore: bump @genkit-ai/firebase version to @genkit-ai/[email protected] commit be5f59d Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:37 2025 +0000 chore: bump @genkit-ai/evaluator version to @genkit-ai/[email protected] commit 8c4ae5f Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:35 2025 +0000 chore: bump @genkit-ai/dev-local-vectorstore version to @genkit-ai/[email protected] commit 192e440 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:33 2025 +0000 chore: bump genkitx-chromadb version to [email protected] commit 02d9801 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:31 2025 +0000 chore: bump genkit version to [email protected] commit 0c45d3d Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:28 2025 +0000 chore: bump @genkit-ai/ai version to @genkit-ai/[email protected] commit 44d6703 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:25:26 2025 +0000 chore: bump @genkit-ai/core version to @genkit-ai/[email protected] commit 5daebe5 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:24:39 2025 +0000 chore: bump @genkit-ai/telemetry-server version to @genkit-ai/[email protected] commit 3b70098 Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:24:37 2025 +0000 chore: bump genkit-cli version to [email protected] commit 341db6d Author: Automated Version Bump <[email protected]> Date: Tue May 20 00:24:35 2025 +0000 chore: bump @genkit-ai/tools-common version to @genkit-ai/[email protected] commit a330fb5 Author: Pavel Jbanov <[email protected]> Date: Mon May 19 20:20:27 2025 -0400 chore(js/plugins/googleai): added google search options to gemini config schema (#2938)
1 parent 4e660eb commit 4b2c559

File tree

33 files changed

+304
-30
lines changed

33 files changed

+304
-30
lines changed

genkit-tools/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "genkit-cli",
3-
"version": "1.9.0",
3+
"version": "1.10.0",
44
"description": "CLI for interacting with the Google Genkit AI framework",
55
"license": "Apache-2.0",
66
"keywords": [

genkit-tools/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@genkit-ai/tools-common",
3-
"version": "1.9.0",
3+
"version": "1.10.0",
44
"scripts": {
55
"compile": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",
66
"build:clean": "rimraf ./lib",

genkit-tools/common/src/types/document.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const EmptyPartSchema = z.object({
2727
data: z.unknown().optional(),
2828
metadata: z.record(z.unknown()).optional(),
2929
custom: z.record(z.unknown()).optional(),
30+
reasoning: z.never().optional(),
3031
});
3132

3233
/**
@@ -37,6 +38,14 @@ export const TextPartSchema = EmptyPartSchema.extend({
3738
text: z.string(),
3839
});
3940

41+
/**
42+
* Zod schema for a reasoning part.
43+
*/
44+
export const ReasoningPartSchema = EmptyPartSchema.extend({
45+
/** The reasoning text of the message. */
46+
reasoning: z.string(),
47+
});
48+
4049
/**
4150
* Text part.
4251
*/

genkit-tools/common/src/types/model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
DocumentDataSchema,
2323
MediaPart,
2424
MediaPartSchema,
25+
ReasoningPartSchema,
2526
TextPart,
2627
TextPartSchema,
2728
ToolRequestPart,
@@ -58,6 +59,7 @@ export const PartSchema = z.union([
5859
ToolResponsePartSchema,
5960
DataPartSchema,
6061
CustomPartSchema,
62+
ReasoningPartSchema,
6163
]);
6264

6365
/**

genkit-tools/genkit-schema.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"custom": {
2525
"type": "object",
2626
"additionalProperties": {}
27+
},
28+
"reasoning": {
29+
"not": {}
2730
}
2831
},
2932
"required": [
@@ -53,6 +56,9 @@
5356
"custom": {
5457
"type": "object",
5558
"additionalProperties": {}
59+
},
60+
"reasoning": {
61+
"$ref": "#/$defs/CustomPart/properties/reasoning"
5662
}
5763
},
5864
"additionalProperties": false
@@ -109,6 +115,9 @@
109115
},
110116
"custom": {
111117
"$ref": "#/$defs/DataPart/properties/custom"
118+
},
119+
"reasoning": {
120+
"$ref": "#/$defs/CustomPart/properties/reasoning"
112121
}
113122
},
114123
"required": [
@@ -131,6 +140,39 @@
131140
],
132141
"additionalProperties": false
133142
},
143+
"ReasoningPart": {
144+
"type": "object",
145+
"properties": {
146+
"text": {
147+
"$ref": "#/$defs/CustomPart/properties/text"
148+
},
149+
"media": {
150+
"$ref": "#/$defs/CustomPart/properties/media"
151+
},
152+
"toolRequest": {
153+
"$ref": "#/$defs/CustomPart/properties/toolRequest"
154+
},
155+
"toolResponse": {
156+
"$ref": "#/$defs/CustomPart/properties/toolResponse"
157+
},
158+
"data": {
159+
"$ref": "#/$defs/CustomPart/properties/data"
160+
},
161+
"metadata": {
162+
"$ref": "#/$defs/CustomPart/properties/metadata"
163+
},
164+
"custom": {
165+
"$ref": "#/$defs/DataPart/properties/custom"
166+
},
167+
"reasoning": {
168+
"type": "string"
169+
}
170+
},
171+
"required": [
172+
"reasoning"
173+
],
174+
"additionalProperties": false
175+
},
134176
"TextPart": {
135177
"type": "object",
136178
"properties": {
@@ -154,6 +196,9 @@
154196
},
155197
"custom": {
156198
"$ref": "#/$defs/DataPart/properties/custom"
199+
},
200+
"reasoning": {
201+
"$ref": "#/$defs/CustomPart/properties/reasoning"
157202
}
158203
},
159204
"required": [
@@ -184,6 +229,9 @@
184229
},
185230
"custom": {
186231
"$ref": "#/$defs/DataPart/properties/custom"
232+
},
233+
"reasoning": {
234+
"$ref": "#/$defs/CustomPart/properties/reasoning"
187235
}
188236
},
189237
"required": [
@@ -230,6 +278,9 @@
230278
},
231279
"custom": {
232280
"$ref": "#/$defs/DataPart/properties/custom"
281+
},
282+
"reasoning": {
283+
"$ref": "#/$defs/CustomPart/properties/reasoning"
233284
}
234285
},
235286
"required": [
@@ -1043,6 +1094,9 @@
10431094
},
10441095
{
10451096
"$ref": "#/$defs/CustomPart"
1097+
},
1098+
{
1099+
"$ref": "#/$defs/ReasoningPart"
10461100
}
10471101
]
10481102
},

genkit-tools/telemetry-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"genai",
88
"generative-ai"
99
],
10-
"version": "1.9.0",
10+
"version": "1.10.0",
1111
"type": "commonjs",
1212
"scripts": {
1313
"compile": "pnpm genversion && tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",

js/ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"genai",
88
"generative-ai"
99
],
10-
"version": "1.9.0",
10+
"version": "1.10.0",
1111
"type": "commonjs",
1212
"scripts": {
1313
"check": "tsc",

js/ai/src/document.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const EmptyPartSchema = z.object({
2525
data: z.unknown().optional(),
2626
metadata: z.record(z.unknown()).optional(),
2727
custom: z.record(z.unknown()).optional(),
28+
reasoning: z.never().optional(),
2829
});
2930

3031
/**
@@ -35,6 +36,14 @@ export const TextPartSchema = EmptyPartSchema.extend({
3536
text: z.string(),
3637
});
3738

39+
/**
40+
* Zod schema for a reasoning part.
41+
*/
42+
export const ReasoningPartSchema = EmptyPartSchema.extend({
43+
/** The reasoning text of the message. */
44+
reasoning: z.string(),
45+
});
46+
3847
/**
3948
* Text part.
4049
*/

js/ai/src/generate/chunk.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ export class GenerateResponseChunk<T = unknown>
7070
return this.content.map((part) => part.text || '').join('');
7171
}
7272

73+
/**
74+
* Concatenates all `reasoning` parts present in the chunk with no delimiter.
75+
* @returns A string of all concatenated reasoning parts.
76+
*/
77+
get reasoning(): string {
78+
return this.content.map((part) => part.reasoning || '').join('');
79+
}
80+
7381
/**
7482
* Concatenates all `text` parts of all chunks from the response thus far.
7583
* @returns A string of all concatenated chunk text content.

js/ai/src/generate/response.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export class GenerateResponse<O = unknown> implements ModelResponseData {
4444
usage: GenerationUsage;
4545
/** Provider-specific response data. */
4646
custom: unknown;
47+
/** Provider-specific response data. */
48+
raw: unknown;
4749
/** The request that generated this response. */
4850
request?: GenerateRequest;
4951
/** The parser for output parsing of this response. */
@@ -70,6 +72,7 @@ export class GenerateResponse<O = unknown> implements ModelResponseData {
7072
response.finishMessage || response.candidates?.[0]?.finishMessage;
7173
this.usage = response.usage || {};
7274
this.custom = response.custom || {};
75+
this.raw = response.raw || this.custom;
7376
this.request = options?.request;
7477
}
7578

@@ -133,6 +136,14 @@ export class GenerateResponse<O = unknown> implements ModelResponseData {
133136
return this.message?.text || '';
134137
}
135138

139+
/**
140+
* Concatenates all `reasoning` parts present in the generated message with no delimiter.
141+
* @returns A string of all concatenated reasoning parts.
142+
*/
143+
get reasoning(): string {
144+
return this.message?.reasoning || '';
145+
}
146+
136147
/**
137148
* Returns the first detected media part in the generated message. Useful for
138149
* extracting (for example) an image from a generation expected to create one.
@@ -184,10 +195,6 @@ export class GenerateResponse<O = unknown> implements ModelResponseData {
184195
return [...this.request?.messages, this.message.toJSON()];
185196
}
186197

187-
get raw(): unknown {
188-
return this.raw ?? this.custom;
189-
}
190-
191198
toJSON(): ModelResponseData {
192199
const out = {
193200
message: this.message?.toJSON(),

js/ai/src/message.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ export class Message<T = unknown> implements MessageData {
9595
return this.content.map((part) => part.text || '').join('');
9696
}
9797

98+
/**
99+
* Concatenates all `reasoning` parts present in the message with no delimiter.
100+
* @returns A string of all concatenated reasoning parts.
101+
*/
102+
get reasoning(): string {
103+
return this.content.map((part) => part.reasoning || '').join('');
104+
}
105+
98106
/**
99107
* Returns the first media part detected in the message. Useful for extracting
100108
* (for example) an image from a generation expected to create one.

js/ai/src/model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
DocumentDataSchema,
3737
MediaPart,
3838
MediaPartSchema,
39+
ReasoningPartSchema,
3940
TextPart,
4041
TextPartSchema,
4142
ToolRequestPart,
@@ -81,6 +82,7 @@ export const PartSchema = z.union([
8182
ToolResponsePartSchema,
8283
DataPartSchema,
8384
CustomPartSchema,
85+
ReasoningPartSchema,
8486
]);
8587

8688
/**

js/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"genai",
88
"generative-ai"
99
],
10-
"version": "1.9.0",
10+
"version": "1.10.0",
1111
"type": "commonjs",
1212
"scripts": {
1313
"check": "tsc",

js/genkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"genai",
88
"generative-ai"
99
],
10-
"version": "1.9.0",
10+
"version": "1.10.0",
1111
"type": "commonjs",
1212
"main": "./lib/cjs/index.js",
1313
"scripts": {

js/plugins/checks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"google checks",
1414
"guardrails"
1515
],
16-
"version": "1.9.0",
16+
"version": "1.10.0",
1717
"type": "commonjs",
1818
"scripts": {
1919
"check": "tsc",

js/plugins/chroma/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"genai",
1414
"generative-ai"
1515
],
16-
"version": "1.9.0",
16+
"version": "1.10.0",
1717
"type": "commonjs",
1818
"scripts": {
1919
"check": "tsc",

js/plugins/dev-local-vectorstore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"genai",
1111
"generative-ai"
1212
],
13-
"version": "1.9.0",
13+
"version": "1.10.0",
1414
"type": "commonjs",
1515
"scripts": {
1616
"check": "tsc",

js/plugins/evaluators/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"genai",
1212
"generative-ai"
1313
],
14-
"version": "1.9.0",
14+
"version": "1.10.0",
1515
"type": "commonjs",
1616
"scripts": {
1717
"check": "tsc",

js/plugins/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"genai",
1010
"generative-ai"
1111
],
12-
"version": "1.9.0",
12+
"version": "1.10.0",
1313
"type": "commonjs",
1414
"scripts": {
1515
"check": "tsc",

js/plugins/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"genai",
1414
"generative-ai"
1515
],
16-
"version": "1.9.0",
16+
"version": "1.10.0",
1717
"type": "commonjs",
1818
"scripts": {
1919
"check": "tsc",

js/plugins/google-cloud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"genai",
1414
"generative-ai"
1515
],
16-
"version": "1.9.0",
16+
"version": "1.10.0",
1717
"type": "commonjs",
1818
"scripts": {
1919
"check": "tsc",

js/plugins/googleai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"genai",
1414
"generative-ai"
1515
],
16-
"version": "1.9.0",
16+
"version": "1.10.0",
1717
"type": "commonjs",
1818
"scripts": {
1919
"check": "tsc",

0 commit comments

Comments
 (0)