code.oscarkilo.com/klex-git

Hash:
38c841628ad0582b9c2054e92165fa4eee0d59d1
Author:
Igor Naverniouk <[email protected]>
Date:
Mon Sep 30 14:41:29 2024 -0700
Message:
better flags
diff --git a/api/funcs.go b/api/funcs.go
index 1494442..1b06d77 100644
--- a/api/funcs.go
+++ b/api/funcs.go
@@ -42,8 +42,8 @@ type LLMFunc struct {
// Model is the provider-assigned name of the LLM.
Model string `json:"model"`

- CanDoImages bool `json:"can_do_images"`
- CanDoSystemPromps bool `json:"can_do_system_prompts"`
+ CanSeeImages bool `json:"can_see_images"`
+ CanHaveSystemPromps bool `json:"can_have_system_prompts"`
}

type Func struct {
a/api/funcs.go
b/api/funcs.go
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"` // LLM2 must be nil
5
JsCode string `json:"js_code,omitempty"` // LLM2 must be nil
6
LLM2 *LLMFunc `json:"llm2,omitempty"` // JSCode must be ""
6
LLM2 *LLMFunc `json:"llm2,omitempty"` // JSCode 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 is the globally unique ID of this immutable object.
23
Hash string `json:"hash"`
23
Hash string `json:"hash"`
24
24
25
// Date is the time of creation, according to the server's clock.
25
// Date is the time of creation, according to the server's clock.
26
Date string `json:"date"`
26
Date string `json:"date"`
27
27
28
// JS is JavaScript code that implements this function.
28
// JS is JavaScript code that implements this function.
29
JS string `json:"js,omitempty"`
29
JS string `json:"js,omitempty"`
30
30
31
// LLM is the old "provider:model" string. Deprecated.
31
// LLM is the old "provider:model" string. Deprecated.
32
LLM string `json:"llm,omitempty"`
32
LLM string `json:"llm,omitempty"`
33
33
34
// LLM2 confugures where an how the LLM is run.
34
// LLM2 confugures where an how the LLM is run.
35
LLM2 *LLMFunc `json:"llm2,omitempty"`
35
LLM2 *LLMFunc `json:"llm2,omitempty"`
36
}
36
}
37
37
38
type LLMFunc struct {
38
type LLMFunc struct {
39
// Provider is "openai", "anthropic", "fireworks", etc.
39
// Provider is "openai", "anthropic", "fireworks", etc.
40
Provider string `json:"provider"`
40
Provider string `json:"provider"`
41
41
42
// Model is the provider-assigned name of the LLM.
42
// Model is the provider-assigned name of the LLM.
43
Model string `json:"model"`
43
Model string `json:"model"`
44
44
45
CanDoImages bool `json:"can_do_images"`
45
CanSeeImages bool `json:"can_see_images"`
46
CanDoSystemPromps bool `json:"can_do_system_prompts"`
46
CanHaveSystemPromps bool `json:"can_have_system_prompts"`
47
}
47
}
48
48
49
type Func struct {
49
type Func struct {
50
Name string `json:"name"`
50
Name string `json:"name"`
51
Versions []FuncVersion `json:"versions"`
51
Versions []FuncVersion `json:"versions"`
52
}
52
}
53
53
54
type ListFuncsResponse struct {
54
type ListFuncsResponse struct {
55
Funcs []Func `json:"funcs"`
55
Funcs []Func `json:"funcs"`
56
}
56
}