MCPcopy Create free account
hub / github.com/AsyncFuncAI/deepwiki-open / test_adalflow_embedder

Function test_adalflow_embedder

tests/unit/test_google_embedder.py:76–109  ·  view source on GitHub ↗

Test the AdalFlow embedder with Google client.

()

Source from the content-addressed store, hash-verified

74 return False
75
76def test_adalflow_embedder():
77 """Test the AdalFlow embedder with Google client."""
78 logger.info("Testing AdalFlow embedder with Google client...")
79
80 try:
81 import adalflow as adal
82 from api.google_embedder_client import GoogleEmbedderClient
83
84 # Create embedder
85 client = GoogleEmbedderClient()
86 embedder = adal.Embedder(
87 model_client=client,
88 model_kwargs={
89 "model": "text-embedding-004",
90 "task_type": "SEMANTIC_SIMILARITY"
91 }
92 )
93
94 # Test embedding
95 logger.info("Testing embedder with single input...")
96 result = embedder("Hello world")
97 logger.info(f"Embedder result type: {type(result)}")
98 logger.info(f"Embedder result: {result}")
99
100 if hasattr(result, 'data'):
101 logger.info(f"Result data length: {len(result.data) if result.data else 0}")
102
103 return True
104
105 except Exception as e:
106 logger.error(f"Error testing AdalFlow embedder: {e}")
107 import traceback
108 traceback.print_exc()
109 return False
110
111def test_document_processing():
112 """Test document processing with Google embedder."""

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected