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

feat: Support Delete Message API #799

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

kappa-lab
Copy link
Contributor

@kappa-lab kappa-lab commented Jul 19, 2024

Describe the change

  • support Delete Message API
  • No breaking changes

OpenAI documentation

relevant API doc from https://platform.openai.com/docs/api-reference/messages/deleteMessage

Additional context

  • fix lint

@kappa-lab kappa-lab marked this pull request as ready for review July 19, 2024 07:07
@kappa-lab kappa-lab changed the title feat: Add DeleteMessage function to API client feat: Support Delete Message API Jul 19, 2024
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.01%. Comparing base (774fc9d) to head (8facd6e).
Report is 42 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #799      +/-   ##
==========================================
+ Coverage   98.46%   99.01%   +0.55%     
==========================================
  Files          24       26       +2     
  Lines        1364     1418      +54     
==========================================
+ Hits         1343     1404      +61     
+ Misses         15        8       -7     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

messages_test.go Outdated
"github.com/sashabaranov/go-openai/internal/test/checks"
)

var emptyStr = ""

// TestMessages Tests the messages endpoint of the API using the mocked server.
func TestMessages(t *testing.T) {
func registerServer(t *testing.T, server *test.ServerTest) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

split func for linter

Copy link
Owner

Choose a reason for hiding this comment

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

The registerServer name is very generic, let's name it with something more concrete for this test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rename to setupServerForTestMessage
8facd6e

nolint : Deprecated method
split function: cognitive complexity 21
@sashabaranov
Copy link
Owner

Thank you for the PR! Added a minor comment

@sashabaranov sashabaranov merged commit 6d02119 into sashabaranov:master Aug 22, 2024
3 checks passed
@kappa-lab kappa-lab deleted the feature/delete_message branch August 23, 2024 03:38
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.

2 participants