From 5a7ead03358921eecb6f7077c310c885c72109bc Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 19 Jul 2025 09:12:34 -0400 Subject: [PATCH 1/2] Fix 404 error: Add root route with Streamlit UI link --- slop_with_models.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/slop_with_models.py b/slop_with_models.py index 2b0e69d..102830d 100644 --- a/slop_with_models.py +++ b/slop_with_models.py @@ -687,6 +687,24 @@ def play_blackjack(bet, agent_id, game_id=None, action=None): LOCK_TIMEOUT = 2 # Seconds to wait for lock acquisition +@app.route("/", methods=["GET"]) +def index(): + logger.info("Received / GET request") + return jsonify({ + "message": "SLOP API Server", + "version": "1.0", + "streamlit_ui": "https://streamlit.slop.unturf.com/", + "endpoints": { + "/memory": "Memory storage endpoints", + "/chat": "Chat completion endpoint", + "/models": "List available models", + "/tools": "Tool execution endpoints", + "/resources": "Resource management", + "/pay": "Payment processing" + } + }) + + @app.route("/memory", methods=["POST"]) def store_memory(): logger.info("Received /memory POST request") From 4be66b73800521daf0fd38a72666133589fec531 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 19 Jul 2025 09:14:56 -0400 Subject: [PATCH 2/2] Add HTML homepage with links to Streamlit UI and OpenAPI docs --- slop_with_models.py | 103 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 89 insertions(+), 14 deletions(-) diff --git a/slop_with_models.py b/slop_with_models.py index 102830d..da8cbec 100644 --- a/slop_with_models.py +++ b/slop_with_models.py @@ -1,4 +1,4 @@ -from flask import Flask, request, jsonify +from flask import Flask, request, jsonify, render_template_string from datetime import datetime import os import json @@ -690,19 +690,94 @@ LOCK_TIMEOUT = 2 # Seconds to wait for lock acquisition @app.route("/", methods=["GET"]) def index(): logger.info("Received / GET request") - return jsonify({ - "message": "SLOP API Server", - "version": "1.0", - "streamlit_ui": "https://streamlit.slop.unturf.com/", - "endpoints": { - "/memory": "Memory storage endpoints", - "/chat": "Chat completion endpoint", - "/models": "List available models", - "/tools": "Tool execution endpoints", - "/resources": "Resource management", - "/pay": "Payment processing" - } - }) + html_template = """ + + + + SLOP API Server + + + +

SLOP API Server

+

Welcome to the SLOP API Server v1.0

+ + + +
+

API Endpoints:

+
    +
  • /memory - Memory storage endpoints
  • +
  • /chat - Chat completion endpoint
  • +
  • /models - List available models
  • +
  • /tools - Tool execution endpoints
  • +
  • /resources - Resource management
  • +
  • /pay - Payment processing
  • +
+
+ + + """ + return render_template_string(html_template) @app.route("/memory", methods=["POST"])