Add admin panel, WebSocket support, and API versioning
Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import asyncio
|
||||
import os
|
||||
import logging
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from hub_plugin import ShaarliHubPlugin
|
||||
|
||||
# Configure basic logging
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
|
||||
async def main():
|
||||
# Load environment variables
|
||||
load_dotenv("config_example.env")
|
||||
|
||||
api_url = os.getenv("IMAGO_API_URL", "http://localhost:8000/api/v1")
|
||||
api_key = os.getenv("IMAGO_API_KEY", "your-api-key-here")
|
||||
|
||||
plugin = ShaarliHubPlugin(api_url=api_url, api_key=api_key)
|
||||
|
||||
print("--- Testing Imago AI Bookmark Summarization ---")
|
||||
bookmark_url = "https://github.com/imago-project/imago"
|
||||
|
||||
result = await plugin.process_bookmark(
|
||||
url=bookmark_url,
|
||||
title="Imago Source Code",
|
||||
description="Check out this cool new project!"
|
||||
)
|
||||
|
||||
print("Result:")
|
||||
print(result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user