77 "path"
88 "slices"
99 "sort"
10- "strconv"
1110 "strings"
1211
1312 "cuelang.org/go/cue/cuecontext"
@@ -125,7 +124,7 @@ func BuildAgent(
125124 if modelName == "" || modelName == "default" {
126125 modelName = agt .Model
127126 }
128- fmt .Println ("BuildAgent" , agentName , modelName )
127+ // fmt.Println("BuildAgent", agentName, modelName)
129128 mdl , ok := models [modelName ]
130129 if ! ok {
131130 return nil , fmt .Errorf ("unknown model %q in agent %q" , modelName , agt .Name )
@@ -198,13 +197,13 @@ func buildMcp(cfg *config.Config, agt config.Agent, models map[string]model.LLM)
198197func buildTools (cfg * config.Config , agt config.Agent , models map [string ]model.LLM , environMDs map [string ]string ) ([]tool.Tool , error ) {
199198 var ts []tool.Tool
200199 for _ , t := range agt .Tools {
201- fmt .Printf ("%s.tool: %q\n " , agt .Name , t )
200+ // fmt.Printf("%s.tool: %q\n", agt.Name, t)
202201 var T tool.Tool
203202 var err error
204203
205204 // @<agent> handling
206205 agentAsTool , found := strings .CutPrefix (t , "@" )
207- fmt .Printf ("%s.tool.agent: %q ? %v\n " , agt .Name , agentAsTool , found )
206+ // fmt.Printf("%s.tool.agent: %q ? %v\n", agt.Name, agentAsTool, found)
208207 if found {
209208 A , aerr := BuildAgent (cfg , agentAsTool , "default" , models , environMDs )
210209 if aerr != nil {
@@ -275,14 +274,14 @@ func buildTools(cfg *config.Config, agt config.Agent, models map[string]model.LL
275274func addCallbacks (cfg * config.Config , agt config.Agent , environMDs map [string ]string , c * llmagent.Config ) {
276275 c .BeforeAgentCallbacks = []agent.BeforeAgentCallback {
277276 func (ctx agent.CallbackContext ) (* genai.Content , error ) {
278- fmt .Printf ("\n BAC.%s\n " , ctx .AgentName ())
277+ // fmt.Printf("\nBAC.%s\n", ctx.AgentName())
279278 return nil , nil
280279 },
281280 }
282281
283282 c .BeforeModelCallbacks = []llmagent.BeforeModelCallback {
284283 func (ctx agent.CallbackContext , req * model.LLMRequest ) (* model.LLMResponse , error ) {
285- fmt .Printf ("\n BMC.%s\n " , ctx .AgentName ())
284+ // fmt.Printf("\nBMC.%s\n", ctx.AgentName())
286285
287286 // This next section is all about making sure the state is in a good place
288287 // to match the data we are about to render instructions with
@@ -323,23 +322,23 @@ func addCallbacks(cfg *config.Config, agt config.Agent, environMDs map[string]st
323322
324323 // hmmm, little utils like this could get spread throughout the code
325324 // TODO, make a schema somewhere for the various config (cli, system, per-user, per-session, state)
326- showStr , err := ctx .State ().Get ("showSystemPrompt" )
327- fmt .Println ("showSystemPrompt.1?" , showStr , err )
328- if showStr != nil {
329- show , err := strconv .ParseBool (showStr .(string ))
330- fmt .Println ("showSystemPrompt.2?" , show , err )
331- if err == nil && show {
332- fmt .Println (req .Config .SystemInstruction .Parts [0 ].Text )
333- }
334- }
325+ // showStr, err := ctx.State().Get("showSystemPrompt")
326+ // fmt.Println("showSystemPrompt.1?", showStr, err)
327+ // if showStr != nil {
328+ // show, err := strconv.ParseBool(showStr.(string))
329+ // fmt.Println("showSystemPrompt.2?", show, err)
330+ // if err == nil && show {
331+ // fmt.Println(req.Config.SystemInstruction.Parts[0].Text)
332+ // }
333+ // }
335334
336335 return nil , nil
337336 },
338337 }
339338
340339 c .BeforeToolCallbacks = []llmagent.BeforeToolCallback {
341340 func (ctx tool.Context , t tool.Tool , args map [string ]any ) (map [string ]any , error ) {
342- fmt .Printf ("\n BTC.%s.%s\n " , ctx .AgentName (), t .Name ())
341+ // fmt.Printf("\nBTC.%s.%s\n", ctx.AgentName(), t.Name())
343342 return nil , nil
344343 },
345344 }
@@ -350,21 +349,21 @@ func addCallbacks(cfg *config.Config, agt config.Agent, environMDs map[string]st
350349
351350 c .AfterToolCallbacks = []llmagent.AfterToolCallback {
352351 func (ctx tool.Context , t tool.Tool , args , result map [string ]any , err error ) (map [string ]any , error ) {
353- fmt .Printf ("\n ATC.%s.%s %v\n " , ctx .AgentName (), t .Name (), err )
352+ // fmt.Printf("\nATC.%s.%s %v\n", ctx.AgentName(), t.Name(), err)
354353 return result , err
355354 },
356355 }
357356
358357 c .AfterModelCallbacks = []llmagent.AfterModelCallback {
359358 func (ctx agent.CallbackContext , res * model.LLMResponse , err error ) (* model.LLMResponse , error ) {
360- fmt .Printf ("\n AMC.%s %v\n " , ctx .AgentName (), err )
359+ // fmt.Printf("\nAMC.%s %v\n", ctx.AgentName(), err)
361360 return res , err
362361 },
363362 }
364363
365364 c .AfterAgentCallbacks = []agent.AfterAgentCallback {
366365 func (ctx agent.CallbackContext ) (* genai.Content , error ) {
367- fmt .Printf ("\n AAC.%s\n " , ctx .AgentName ())
366+ // fmt.Printf("\nAAC.%s\n", ctx.AgentName())
368367 return nil , nil
369368 },
370369 }
0 commit comments