summaryrefslogtreecommitdiff
path: root/internal/lsp/testhelper_capture_llm_test.go
blob: 3274141c8090bb92e47cb8b7e091f1ec204eb0b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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" }