Skip to content

Commit

Permalink
chore: Removing unnecessary re-throw of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed May 10, 2024
1 parent 58b0f1a commit e63cb15
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions clients/js/src/embeddings/OpenAIEmbeddingFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ class OpenAIAPIv3 implements OpenAIAPI {
user?: string;
}): Promise<number[][]> {
const embeddings: number[][] = [];
const response = await this.openai
.createEmbedding({
model: params.model,
input: params.input,
})
.catch((error: any) => {
throw error;
});
const response = await this.openai.createEmbedding({
model: params.model,
input: params.input,
});
// @ts-ignore
const data = response.data["data"];
for (let i = 0; i < data.length; i += 1) {
Expand Down

0 comments on commit e63cb15

Please sign in to comment.