@@ -25,14 +25,15 @@ import (
2525 "testing"
2626 "time"
2727
28+ "google.golang.org/genai"
29+
2830 "google.golang.org/adk/agent"
2931 "google.golang.org/adk/agent/llmagent"
3032 "google.golang.org/adk/model"
3133 "google.golang.org/adk/runner"
3234 "google.golang.org/adk/session"
3335 "google.golang.org/adk/tool"
3436 "google.golang.org/adk/tool/functiontool"
35- "google.golang.org/genai"
3637)
3738
3839// FakeLLM is a mock implementation of model.LLM for testing.
@@ -117,7 +118,8 @@ func beforeAgentCallback(t *testing.T) agent.BeforeAgentCallback {
117118 title : "In before_agent_callback" ,
118119 keysInCtxSession : []string {"before_agent_callback_state_key" },
119120 keysInServiceSession : []string {},
120- keysNotInServiceSession : []string {"before_agent_callback_state_key" }},
121+ keysNotInServiceSession : []string {"before_agent_callback_state_key" },
122+ },
121123 )
122124 return nil , nil
123125 }
@@ -132,7 +134,8 @@ func beforeModelCallback(t *testing.T) func(ctx agent.CallbackContext, llmReques
132134 title : "In before_model_callback" ,
133135 keysInCtxSession : []string {"before_agent_callback_state_key" , "before_model_callback_state_key" },
134136 keysInServiceSession : []string {"before_agent_callback_state_key" },
135- keysNotInServiceSession : []string {"before_model_callback_state_key" }},
137+ keysNotInServiceSession : []string {"before_model_callback_state_key" },
138+ },
136139 )
137140 return nil , nil
138141 }
@@ -147,7 +150,8 @@ func afterModelCallback(t *testing.T) func(ctx agent.CallbackContext, llmRespons
147150 title : "In after_model_callback" ,
148151 keysInCtxSession : []string {"before_agent_callback_state_key" , "before_model_callback_state_key" , "after_model_callback_state_key" },
149152 keysInServiceSession : []string {"before_agent_callback_state_key" },
150- keysNotInServiceSession : []string {"before_model_callback_state_key" , "after_model_callback_state_key" }},
153+ keysNotInServiceSession : []string {"before_model_callback_state_key" , "after_model_callback_state_key" },
154+ },
151155 )
152156 return nil , nil
153157 }
@@ -162,7 +166,8 @@ func afterAgentCallback(t *testing.T) agent.AfterAgentCallback {
162166 title : "In after_agent_callback" ,
163167 keysInCtxSession : []string {"before_agent_callback_state_key" , "before_model_callback_state_key" , "after_model_callback_state_key" , "after_agent_callback_state_key" },
164168 keysInServiceSession : []string {"before_agent_callback_state_key" , "before_model_callback_state_key" , "after_model_callback_state_key" },
165- keysNotInServiceSession : []string {"after_agent_callback_state_key" }},
169+ keysNotInServiceSession : []string {"after_agent_callback_state_key" },
170+ },
166171 )
167172 return nil , nil
168173 }
@@ -424,7 +429,7 @@ func beforeToolValidationCallback(ctx tool.Context, t tool.Tool, args map[string
424429
425430// --- After Tool Callbacks ---
426431
427- func afterToolEnhancementCallback (ctx tool.Context , t tool.Tool , args map [ string ] any , result map [string ]any , err error ) (map [string ]any , error ) {
432+ func afterToolEnhancementCallback (ctx tool.Context , t tool.Tool , args , result map [string ]any , err error ) (map [string ]any , error ) {
428433 if err != nil {
429434 return result , err // Don't enhance if there was an error
430435 }
@@ -438,7 +443,7 @@ func afterToolEnhancementCallback(ctx tool.Context, t tool.Tool, args map[string
438443 return enhancedResponse , nil
439444}
440445
441- func afterToolAsyncCallback (ctx tool.Context , t tool.Tool , args map [ string ] any , result map [string ]any , err error ) (map [string ]any , error ) {
446+ func afterToolAsyncCallback (ctx tool.Context , t tool.Tool , args , result map [string ]any , err error ) (map [string ]any , error ) {
442447 if err != nil {
443448 return result , err
444449 }
0 commit comments