@@ -142,10 +142,10 @@ func processAskRequest(ctx context.Context, question string) (string, error) {
142
142
}
143
143
144
144
func setupAskCtx (ctx context.Context , config map [string ]any , _ * CommandSender ) context.Context {
145
- log .Info ().Msg ("debug" )
146
145
// Initialize LLM client
147
146
var client openai.Client
148
147
{
148
+ log .Debug ().Msg ("initializing LLM client" )
149
149
llmCfg := config [cfgKeyAskLlmCfg ]
150
150
switch v := llmCfg .(type ) {
151
151
case map [string ]any :
@@ -159,25 +159,28 @@ func setupAskCtx(ctx context.Context, config map[string]any, _ *CommandSender) c
159
159
default :
160
160
client = openai .NewClient ()
161
161
}
162
+
163
+ log .Debug ().Msg ("initialized LLM client" )
162
164
}
163
165
164
166
// Initialize LLM tools
165
167
var mcpClients []mcpclient.MCPClient
166
168
var toolDeclarations []openai.ChatCompletionToolParam
167
169
{
168
170
mcpCfg := config [cfgKeyAskLlmMcpServers ]
169
- log .Info ().Any ("mcpCfg" , mcpCfg ).Msg ("start to initialize MCP client" )
170
171
switch v := mcpCfg .(type ) {
171
172
case map [string ]any :
172
173
for name , cfg := range v {
173
174
url := cfg .(map [string ]any )["base_url" ].(string )
175
+ log .Debug ().Str ("name" , name ).Str ("url" , url ).Msg ("initializing MCP SSE client" )
174
176
client , declarations , err := initializeMCPClient (ctx , name , url )
175
177
if err != nil {
176
178
log .Err (err ).Str ("name" , name ).Str ("url" , url ).Msg ("failed to initialize MCP SSE client" )
177
179
continue
178
180
}
179
181
mcpClients = append (mcpClients , client )
180
182
toolDeclarations = append (toolDeclarations , declarations ... )
183
+ log .Debug ().Str ("name" , name ).Str ("url" , url ).Msg ("initialized MCP SSE client" )
181
184
}
182
185
}
183
186
}
0 commit comments