Test Ollama API
This commit is contained in:
12
main.py
12
main.py
@@ -73,8 +73,18 @@ def test_database():
|
|||||||
break
|
break
|
||||||
print(f" All records equal: {records_equal}")
|
print(f" All records equal: {records_equal}")
|
||||||
|
|
||||||
|
# Test embedding functionality
|
||||||
|
print("\n5. Testing embedding functionality (Ollama API server)...")
|
||||||
|
try:
|
||||||
|
test_embedding = db._embed("This is a test text for embedding.")
|
||||||
|
print(f" Embedding test PASSED: Generated vector of shape {test_embedding.shape}")
|
||||||
|
ollama_running = True
|
||||||
|
except Exception as e:
|
||||||
|
print(f" Embedding test FAILED: {e}\n Did you start ollama docker image?")
|
||||||
|
ollama_running = False
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
all_good = vectors_match and records_match and vectors_equal and records_equal
|
all_good = vectors_match and records_match and vectors_equal and records_equal and ollama_running
|
||||||
print(f"\n✅ Test {'PASSED' if all_good else 'FAILED'}: All data preserved through save/load cycle")
|
print(f"\n✅ Test {'PASSED' if all_good else 'FAILED'}: All data preserved through save/load cycle")
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user