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 and core interfaces #173

Merged
merged 1 commit into from
Jun 1, 2024
Merged

refactor: provider handling and core interfaces #173

merged 1 commit into from
Jun 1, 2024

Conversation

appleboy
Copy link
Owner

@appleboy appleboy commented Jun 1, 2024

  • Add error handling for invalid provider in commit.go
  • Replace NewOpenAI initialization with a switch case for different providers
  • Simplify the summary prefix retrieval logic in commit.go
  • Create a new core/openai.go file defining Usage, Response, and Generative interface
  • Create a new core/platform.go file defining Platform type and its methods
  • Implement Completion and GetSummaryPrefix methods in openai.go for the core.Generative interface
  • Refactor Completion method to completion in openai.go

- Add error handling for invalid provider in `commit.go`
- Replace `NewOpenAI` initialization with a switch case for different providers
- Simplify the summary prefix retrieval logic in `commit.go`
- Create a new `core/openai.go` file defining `Usage`, `Response`, and `Generative` interface
- Create a new `core/platform.go` file defining `Platform` type and its methods
- Implement `Completion` and `GetSummaryPrefix` methods in `openai.go` for the `core.Generative` interface
- Refactor `Completion` method to `completion` in `openai.go`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
@appleboy appleboy merged commit 6a7b4b2 into main Jun 1, 2024
11 checks passed
@appleboy appleboy deleted the core branch June 1, 2024 13:07
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