-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
38 lines (31 loc) · 901 Bytes
/
types.go
File metadata and controls
38 lines (31 loc) · 901 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
30
31
32
33
34
35
36
37
38
package wise
import (
"context"
"github.com/j0lvera/wise/executor"
"github.com/j0lvera/wise/models"
)
// Re-export types for convenience.
type (
Message = models.Message
TokenUsage = models.TokenUsage
Action = executor.Action
Output = executor.Output
)
// Role constants.
const (
RoleSystem = "system"
RoleUser = "user"
RoleAssistant = "assistant"
)
// Agent defines the contract for an LLM-powered agent.
type Agent interface {
Run(ctx context.Context, task string) (string, error)
Step(ctx context.Context) (string, error)
}
// Parser extracts actions from LLM responses.
type Parser interface {
ParseAction(response string) (Action, error)
}
// ActionHandler processes custom action types.
// Returns (output, handled, error) - if handled is false, default processing is used.
type ActionHandler func(ctx context.Context, action Action) (Output, bool, error)