add email test code

This commit is contained in:
yichuan520030910320
2025-07-09 15:01:16 -07:00
parent b744faa7e6
commit 04c9684488
9 changed files with 1071 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from llama_index.core import VectorStoreIndex, Document
from llama_index.core.embeddings import resolve_embed_model
# Check the default embedding model
embed_model = resolve_embed_model("default")
print(f"Default embedding model: {embed_model}")
# Create a simple test document
doc = Document(text="This is a test document")
# Get embedding dimension
try:
# Test embedding
test_embedding = embed_model.get_text_embedding("test")
print(f"Embedding dimension: {len(test_embedding)}")
print(f"Embedding type: {type(test_embedding)}")
except Exception as e:
print(f"Error getting embedding: {e}")
# Alternative way to check dimension
if hasattr(embed_model, 'embed_dim'):
print(f"Model embed_dim attribute: {embed_model.embed_dim}")
elif hasattr(embed_model, 'dimension'):
print(f"Model dimension attribute: {embed_model.dimension}")