File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,14 @@ type Client struct {
18
18
}
19
19
20
20
type Options struct {
21
- Cache * bool `usage:"Disable caching" default:"true "`
22
- CacheDir string `usage:"Directory to store cache (default: $XDG_CACHE_HOME/gptscript)"`
21
+ DisableCache bool `usage:"Disable caching of LLM API responses "`
22
+ CacheDir string `usage:"Directory to store cache (default: $XDG_CACHE_HOME/gptscript)"`
23
23
}
24
24
25
25
func Complete (opts ... Options ) (result Options ) {
26
26
for _ , opt := range opts {
27
27
result .CacheDir = types .FirstSet (opt .CacheDir , result .CacheDir )
28
- result .Cache = types .FirstSet (opt .Cache , result .Cache )
29
- }
30
- if result .Cache == nil {
31
- result .Cache = & []bool {true }[0 ]
28
+ result .DisableCache = types .FirstSet (opt .DisableCache , result .DisableCache )
32
29
}
33
30
if result .CacheDir == "" {
34
31
result .CacheDir = filepath .Join (xdg .CacheHome , version .ProgramName )
@@ -54,7 +51,7 @@ func New(opts ...Options) (*Client, error) {
54
51
}
55
52
return & Client {
56
53
dir : opt .CacheDir ,
57
- noop : ! * opt .Cache ,
54
+ noop : opt .DisableCache ,
58
55
}, nil
59
56
}
60
57
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ func complete(opts ...Options) (result Options, err error) {
68
68
69
69
if result .Cache == nil {
70
70
result .Cache , err = cache .New (cache.Options {
71
- Cache : new ( bool ) ,
71
+ DisableCache : true ,
72
72
})
73
73
}
74
74
You can’t perform that action at this time.
0 commit comments