File size: 1,107 Bytes
d5a2283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c1ec11
d5a2283
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from helpers.api import ApiHandler, Request, Response

class ApiDocs(ApiHandler):
    @classmethod
    def requires_auth(cls) -> bool:
        return False

    @classmethod
    def requires_csrf(cls) -> bool:
        return False

    @classmethod
    def get_methods(cls) -> list[str]:
        return ["GET"]

    async def process(self, input: dict, request: Request) -> dict | Response:
        return {
            "title": "Agent Zero API Docs",
            "endpoints": [
                {
                    "path": "/api/message",
                    "method": "POST",
                    "purpose": "Send a message to the agent",
                    "request_example": {"text": "hello", "context": "optional_context_id"},
                    "response_example": {"message": "...", "context": "..."}
                },
                {
                    "path": "/api/health",
                    "method": "GET",
                    "purpose": "Health check for the application",
                    "response_example": {"gitinfo": {}, "error": None}
                }
            ]
        }