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

Open ai wrapper #1371

Open
wants to merge 8 commits into
base: development
Choose a base branch
from

Conversation

yash-sojitra
Copy link

#1242

Description:

  • wrote wrapper for chat completions endpoint of openai api
  • issue no 1242
  • used raw api endpoint instead of openai's own wrapper to eliminate an additional layer

Checklist:

  • [✅] I have formatted my code using goimport and golangci-lint.
  • [✅] All new code is covered by unit tests.
  • [✅] This PR does not decrease the overall code coverage.
  • [✅] I have reviewed the code comments and documentation for clarity.

@vikash
Copy link
Contributor

vikash commented Jan 8, 2025

Should we put this in datasource or in service package instead?

@yash-sojitra
Copy link
Author

Currently it's in data source. I had some confusions about this. So at last after that issue discussion I decided to build it in data source.

pkg/gofr/datasource/openai/chatcompletion.go Show resolved Hide resolved
pkg/gofr/datasource/openai/client.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/chatcompletion.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/chatcompletion.go Show resolved Hide resolved
pkg/gofr/datasource/openai/client.go Show resolved Hide resolved
pkg/gofr/datasource/openai/logger.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/logger.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/client_test.go Outdated Show resolved Hide resolved
@yash-sojitra
Copy link
Author

@ccoVeille I have updated the PR.

pkg/gofr/datasource/openai/chatcompletion.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/chatcompletion.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/chatcompletion_test.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/chatcompletion_test.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/client.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/client.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/openai/client.go Outdated Show resolved Hide resolved
@yash-sojitra
Copy link
Author

@ccoVeille I have updated the pr and replied to some of the conversations.

Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@yash-sojitra
Copy link
Author

@Umang01-hash approval with write access required for the PR. it's already reviewed.

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.

4 participants