Skip to content

Commit

Permalink
chore: Removing unnecessary re-throw of exception - this time in the …
Browse files Browse the repository at this point in the history
…correct place :)
  • Loading branch information
tazarov committed May 10, 2024
1 parent e63cb15 commit 3c81a6e
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 @@ -88,14 +88,10 @@ export class OpenAIEmbeddingFunction implements IEmbeddingFunction {
public async generate(texts: string[]): Promise<number[][]> {
const openaiApi = await this.getOpenAIClient();

return await openaiApi
.createEmbedding({
model: this.model,
input: texts,
})
.catch((error: any) => {
throw error;
});
return await openaiApi.createEmbedding({
model: this.model,
input: texts,
});
}
private async getOpenAIClient(): Promise<OpenAIAPI> {
if (this.openaiApi) return this.openaiApi;
Expand Down

0 comments on commit 3c81a6e

Please sign in to comment.