mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
@@ -108,6 +108,7 @@ class EmbeddingConfigurator:
|
|||||||
from chromadb.utils.embedding_functions.google_embedding_function import (
|
from chromadb.utils.embedding_functions.google_embedding_function import (
|
||||||
GoogleVertexEmbeddingFunction,
|
GoogleVertexEmbeddingFunction,
|
||||||
)
|
)
|
||||||
|
|
||||||
from crewai.utilities.embedding_functions import FixedGoogleVertexEmbeddingFunction
|
from crewai.utilities.embedding_functions import FixedGoogleVertexEmbeddingFunction
|
||||||
|
|
||||||
return FixedGoogleVertexEmbeddingFunction(
|
return FixedGoogleVertexEmbeddingFunction(
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
from typing import List, Any
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
|
import requests
|
||||||
from chromadb import Documents, Embeddings
|
from chromadb import Documents, Embeddings
|
||||||
from chromadb.utils.embedding_functions.google_embedding_function import (
|
from chromadb.utils.embedding_functions.google_embedding_function import (
|
||||||
GoogleVertexEmbeddingFunction,
|
GoogleVertexEmbeddingFunction,
|
||||||
)
|
)
|
||||||
import requests
|
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
|
||||||
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
|
||||||
|
|
||||||
|
|
||||||
class FixedGoogleVertexEmbeddingFunction(GoogleVertexEmbeddingFunction):
|
class FixedGoogleVertexEmbeddingFunction(GoogleVertexEmbeddingFunction):
|
||||||
@@ -17,7 +18,7 @@ class FixedGoogleVertexEmbeddingFunction(GoogleVertexEmbeddingFunction):
|
|||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
model_name: str = "textembedding-gecko",
|
model_name: str = "textembedding-gecko",
|
||||||
api_key: str = None,
|
api_key: Optional[str] = None,
|
||||||
**kwargs: Any):
|
**kwargs: Any):
|
||||||
super().__init__(model_name=model_name, api_key=api_key, **kwargs)
|
super().__init__(model_name=model_name, api_key=api_key, **kwargs)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from crewai.utilities.embedding_configurator import EmbeddingConfigurator
|
from crewai.utilities.embedding_configurator import EmbeddingConfigurator
|
||||||
from crewai.utilities.embedding_functions import FixedGoogleVertexEmbeddingFunction
|
from crewai.utilities.embedding_functions import FixedGoogleVertexEmbeddingFunction
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import requests
|
import requests
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from crewai.utilities.embedding_functions import FixedGoogleVertexEmbeddingFunction
|
from crewai.utilities.embedding_functions import FixedGoogleVertexEmbeddingFunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user