"""Query the 768-dim collection with query_texts: Chroma falls back to its default embedding function."""
import chromadb
from common import HOST, PORT, COLLECTION

client = chromadb.HttpClient(host=HOST, port=PORT)
col = client.get_collection(COLLECTION)
print("collection embedding function:", col.configuration.get("embedding_function"))
try:
    res = col.query(query_texts=["How do I limit how many pages a crawl fetches?"], n_results=3)
    print("worked:", res["ids"])
except Exception as e:
    print(f"{type(e).__name__}: {e}")
