xinli/Archive/测试向量化服务.bat
2026-01-30 16:23:31 +08:00

53 lines
1.4 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
echo ========================================
echo 测试向量化服务
echo ========================================
echo.
echo [测试1] 检查Ollama服务...
curl -s http://localhost:11434/api/tags >nul 2>&1
if %errorlevel% equ 0 (
echo ✓ Ollama服务正常
echo.
echo 测试向量化(这可能需要几秒钟)...
echo.
curl -X POST http://localhost:11434/api/embeddings ^
-H "Content-Type: application/json" ^
-d "{\"model\":\"nomic-embed-text\",\"prompt\":\"测试文本\"}" ^
--max-time 10
echo.
if %errorlevel% equ 0 (
echo ✓ 向量化测试成功
) else (
echo ✗ 向量化测试失败(可能是模型未下载或超时)
echo.
echo 请运行: ollama pull nomic-embed-text
)
) else (
echo ✗ Ollama服务未运行
echo 请先安装并启动Ollama
)
echo.
echo ========================================
echo.
echo [测试2] 检查OpenAI API如果配置了...
echo 跳过需要API Key
echo.
echo ========================================
echo.
echo [测试3] 检查ChromaDB...
curl -s http://localhost:8000/api/v1/heartbeat >nul 2>&1
if %errorlevel% equ 0 (
echo ✓ ChromaDB服务正常
) else (
echo ✗ ChromaDB服务未运行
echo 系统将使用SimpleVectorStore内存存储
)
echo.
echo ========================================
echo.
pause