File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/google/adk/tools/retrieval
tests/unittests/tools/retrieval Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,18 @@ def _get_default_embedding_model() -> BaseEmbedding:
3232 """Get the default Google Gemini embedding model.
3333
3434 Returns:
35- GoogleGenAIEmbedding instance configured with text -embedding-004 model.
35+ GoogleGenAIEmbedding instance configured with gemini -embedding-2-preview model.
3636
3737 Raises:
3838 ImportError: If llama-index-embeddings-google-genai package is not installed.
3939 """
4040 try :
4141 from llama_index .embeddings .google_genai import GoogleGenAIEmbedding
4242
43- return GoogleGenAIEmbedding (model_name = "text-embedding-004" )
43+ return GoogleGenAIEmbedding (
44+ model_name = "gemini-embedding-2-preview" ,
45+ embed_batch_size = 1 ,
46+ )
4447 except ImportError as e :
4548 raise ImportError (
4649 "llama-index-embeddings-google-genai package not found. "
@@ -65,7 +68,7 @@ def __init__(
6568 description: Description of the tool.
6669 input_dir: Directory path containing files to index.
6770 embedding_model: Optional custom embedding model. If None, defaults to
68- Google's text -embedding-004 model.
71+ Google's gemini -embedding-2-preview model.
6972 """
7073 self .input_dir = input_dir
7174
Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ def test_get_default_embedding_model_success(self):
122122 result = _get_default_embedding_model ()
123123
124124 mock_module .GoogleGenAIEmbedding .assert_called_once_with (
125- model_name = "text-embedding-004"
125+ model_name = "gemini-embedding-2-preview" ,
126+ embed_batch_size = 1 ,
126127 )
127128 assert result == mock_embedding_instance
128129
You can’t perform that action at this time.
0 commit comments