-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathagentconfig.go
More file actions
87 lines (76 loc) · 1.55 KB
/
agentconfig.go
File metadata and controls
87 lines (76 loc) · 1.55 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
package components
import (
"encoding/json"
"fmt"
)
// AgentEnum - Name of the agent.
type AgentEnum string
const (
AgentEnumDefault AgentEnum = "DEFAULT"
AgentEnumGpt AgentEnum = "GPT"
AgentEnumUniversal AgentEnum = "UNIVERSAL"
)
func (e AgentEnum) ToPointer() *AgentEnum {
return &e
}
func (e *AgentEnum) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "DEFAULT":
fallthrough
case "GPT":
fallthrough
case "UNIVERSAL":
*e = AgentEnum(v)
return nil
default:
return fmt.Errorf("invalid value for AgentEnum: %v", v)
}
}
// Mode - Top level modes to run GleanChat in.
type Mode string
const (
ModeDefault Mode = "DEFAULT"
ModeQuick Mode = "QUICK"
)
func (e Mode) ToPointer() *Mode {
return &e
}
func (e *Mode) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "DEFAULT":
fallthrough
case "QUICK":
*e = Mode(v)
return nil
default:
return fmt.Errorf("invalid value for Mode: %v", v)
}
}
// AgentConfig - Describes the agent that executes the request.
type AgentConfig struct {
// Name of the agent.
Agent *AgentEnum `json:"agent,omitempty"`
// Top level modes to run GleanChat in.
Mode *Mode `json:"mode,omitempty"`
}
func (o *AgentConfig) GetAgent() *AgentEnum {
if o == nil {
return nil
}
return o.Agent
}
func (o *AgentConfig) GetMode() *Mode {
if o == nil {
return nil
}
return o.Mode
}