microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
350 stars 144 forks source link

[Bug]: EmbeddingsResponse class output property should be List[List[float]] instead of List[List[int]] #1646

Closed yikwen closed 1 month ago

yikwen commented 1 month ago

Language

Python

Version

latest

Description

The EmbeddingsResponse class declared in teams.ai.embeddings has a type of Optional[Union[List[List[int]], str]]. Given that embeddings are floating point numbers, the type should be probably be Optional[Union[List[List[float]], str]]

Reproduction Steps

1.None
yikwen commented 1 month ago

For comparison, the equivalent Javascript interface definition uses number[][]

export interface EmbeddingsResponse {
...
    /**
     * Optional. Embeddings for the given inputs.
     */
    output?: number[][];
...
}
lilyydu commented 1 month ago

Hi @yikwen, great catch. Updating to float will also match the dotnet implementation. Please feel free to open up a PR to update this, otherwise I will get to it sometime this week!

yikwen commented 1 month ago

@lilyydu I've created pull request #1677 . Since this is my first time (ever) contributing to an open-source project, I hope I'm doing it right.