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

EmbeddingResponse should be a List<float> rather than List<double> #219

Open
guygodin opened this issue Apr 7, 2023 · 1 comment
Open
Labels
enhancement New feature or request
Milestone

Comments

@guygodin
Copy link

guygodin commented Apr 7, 2023

In most algorithms, computing the dot-product for embeddings to check for text similarity will be done against 2 float arrays so it would make more sense to read the data as float rather than double.

There could always be typed CreateEmbeddingResponseFloat and CreateEmbeddingResponseDouble classes.

Great library btw, love using it!
Thanks!

@kayhantolga
Copy link
Member

Thanks 🙏🏻

The response from OpenAI has 18 digits. Choosing a float type would result in significant data loss. However, I can create a generic type response for those who prioritize performance over precision. Let me think about implementation.

https://stackoverflow.com/questions/618535/difference-between-decimal-float-and-double-in-net

@kayhantolga kayhantolga added the enhancement New feature or request label Apr 15, 2023
@kayhantolga kayhantolga added this to the Big Refactor milestone Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants