Skip to content

Commit

Permalink
openai: add make it possible to set the "user" in the gpt completion …
Browse files Browse the repository at this point in the history
…call
  • Loading branch information
brainexe committed Nov 8, 2023
1 parent 2e5c7ff commit d962a6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions command/openai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func CallChatGPT(cfg Config, inputMessages []ChatMessage, stream bool) (<-chan s
Temperature: cfg.Temperature,
Seed: cfg.Seed,
MaxTokens: cfg.MaxTokens,
User: cfg.APIUser,
Stream: stream,
Messages: inputMessages,
})
Expand Down
3 changes: 3 additions & 0 deletions command/openai/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type Config struct {

// log all input+output text to the logger. This could include personal information, therefore disabled by default!
LogTexts bool `mapstructure:"log_texts"`

// user name to identify the bot which should be part of the OpenAI usage statistics
APIUser string `mapstructure:"api_user"`
}

// IsEnabled checks if token is set
Expand Down

0 comments on commit d962a6a

Please sign in to comment.