on main help sign in
small fixes
commit170c7ad67abd840fd89aef3c79b5eff32e3aec5c authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 25 Apr 2025, 14:42 (2 years ago) parent7a62ab7
2 files changed+3−3
internal/llm/agent/mcp-tools.go+1−1 internal/llm/provider/anthropic.go+2−2
internal/llm/agent/mcp-tools.go+1−1
@@ -58,7 +58,7 @@ func runTool(ctx context.Context, c MCPClient, toolName string, input string) (t
5858 toolRequest := mcp.CallToolRequest{}
5959 toolRequest.Params.Name = toolName
6060 var args map[string]any
61− if err = json.Unmarshal([]byte(input), &input); err != nil {
61+ if err = json.Unmarshal([]byte(input), &args); err != nil {
6262 return tools.NewTextErrorResponse(fmt.Sprintf("error parsing parameters: %s", err)), nil
6363 }
6464 toolRequest.Params.Arguments = args
internal/llm/provider/anthropic.go+2−2
@@ -213,7 +213,7 @@ func (a *anthropicClient) send(ctx context.Context, messages []message.Message,
213213 return nil, retryErr
214214 }
215215 if retry {
216− logging.WarnPersist("Retrying due to rate limit... attempt %d of %d", logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
216+ logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
217217 select {
218218 case <-ctx.Done():
219219 return nil, ctx.Err()
@@ -351,7 +351,7 @@ func (a *anthropicClient) stream(ctx context.Context, messages []message.Message
351351 return
352352 }
353353 if retry {
354− logging.WarnPersist("Retrying due to rate limit... attempt %d of %d", logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
354+ logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
355355 select {
356356 case <-ctx.Done():
357357 // context cancelled