Skip to content

Commit

Permalink
Centralize and fix OpenAI key handling
Browse files Browse the repository at this point in the history
This was moved around as part of #33, should be fixed by this commit.
  • Loading branch information
sd2k committed Sep 14, 2023
1 parent b605e7b commit 30184ce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/plugin/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ type OpenAISettings struct {
type Settings struct {
OpenAI OpenAISettings `json:"openAI"`

openAIKey string

Vector vector.VectorSettings `json:"vector"`
}

Expand All @@ -31,6 +29,6 @@ func loadSettings(appSettings backend.AppInstanceSettings) Settings {
}
_ = json.Unmarshal(appSettings.JSONData, &settings)

settings.openAIKey = appSettings.DecryptedSecureJSONData[openAIKey]
settings.OpenAI.apiKey = appSettings.DecryptedSecureJSONData[openAIKey]
return settings
}

0 comments on commit 30184ce

Please sign in to comment.