Skip to content

Commit

Permalink
Update Doctor's engine to gpt-3.5-turbo-instinct and fix prompt (#1349
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pkosiec authored Jan 16, 2024
1 parent 5fb61f8 commit aedeb1f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/DanielTitkov/go-adaptive-cards v0.2.2
github.com/MakeNowJust/heredoc v1.0.0
github.com/Masterminds/sprig/v3 v3.2.3
github.com/PullRequestInc/go-gpt3 v1.1.15
github.com/PullRequestInc/go-gpt3 v1.2.0
github.com/alexflint/go-arg v1.4.3
github.com/allegro/bigcache/v3 v3.1.0
github.com/anthhub/forwarder v1.1.1-0.20230315114022-63dcf7b46a1a
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwF
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PullRequestInc/go-gpt3 v1.1.15 h1:pidXZbpqZVW0bp8NBNKDb+/++6PFdYfht9vw2CVpaUs=
github.com/PullRequestInc/go-gpt3 v1.1.15/go.mod h1:F9yzAy070LhkqHS2154/IH0HVj5xq5g83gLTj7xzyfw=
github.com/PullRequestInc/go-gpt3 v1.2.0 h1:2Yr4e3VO/gQnvSdj1bJYIFzubaGjV7p9oGoQjHvQJPY=
github.com/PullRequestInc/go-gpt3 v1.2.0/go.mod h1:F9yzAy070LhkqHS2154/IH0HVj5xq5g83gLTj7xzyfw=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down
2 changes: 1 addition & 1 deletion internal/executor/doctor/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"description": "Default engine to use",
"type": "string",
"title": "Default Engine",
"default": "text-davinci-003"
"default": "gpt-3.5-turbo-instruct"
},
"organizationID": {
"description": "Optional organization ID",
Expand Down
5 changes: 3 additions & 2 deletions internal/executor/doctor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (

const (
PluginName = "doctor"
promptTemplate = "Can you show me 3 possible kubectl commands to take an action after resource '%s' in namespace '%s' (if namespace needed) fails with error '%s'?"
promptTemplate = "Show me 3 possible kubectl commands to take an action after resource '%s' in namespace '%s' (if namespace needed) fails with error '%s'. Do not include any descriptions, just return raw commands."
defaultAPIBaseURL = "https://api.openai.com/v1"
defaultUserAgent = "go-gpt3"
defaultEngineValue = "gpt-3.5-turbo-instruct" // it is missing from the go-gpt3 library
printAPIKeyCharCount = 3
)

Expand Down Expand Up @@ -177,7 +178,7 @@ func (d *Executor) getGptClient(log logrus.FieldLogger, cfg Config) (gpt3.Client
baseURL = cfg.APIBaseURL
}

defaultEngine := gpt3.TextDavinci003Engine
defaultEngine := defaultEngineValue
if cfg.DefaultEngine != "" {
defaultEngine = cfg.DefaultEngine
}
Expand Down

0 comments on commit aedeb1f

Please sign in to comment.