Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(provider): handling in config system #163

Merged
merged 1 commit into from
May 12, 2024
Merged

refactor(provider): handling in config system #163

merged 1 commit into from
May 12, 2024

Conversation

appleboy
Copy link
Owner

  • Update condition check to use String() method for openai.provider in commit.go
  • Replace constants OPENAI and AZURE with Provider type and add String() and IsValid() methods in options.go
  • Modify WithProvider function to use Provider type and validate with IsValid() method in options.go
  • Change provider field in config struct from string to Provider type in options.go
  • Update WithProvider calls in options_test.go to use String() method for Provider type

ref: #153

- Update condition check to use `String()` method for `openai.provider` in `commit.go`
- Replace constants `OPENAI` and `AZURE` with `Provider` type and add `String()` and `IsValid()` methods in `options.go`
- Modify `WithProvider` function to use `Provider` type and validate with `IsValid()` method in `options.go`
- Change `provider` field in `config` struct from `string` to `Provider` type in `options.go`
- Update `WithProvider` calls in `options_test.go` to use `String()` method for `Provider` type

Signed-off-by: appleboy <appleboy.tw@gmail.com>
@appleboy appleboy merged commit 967ab5a into main May 12, 2024
9 checks passed
@appleboy appleboy deleted the type branch May 12, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant