@@ -12,6 +12,7 @@ import (
1212 "google.golang.org/adk/runner"
1313 "google.golang.org/adk/session"
1414 "google.golang.org/adk/tool"
15+ "google.golang.org/adk/tool/functiontool"
1516
1617 "google.golang.org/genai"
1718)
@@ -20,7 +21,7 @@ import (
2021// to simulate a real-world stock data API. This allows the example to
2122// demonstrate tool functionality without making external network calls.
2223var mockStockPrices = map [string ]float64 {
23- "GOOG" : 600 .6 ,
24+ "GOOG" : 300 .6 ,
2425 "AAPL" : 123.4 ,
2526 "MSFT" : 234.5 ,
2627}
@@ -57,8 +58,8 @@ func getStockPrice(ctx tool.Context, input getStockPriceArgs) getStockPriceResul
5758// on how to respond to user queries about stock prices. It uses the
5859// Gemini model to understand user intent and decide when to use its tools.
5960func createStockAgent (ctx context.Context ) (agent.Agent , error ) {
60- stockPriceTool , err := tool . NewFunctionTool (
61- tool. FunctionToolConfig {
61+ stockPriceTool , err := functiontool . New (
62+ functiontool. Config {
6263 Name : "get_stock_price" ,
6364 Description : "Retrieves the current stock price for a given symbol." ,
6465 },
@@ -129,7 +130,7 @@ func callAgent(ctx context.Context, a agent.Agent, prompt string) {
129130 Role : string (genai .RoleUser ),
130131 }
131132
132- for event , err := range r .Run (ctx , userID , sessionID , userMsg , & agent.RunConfig {
133+ for event , err := range r .Run (ctx , userID , sessionID , userMsg , agent.RunConfig {
133134 StreamingMode : agent .StreamingModeSSE ,
134135 }) {
135136 if err != nil {
0 commit comments