modified to combine openwebui and ollama
This commit is contained in:
@@ -12,7 +12,7 @@ touch ai_service/data/document_metadata.json
|
||||
touch ai_service/data/chats.json
|
||||
|
||||
# Start the AI service
|
||||
echo "Starting AI Service on port 5251..."
|
||||
echo "Starting AI Service on port 5252..."
|
||||
VENV_PATH="./venv"
|
||||
PYTHON_PATH="$VENV_PATH/bin/python"
|
||||
|
||||
@@ -30,13 +30,13 @@ sleep 2
|
||||
|
||||
# Check if the service is running
|
||||
if pgrep -f "run_ai_service.py" > /dev/null; then
|
||||
echo "AI Service started successfully on port 5251"
|
||||
echo "AI Service started successfully on port 5252"
|
||||
echo "Check ai_service.log for output"
|
||||
echo "To stop the service, run: pkill -f \"run_ai_service.py\""
|
||||
|
||||
# Test the health endpoint
|
||||
echo -e "\nTesting health endpoint..."
|
||||
curl -s http://localhost:5251/health
|
||||
curl -s http://localhost:5252/health
|
||||
echo -e "\n"
|
||||
|
||||
# Test creating a chat and sending a message
|
||||
@@ -49,7 +49,7 @@ import json
|
||||
|
||||
# Create a chat
|
||||
response = requests.post(
|
||||
"http://localhost:5251/chats",
|
||||
"http://localhost:5252/chats",
|
||||
json={
|
||||
"user_id": "test_user",
|
||||
"title": "Test Chat",
|
||||
@@ -63,7 +63,7 @@ if response.status_code == 200:
|
||||
|
||||
# Send a message with parameters
|
||||
response = requests.post(
|
||||
f"http://localhost:5251/chats/{chat_id}/messages",
|
||||
f"http://localhost:5252/chats/{chat_id}/messages",
|
||||
json={
|
||||
"message": "Hello, AI!",
|
||||
"user_id": "test_user",
|
||||
|
||||
Reference in New Issue
Block a user