diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-16 15:56:38 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-16 15:56:38 +0300 |
| commit | 2caaae5863c2fd31803a6d944ced4b8b0a7b5e36 (patch) | |
| tree | ac3d01a160eecf9c01e9d72751020b59cf08ca57 | |
| parent | 6cbf880aa079f072c16aca043e79da68220e541e (diff) | |
llm/openai: log full message and response content without truncation; keep cyan/green coloring and base black/grey styling
| -rw-r--r-- | internal/llm/openai.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/llm/openai.go b/internal/llm/openai.go index a5d473c..45cb1b8 100644 --- a/internal/llm/openai.go +++ b/internal/llm/openai.go @@ -95,8 +95,8 @@ func (c *openAIClient) Chat(ctx context.Context, messages []Message, opts ...Req start := time.Now() c.logf("chat start model=%s temp=%.2f max_tokens=%d stop=%d messages=%d", o.Model, o.Temperature, o.MaxTokens, len(o.Stop), len(messages)) for i, m := range messages { - // Sending context (cyan) - c.logf("msg[%d] role=%s size=%d preview=%s%s%s", i, m.Role, len(m.Content), ansiCyan, trimPreview(m.Content, 200), ansiNormal) + // Sending context (cyan) — log full content with real newlines + c.logf("msg[%d] role=%s size=%d preview=%s%s%s", i, m.Role, len(m.Content), ansiCyan, m.Content, ansiNormal) } req := oaChatRequest{Model: o.Model} req.Messages = make([]oaMessage, len(messages)) @@ -154,8 +154,8 @@ func (c *openAIClient) Chat(ctx context.Context, messages []Message, opts ...Req return "", errors.New("openai: no choices returned") } content := out.Choices[0].Message.Content - // Received context (green) - c.logf("success choice=0 finish=%s size=%d preview=%s%s%s duration=%s", out.Choices[0].FinishReason, len(content), ansiGreen, trimPreview(content, 200), ansiNormal, time.Since(start)) + // Received context (green) — log full content with real newlines + c.logf("success choice=0 finish=%s size=%d preview=%s%s%s duration=%s", out.Choices[0].FinishReason, len(content), ansiGreen, content, ansiNormal, time.Since(start)) return content, nil } |
