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

Add OpenAI Mock Server #31

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

RobotSail
Copy link
Contributor

@RobotSail RobotSail commented Aug 2, 2022

This PR introduces the following changes:

  • EditsUsage and CompletionsUsage are removed and Usage is created as a separate type in common.go
  • Some available models are added as constants for the completions endpoint so that they can be included in the CompletionRequest.Model field
  • A mocked server is added for testing the edits and completions endpoint
  • Makefile along with targets to downloads to install golangci-lint
  • Fixes up the code so that the linter will pass
  • Includes the golden golangci-lint file

Note: not all of the endpoints have been implemented with the mocked server yet, and we should continue to do so as more changes are iterated on in this project.

This PR aims to close out #30, however we should aim to increase the amount of testing done and add coverage data.

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

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

Awesome work! My concerns here are mostly about

  • curl | sh for golang-ci setup
  • golang-ci config strictness and related changes to make linter happy

Makefile Outdated Show resolved Hide resolved
answers.go Outdated Show resolved Hide resolved
api_test.go Show resolved Hide resolved
api_test.go Show resolved Hide resolved
Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
@sashabaranov sashabaranov merged commit d63df93 into sashabaranov:master Aug 11, 2022
@sashabaranov
Copy link
Owner

Great work, thank you for the PR! 🔥

@RobotSail RobotSail deleted the openai-test-server branch August 23, 2022 22:00
@RobotSail RobotSail mentioned this pull request Jan 26, 2023
10 tasks
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