-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprovider.go
More file actions
29 lines (24 loc) · 842 Bytes
/
provider.go
File metadata and controls
29 lines (24 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package sight
import "context"
// Provider is the LLM interface that consumers inject. This decouples sight
// from any specific LLM SDK. Hawk implements this using eyrie; tests use a mock.
type Provider interface {
Chat(ctx context.Context, messages []Message, opts ChatOpts) (*Response, error)
}
// Message represents a single message in a conversation.
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
}
// ChatOpts controls the LLM request.
type ChatOpts struct {
Model string `json:"model,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
System string `json:"system,omitempty"`
}
// Response holds the LLM reply.
type Response struct {
Content string `json:"content"`
TokensUsed int `json:"tokens_used"`
}