workspace working

This commit is contained in:
2026-01-12 22:31:11 +08:00
parent 2738a822d1
commit 370fe6368a
149 changed files with 4648 additions and 660 deletions

32
test_ollama_client.py Normal file
View File

@@ -0,0 +1,32 @@
import asyncio
import ollama
import sys
async def test():
# mimic the exact call from ollama_embed
api_key = ""
headers = {
"Content-Type": "application/json",
"User-Agent": f"LightRAG/0.1.0"
}
if api_key:
headers["Authorization"] = f"Bearer {api_key}"
host = None # default localhost:11434
timeout = None
ollama_client = ollama.AsyncClient(host=host, timeout=timeout, headers=headers)
try:
options = {}
data = await ollama_client.embed(
model="snowflake-arctic-embed:latest",
input=["test"],
options=options
)
print("Success:", data.keys())
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
finally:
await ollama_client._client.aclose()
asyncio.run(test())