1
package api
1
package api
2
2
3
type NewFuncRequest struct {
3
type NewFuncRequest struct {
4
Name string `json:"name"` // no need to be unique
4
Name string `json:"name"` // no need to be unique
5
JsCode string `json:"js_code,omitempty"` // L must be
5
JsCode string `json:"js_code,omitempty"` // L must be
6
L n `json:"llm,omitempty"` // JCode must be ""
6
L n `json:"llm,omitempty"` // JCode must be ""
7
}
7
}
8
8
9
type NewFuncResponse struct {
9
type NewFuncResponse struct {
10
Name string `json:"name"`
10
Name string `json:"name"`
11
DateCreated string `json:"date_created"` // RFC8601 with millis
11
DateCreated string `json:"date_created"` // RFC8601 with millis
12
}
12
}
13
13
14
type DeleteFuncRequest struct {
14
type DeleteFuncRequest struct {
15
Name string `json:"name"`
15
Name string `json:"name"`
16
}
16
}
17
17
18
type DeleteFuncResponse struct {
18
type DeleteFuncResponse struct {
19
}
19
}
20
20
21
type FuncVersion struct {
21
type FuncVersion struct {
22
// Hash is the globally unique ID of this immutable object.
22
Hash string `json:"hash"`
23
Hash string `json:"hash"`
24
25
// Date is the time of creation, according to the server's clock.
23
Date string `json:"date"`
26
Date string `json:"date"`
27
28
// JS is JavaScript code that implements this function.
24
JS string `json:"js,omitempty"`
29
JS string `json:"js,omitempty"`
30
31
// LLM is the old "provider:model" string. Deprecated.
25
LLM string `json:"llm,omitempty"`
32
LLM string `json:"llm,omitempty"`
33
34
// LLM2 confugures where an how the LLM is run.
35
LLM2 *LLMFunc `json:"llm2,omitempty"`
36
}
37
38
type LLMFunc struct {
39
// Provider is "openai", "anthropic", "fireworks", etc.
40
Provider string `json:"provider"`
41
42
// Model is the provider-assigned name of the LLM.
43
Model string `json:"model"`
44
45
CanDoImages bool `json:"can_do_images"`
46
CanDoSystemPromps bool `json:"can_do_system_prompts"`
26
}
47
}
27
48
28
type Func struct {
49
type Func struct {
29
Name string `json:"name"`
50
Name string `json:"name"`
30
Versions []FuncVersion `json:"versions"`
51
Versions []FuncVersion `json:"versions"`
31
}
52
}
32
53
33
type ListFuncsResponse struct {
54
type ListFuncsResponse struct {
34
Funcs []Func `json:"funcs"`
55
Funcs []Func `json:"funcs"`
35
}
56
}