summaryrefslogtreecommitdiffhomepage
path: root/internal/llm/provider
diff options
context:
space:
mode:
Diffstat (limited to 'internal/llm/provider')
-rw-r--r--internal/llm/provider/anthropic.go5
-rw-r--r--internal/llm/provider/provider.go5
2 files changed, 7 insertions, 3 deletions
diff --git a/internal/llm/provider/anthropic.go b/internal/llm/provider/anthropic.go
index f42c601a5..239d67606 100644
--- a/internal/llm/provider/anthropic.go
+++ b/internal/llm/provider/anthropic.go
@@ -149,8 +149,8 @@ func (a *anthropicProvider) StreamResponse(ctx context.Context, messages []messa
// Inform user we're retrying with attempt number
eventChan <- ProviderEvent{
- Type: EventContentDelta,
- Content: fmt.Sprintf("\n\n[Retrying due to rate limit... attempt %d of %d]\n\n", attempts, maxRetries),
+ Type: EventWarning,
+ Info: fmt.Sprintf("[Retrying due to rate limit... attempt %d of %d]", attempts, maxRetries),
}
// Calculate backoff with exponential backoff and jitter
@@ -380,4 +380,3 @@ func (a *anthropicProvider) convertToAnthropicMessages(messages []message.Messag
return anthropicMessages
}
-
diff --git a/internal/llm/provider/provider.go b/internal/llm/provider/provider.go
index f40429738..cd3a7aa05 100644
--- a/internal/llm/provider/provider.go
+++ b/internal/llm/provider/provider.go
@@ -17,6 +17,8 @@ const (
EventContentStop EventType = "content_stop"
EventComplete EventType = "complete"
EventError EventType = "error"
+ EventWarning EventType = "warning"
+ EventInfo EventType = "info"
)
type TokenUsage struct {
@@ -40,6 +42,9 @@ type ProviderEvent struct {
ToolCall *message.ToolCall
Error error
Response *ProviderResponse
+
+ // Used for giving users info on e.x retry
+ Info string
}
type Provider interface {