Skip to content

Commit

Permalink
Add api key as field in Gemini Embedding (run-llama#14061)
Browse files Browse the repository at this point in the history
feat(gemini-embedding): add api key as field
  • Loading branch information
fersilva16 authored Jun 11, 2024
1 parent a80fb09 commit 60129df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class GeminiEmbedding(BaseEmbedding):
default="retrieval_document",
description="The task for embedding model.",
)
api_key: Optional[str] = Field(
default=None,
description="API key to access the model. Defaults to None.",
)

def __init__(
self,
Expand Down Expand Up @@ -60,6 +64,7 @@ def __init__(
self._model = gemini

super().__init__(
api_key=api_key,
model_name=model_name,
embed_batch_size=embed_batch_size,
callback_manager=callback_manager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-embeddings-gemini"
readme = "README.md"
version = "0.1.7"
version = "0.1.8"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
Expand Down

0 comments on commit 60129df

Please sign in to comment.