Skip to content
Snippets Groups Projects
Unverified Commit 6a9a7b14 authored by Parham Saidi's avatar Parham Saidi Committed by GitHub
Browse files

fix: use init api key for openai embeddings (#1324)

parent 1c168cd5
No related branches found
No related tags found
No related merge requests found
---
"@llamaindex/openai": patch
"llamaindex": patch
---
fix: take init api key into account
......@@ -114,7 +114,8 @@ export class OpenAIEmbedding extends BaseEmbedding {
}),
);
} else {
this.apiKey = init?.session?.apiKey ?? getEnv("OPENAI_API_KEY");
this.apiKey =
init?.session?.apiKey ?? init?.apiKey ?? getEnv("OPENAI_API_KEY");
this.lazySession = async () =>
import("openai").then(({ OpenAI }) => {
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment