Skip to content

Commit

Permalink
use completionWithEngine (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
sozercan authored Mar 21, 2023
1 parent 3df2727 commit 2de181b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ My main motivation is to avoid finding and collecting random manifests when dev/

`kubectl-ai` requires an [OpenAI API key](https://platform.openai.com/overview) or an [Azure OpenAI Service](https://aka.ms/azure-openai) API key and endpoint, and a valid Kubernetes configuration.

> I don't have a non-Azure OpenAI API key, non-Azure OpenAI API is not tested.
For both OpenAI and Azure OpenAI, you can use the following environment variables:

```shell
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func gptCompletion(ctx context.Context, client oaiClients, prompts []string, dep
}

if azureOpenAIEndpoint == nil || *azureOpenAIEndpoint == "" {
resp, err := client.openAIClient.Completion(ctx, openai.CompletionRequest{
resp, err := client.openAIClient.CompletionWithEngine(ctx, *openAIDeploymentName, openai.CompletionRequest{
Prompt: []string{prompt.String()},
MaxTokens: maxTokens,
Echo: false,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/sozercan/kubectl-ai
go 1.20

require (
github.com/PullRequestInc/go-gpt3 v1.1.13
github.com/PullRequestInc/go-gpt3 v1.1.14
github.com/manifoldco/promptui v0.9.0
github.com/samber/go-gpt-3-encoder v0.3.1
github.com/spf13/cobra v1.6.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/PullRequestInc/go-gpt3 v1.1.13 h1:VF4FjnTNhjUfD+Rf9+V4zwoAzP4NEaA3Dl65RCsmLDE=
github.com/PullRequestInc/go-gpt3 v1.1.13/go.mod h1:F9yzAy070LhkqHS2154/IH0HVj5xq5g83gLTj7xzyfw=
github.com/PullRequestInc/go-gpt3 v1.1.14 h1:lzdgdcM51mCE8+hcGA5bEmZEGOCZI3R/RaaeKceLLd8=
github.com/PullRequestInc/go-gpt3 v1.1.14/go.mod h1:F9yzAy070LhkqHS2154/IH0HVj5xq5g83gLTj7xzyfw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down

0 comments on commit 2de181b

Please sign in to comment.