Browse Source

small fixes

Kujtim Hoxha 10 months ago
parent
commit
170c7ad67a
2 changed files with 3 additions and 3 deletions
  1. 1 1
      internal/llm/agent/mcp-tools.go
  2. 2 2
      internal/llm/provider/anthropic.go

+ 1 - 1
internal/llm/agent/mcp-tools.go

@@ -58,7 +58,7 @@ func runTool(ctx context.Context, c MCPClient, toolName string, input string) (t
 	toolRequest := mcp.CallToolRequest{}
 	toolRequest := mcp.CallToolRequest{}
 	toolRequest.Params.Name = toolName
 	toolRequest.Params.Name = toolName
 	var args map[string]any
 	var args map[string]any
-	if err = json.Unmarshal([]byte(input), &input); err != nil {
+	if err = json.Unmarshal([]byte(input), &args); err != nil {
 		return tools.NewTextErrorResponse(fmt.Sprintf("error parsing parameters: %s", err)), nil
 		return tools.NewTextErrorResponse(fmt.Sprintf("error parsing parameters: %s", err)), nil
 	}
 	}
 	toolRequest.Params.Arguments = args
 	toolRequest.Params.Arguments = args

+ 2 - 2
internal/llm/provider/anthropic.go

@@ -213,7 +213,7 @@ func (a *anthropicClient) send(ctx context.Context, messages []message.Message,
 				return nil, retryErr
 				return nil, retryErr
 			}
 			}
 			if retry {
 			if retry {
-				logging.WarnPersist("Retrying due to rate limit... attempt %d of %d", logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
+				logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
 				select {
 				select {
 				case <-ctx.Done():
 				case <-ctx.Done():
 					return nil, ctx.Err()
 					return nil, ctx.Err()
@@ -351,7 +351,7 @@ func (a *anthropicClient) stream(ctx context.Context, messages []message.Message
 				return
 				return
 			}
 			}
 			if retry {
 			if retry {
-				logging.WarnPersist("Retrying due to rate limit... attempt %d of %d", logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
+				logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
 				select {
 				select {
 				case <-ctx.Done():
 				case <-ctx.Done():
 					// context cancelled
 					// context cancelled