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

Fix Choices Deserialization #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kapunga
Copy link
Contributor

@kapunga kapunga commented Dec 7, 2024

Some OpenAPI Compatible APIs like Ollama don't always return lobprobs as part of the choices JSON. To handle this we need to add a default argument to logprobs so upickle can handle this case. A private case class is used to avoid having to change the order of arguments which would be a breaking change.

@adamw
Copy link
Member

adamw commented Dec 7, 2024

Breaking changes are fine in 0.x versions. Also, maybe there's a some chance to write a test?

Some OpenAPI Compatible APIs like Ollama don't always return `lobprobs`
as part of the `choices` JSON. To handle this we need to add a default
argument to `logprobs` so upickle can handle this case.

This PR moves the argument to the end which is breaking.

This PR also adds an ollama deserialization test for completions.
@kapunga kapunga force-pushed the kapunga-fix-deserialization branch from 7b805e7 to 29e240e Compare December 8, 2024 14:00
@kapunga
Copy link
Contributor Author

kapunga commented Dec 8, 2024

Breaking changes are fine in 0.x versions. Also, maybe there's a some chance to write a test?

Sounds good. I updated and added an ollama deserialization test that should also cover PR 242 as well.

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