summaryrefslogtreecommitdiff
path: root/internal/lsp/testhelper_capture_llm_test.go
blob: 2e63ca742f033b4b16cb3f7337cf9b48ca18c58e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package lsp

import (
	"context"

	"codeberg.org/snonux/hexai/internal/llm"
)

// captureLLM captures messages sent to Chat for assertions.
type captureLLM struct{ msgs []llm.Message }

func (c *captureLLM) Chat(_ context.Context, m []llm.Message, _ ...llm.RequestOption) (string, error) {
	c.msgs = append([]llm.Message{}, m...)
	return "OK", nil
}
func (*captureLLM) Name() string         { return "cap" }
func (*captureLLM) DefaultModel() string { return "m" }