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

Restore completions API #103

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

kalocide
Copy link

@kalocide kalocide commented Sep 2, 2024

Restores OpenaiEx.Completions API as outlined in #102, and the corresponding livebook.

The code here is just what was in the original module prior to its removal. I tested with meta-llama/llama-3.1-405b on OpenRouter. Both normal and streaming completions work, and the module has feature parity with the Python library, so I think rewriting it is unnecessary.

Anyways, thanks so much ^^ your code is a pleasure to work with.

@restlessronin
Copy link
Member

restlessronin commented Sep 3, 2024

@kalocide thank you for the kind words and the PR.

I made one small change. In v0.8.0, I split the API call "create" into "create!" and "create" - for exception throwing and [:ok, :error] returning versions. This was done throughout the API, to bring it in line with eclipse conventions.

I just did this for completions as well (which was left out of the v0.8.0 release)

Unfortunately, the original use of create was more like create!, so I have updated the notebook to use create! instead of create (to minimize other changes). It should work as is, but it would be great if you could test that as well.

Will get this merged as soon as you confirm that the changes work.

@kalocide
Copy link
Author

kalocide commented Sep 3, 2024

Makes sense, I'm a fan of the ! methods. And yep, the changes work great :)

@restlessronin restlessronin merged commit 76189a3 into cyberchitta:main Sep 4, 2024
1 check passed
@restlessronin
Copy link
Member

@kalocide published to hex.pm as v0.8.3.

@restlessronin
Copy link
Member

@kalocide, I just realized that somehow your account has not been added to the contributors for this repo. I'm not sure why. I'm guessing it may be due to the fact that I added the last commit to your PR when I modified it.

In any case, in the interest of acknowledging contributions, I would like to make sure that your account appears in the contributor list. If you could add a PR that makes a small improvement to the continuations notebook, I would accept it.

Alternatively, and this would be better in some ways, if you have an anonymous github email address, I can add you as a co-author on a suitable commit.

Either of these should get your account into the contributor list.

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