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

Embeddings response are all [][]float32 regardless of type #69

Open
Dmarcotrigiano opened this issue Mar 27, 2024 · 2 comments
Open

Embeddings response are all [][]float32 regardless of type #69

Dmarcotrigiano opened this issue Mar 27, 2024 · 2 comments
Assignees

Comments

@Dmarcotrigiano
Copy link

Dmarcotrigiano commented Mar 27, 2024

The type in question:

// An object with different embedding types. The length of each embedding type array will be the same as the length of the original `texts` array.
type EmbedByTypeResponseEmbeddings struct {
 // An array of float embeddings.
 Float [][]float64 `json:"float,omitempty" url:"float,omitempty"`
 // An array of signed int8 embeddings. Each value is between -128 and 127.
 Int8 [][]float64 `json:"int8,omitempty" url:"int8,omitempty"`
 // An array of unsigned int8 embeddings. Each value is between 0 and 255.
 Uint8 [][]float64 `json:"uint8,omitempty" url:"uint8,omitempty"`
 // An array of packed signed binary embeddings. The length of each binary embedding is 1/8 the length of the float embeddings of the provided model. Each value is between -128 and 127.
 Binary [][]float64 `json:"binary,omitempty" url:"binary,omitempty"`
 // An array of packed unsigned binary embeddings. The length of each binary embedding is 1/8 the length of the float embeddings of the provided model. Each value is between 0 and 255.
 Ubinary [][]float64 `json:"ubinary,omitempty" url:"ubinary,omitempty"`
 
 _rawJSON json.RawMessage
}
@billytrend-cohere
Copy link
Collaborator

Hey @Dmarcotrigiano thanks for pointing this out. Unfortunately we currently generate the library and aren't able to narrow these types. The values should still be correct if you want to cast them to the correct type. I will investigate improving this situation. Let me know if you have any more issues with usage.

Thanks for checking out the sdk!

@billytrend-cohere
Copy link
Collaborator

Change of plan, we're going to manually patch this and then merge the idea upstream into https://github.com/fern-api/fern

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

No branches or pull requests

2 participants