From ad570ea46568b88e2f9156b6e243325daf808dfc Mon Sep 17 00:00:00 2001 From: Luke Schlangen Date: Tue, 27 Jan 2026 21:22:15 -0600 Subject: [PATCH 1/5] Revise TypeScript setup instructions and dependencies Updated Node.js and npm version requirements, adjusted project setup instructions, and modified package.json structure. --- docs/get-started/typescript.md | 67 +++++++++------------------------- 1 file changed, 18 insertions(+), 49 deletions(-) diff --git a/docs/get-started/typescript.md b/docs/get-started/typescript.md index 02ea48c41..c37c92a21 100644 --- a/docs/get-started/typescript.md +++ b/docs/get-started/typescript.md @@ -3,19 +3,15 @@ This guide shows you how to get up and running with Agent Development Kit for TypeScript. Before you start, make sure you have the following installed: -* Node.js 20.12.7 or later -* Node Package Manager (npm) 9.2.0 or later +* Node.js 22.6.0 or later (required for native TypeScript support) +* Node Package Manager (npm) 10.0.0 or later ## Create an agent project -Create an agent project with the following files and directory structure: +Create an empty `my-agent` directory for your project: ```none my-agent/ - agent.ts # main agent code - package.json # project configuration - tsconfig.json # TypeScript configuration - .env # API keys or project IDs ``` ??? tip "Create this project structure using the command line" @@ -23,30 +19,20 @@ my-agent/ === "MacOS / Linux" ```bash - mkdir -p my-agent/ && \ - touch my-agent/agent.ts \ - touch my-agent/package.json \ - touch my-agent/.env + mkdir -p my-agent/ ``` === "Windows" ```console - mkdir my-agent\ - type nul > my-agent\agent.ts - type nul > my-agent\package.json - type nul > my-agent\.env + mkdir my-agent ``` - **Note:** Do not create `tsconfig.json`, you generate that - file in a later step. - ### Define the agent code Create the code for a basic agent, including a simple implementation of an ADK [Function Tool](/adk-docs/tools/function-tools/), called `getCurrentTime`. -Add the following code to the `agent.ts` file in your project -directory: +Create an `agent.ts` file in your project directory and add the following code: ```typescript title="my-agent/agent.ts" import {FunctionTool, LlmAgent} from '@google/adk'; @@ -79,18 +65,18 @@ export const rootAgent = new LlmAgent({ Use the `npm` tool to install and configure dependencies for your project, including the package file, TypeScript configuration, ADK TypeScript main library and developer tools. Run the following commands from your -`my-agent/` directory: +`my-agent/` directory to create the `package.json` file and install the +project dependencies: ```console cd my-agent/ -# initialize a project with default values +# initialize a project as an ES module npm init --yes -# configure TypeScript -npm install -D typescript -npx tsc --init -# install ADK libraries -npm install @google/adk -npm install @google/adk-devtools +npm pkg set type="module" +# install ADK libraries and Zod +npm install @google/adk zod +# install dev tools as a dev dependency +npm install -D @google/adk-devtools ``` After completing these installation and configuration steps, open @@ -103,38 +89,21 @@ well as the ADK library dependencies, as shown in this example: "name": "my-agent", "version": "1.0.0", "description": "My ADK Agent", + "type": "module", "main": "agent.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "devDependencies": { - "typescript": "^5.9.3" - }, "dependencies": { "@google/adk": "^0.2.0", + "zod": "^4.0.0" + }, + "devDependencies": { "@google/adk-devtools": "^0.2.0" } } ``` -For development convenience, in the `tsconfig.json` file, update the -setting for `verbatimModuleSyntax` to `false` to allow simpler syntax -when adding modules: - -```json title="my-agent/tsconfig.json" - // set to false to allow CommonJS module syntax: - "verbatimModuleSyntax": false, -``` - -### Compile the project - -After completing the project setup, compile the project to prepare for -running your ADK agent: - -```console -npx tsc -``` - ### Set your API key This project uses the Gemini API, which requires an API key. If you From 7d7573a38a0241fe27819e47577f68c1ea949c33 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 29 Jan 2026 14:59:35 +0000 Subject: [PATCH 2/5] remove specific zod version --- docs/get-started/typescript.md | 71 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/docs/get-started/typescript.md b/docs/get-started/typescript.md index c37c92a21..5dd7b1ebe 100644 --- a/docs/get-started/typescript.md +++ b/docs/get-started/typescript.md @@ -28,38 +28,6 @@ my-agent/ mkdir my-agent ``` -### Define the agent code - -Create the code for a basic agent, including a simple implementation of an ADK -[Function Tool](/adk-docs/tools/function-tools/), called `getCurrentTime`. -Create an `agent.ts` file in your project directory and add the following code: - -```typescript title="my-agent/agent.ts" -import {FunctionTool, LlmAgent} from '@google/adk'; -import {z} from 'zod'; - -/* Mock tool implementation */ -const getCurrentTime = new FunctionTool({ - name: 'get_current_time', - description: 'Returns the current time in a specified city.', - parameters: z.object({ - city: z.string().describe("The name of the city for which to retrieve the current time."), - }), - execute: ({city}) => { - return {status: 'success', report: `The current time in ${city} is 10:30 AM`}; - }, -}); - -export const rootAgent = new LlmAgent({ - name: 'hello_time_agent', - model: 'gemini-2.5-flash', - description: 'Tells the current time in a specified city.', - instruction: `You are a helpful assistant that tells the current time in a city. - Use the 'getCurrentTime' tool for this purpose.`, - tools: [getCurrentTime], -}); -``` - ### Configure project and dependencies Use the `npm` tool to install and configure dependencies for your project, @@ -73,8 +41,8 @@ cd my-agent/ # initialize a project as an ES module npm init --yes npm pkg set type="module" -# install ADK libraries and Zod -npm install @google/adk zod +# install ADK libraries +npm install @google/adk # install dev tools as a dev dependency npm install -D @google/adk-devtools ``` @@ -95,8 +63,7 @@ well as the ADK library dependencies, as shown in this example: "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "@google/adk": "^0.2.0", - "zod": "^4.0.0" + "@google/adk": "^0.2.0" }, "devDependencies": { "@google/adk-devtools": "^0.2.0" @@ -104,6 +71,38 @@ well as the ADK library dependencies, as shown in this example: } ``` +### Define the agent code + +Create the code for a basic agent, including a simple implementation of an ADK +[Function Tool](/adk-docs/tools/function-tools/), called `getCurrentTime`. +Create an `agent.ts` file in your project directory and add the following code: + +```typescript title="my-agent/agent.ts" +import {FunctionTool, LlmAgent} from '@google/adk'; +import {z} from 'zod'; + +/* Mock tool implementation */ +const getCurrentTime = new FunctionTool({ + name: 'get_current_time', + description: 'Returns the current time in a specified city.', + parameters: z.object({ + city: z.string().describe("The name of the city for which to retrieve the current time."), + }), + execute: ({city}) => { + return {status: 'success', report: `The current time in ${city} is 10:30 AM`}; + }, +}); + +export const rootAgent = new LlmAgent({ + name: 'hello_time_agent', + model: 'gemini-2.5-flash', + description: 'Tells the current time in a specified city.', + instruction: `You are a helpful assistant that tells the current time in a city. + Use the 'getCurrentTime' tool for this purpose.`, + tools: [getCurrentTime], +}); +``` + ### Set your API key This project uses the Gemini API, which requires an API key. If you From 3342b35e7582c8de8f5362e089f39e8c8e493129 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 29 Jan 2026 16:25:28 +0000 Subject: [PATCH 3/5] update model and Node.js version --- docs/get-started/typescript.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/get-started/typescript.md b/docs/get-started/typescript.md index 5dd7b1ebe..f6e0dac85 100644 --- a/docs/get-started/typescript.md +++ b/docs/get-started/typescript.md @@ -3,8 +3,8 @@ This guide shows you how to get up and running with Agent Development Kit for TypeScript. Before you start, make sure you have the following installed: -* Node.js 22.6.0 or later (required for native TypeScript support) -* Node Package Manager (npm) 10.0.0 or later +* Node.js 24.13.0 or later +* Node Package Manager (npm) 11.8.0 or later ## Create an agent project @@ -31,8 +31,8 @@ my-agent/ ### Configure project and dependencies Use the `npm` tool to install and configure dependencies for your project, -including the package file, TypeScript configuration, ADK TypeScript main -library and developer tools. Run the following commands from your +including the package file, ADK TypeScript main +library, and developer tools. Run the following commands from your `my-agent/` directory to create the `package.json` file and install the project dependencies: @@ -41,6 +41,7 @@ cd my-agent/ # initialize a project as an ES module npm init --yes npm pkg set type="module" +npm pkg set main="agent.ts" # install ADK libraries npm install @google/adk # install dev tools as a dev dependency @@ -48,9 +49,7 @@ npm install -D @google/adk-devtools ``` After completing these installation and configuration steps, open -the `package.json` project file and verify that the `main:` value -is set to `agent.ts`, that the TypeScript dependency is set, as -well as the ADK library dependencies, as shown in this example: +the `package.json` project file and verify that it matches this example: ```json title="my-agent/package.json" { @@ -95,7 +94,7 @@ const getCurrentTime = new FunctionTool({ export const rootAgent = new LlmAgent({ name: 'hello_time_agent', - model: 'gemini-2.5-flash', + model: 'gemini-3.0-flash', description: 'Tells the current time in a specified city.', instruction: `You are a helpful assistant that tells the current time in a city. Use the 'getCurrentTime' tool for this purpose.`, From c9d15b0dd0453107ee55b8cc26b5c70b150a885e Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 29 Jan 2026 18:42:48 +0000 Subject: [PATCH 4/5] remove redundant package.json check --- docs/get-started/typescript.md | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/docs/get-started/typescript.md b/docs/get-started/typescript.md index f6e0dac85..9c7d14319 100644 --- a/docs/get-started/typescript.md +++ b/docs/get-started/typescript.md @@ -48,28 +48,6 @@ npm install @google/adk npm install -D @google/adk-devtools ``` -After completing these installation and configuration steps, open -the `package.json` project file and verify that it matches this example: - -```json title="my-agent/package.json" -{ - "name": "my-agent", - "version": "1.0.0", - "description": "My ADK Agent", - "type": "module", - "main": "agent.ts", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "@google/adk": "^0.2.0" - }, - "devDependencies": { - "@google/adk-devtools": "^0.2.0" - } -} -``` - ### Define the agent code Create the code for a basic agent, including a simple implementation of an ADK @@ -133,7 +111,7 @@ Run your agent with the ADK TypeScript command-line interface tool using the following command: ```console -npx @google/adk-devtools run agent.ts +npx adk run agent.ts ``` ![adk-run.png](/adk-docs/assets/adk-run.png) @@ -143,7 +121,7 @@ npx @google/adk-devtools run agent.ts Run your agent with the ADK web interface using the following command: ```console -npx @google/adk-devtools web +npx adk web ``` This command starts a web server with a chat interface for your agent. You can From b085688f7765044d0114499aaca7afc1d7178d0d Mon Sep 17 00:00:00 2001 From: Luke Schlangen Date: Thu, 29 Jan 2026 18:44:20 +0000 Subject: [PATCH 5/5] revert gemini version to 2.5 --- docs/get-started/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/typescript.md b/docs/get-started/typescript.md index 9c7d14319..da028fa49 100644 --- a/docs/get-started/typescript.md +++ b/docs/get-started/typescript.md @@ -72,7 +72,7 @@ const getCurrentTime = new FunctionTool({ export const rootAgent = new LlmAgent({ name: 'hello_time_agent', - model: 'gemini-3.0-flash', + model: 'gemini-2.5-flash', description: 'Tells the current time in a specified city.', instruction: `You are a helpful assistant that tells the current time in a city. Use the 'getCurrentTime' tool for this purpose.`,