go-chatgpt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
559 B

  1. package gogpt
  2. import (
  3. "net/http"
  4. )
  5. const (
  6. apiURLv1 = "http://chatgpt.zhiyinos.cn/"
  7. defaultEmptyMessagesLimit uint = 300
  8. )
  9. // ClientConfig is a configuration of a client.
  10. type ClientConfig struct {
  11. authToken string
  12. HTTPClient *http.Client
  13. BaseURL string
  14. OrgID string
  15. EmptyMessagesLimit uint
  16. }
  17. func DefaultConfig(authToken string) ClientConfig {
  18. return ClientConfig{
  19. HTTPClient: &http.Client{},
  20. BaseURL: apiURLv1,
  21. OrgID: "",
  22. authToken: authToken,
  23. EmptyMessagesLimit: defaultEmptyMessagesLimit,
  24. }
  25. }