{ "openapi": "3.1.0", "info": { "title": "discord-mod", "description": "Automatically generated API for DSPy programs", "version": "0.1.0", "x-dspy-config": { "default_model": null, "programs_count": 1 }, "x-dspy-programs": [ { "name": "ClassifyJobPosting", "module_path": "discord_mod.modules.classify_job_posting", "is_forward_typed": true } ], "x-dspy-program-models": { "ClassifyJobPosting": "openai:gpt-4o-mini" } }, "paths": { "/ClassifyJobPosting": { "post": { "summary": "Run Program", "description": "Execute the DSPy program with given inputs.", "operationId": "run_program_ClassifyJobPosting_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClassifyJobPostingRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Run Program Classifyjobposting Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/programs": { "get": { "summary": "List Programs", "description": "List all discovered programs and their schemas.", "operationId": "list_programs_programs_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/metrics": { "get": { "summary": "List Metrics", "description": "Get aggregated metrics for all programs.\n\nArgs:\n sort_by: Sort key (name, calls, latency, cost, tokens, last_call)\n order: Sort order (asc, desc)", "operationId": "list_metrics_api_metrics_get", "parameters": [ { "name": "sort_by", "in": "query", "required": false, "schema": { "type": "string", "default": "calls", "title": "Sort By" } }, { "name": "order", "in": "query", "required": false, "schema": { "type": "string", "default": "desc", "title": "Order" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/metrics/{program_name}": { "get": { "summary": "Program Metrics", "description": "Get detailed metrics for a specific program.", "operationId": "program_metrics_api_metrics__program_name__get", "parameters": [ { "name": "program_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Program Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/": { "get": { "summary": "Index", "description": "Render the index page with a list of all programs.", "operationId": "index__get", "responses": { "200": { "description": "Successful Response", "content": { "text/html": { "schema": { "type": "string" } } } } } } }, "/ui/{program_name}": { "get": { "summary": "Program Page", "description": "Render the program detail page.", "operationId": "program_page_ui__program_name__get", "parameters": [ { "name": "program_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Program Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "text/html": { "schema": { "type": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/logs/{program_name}": { "get": { "summary": "Get Logs", "description": "Get recent logs for a program.", "operationId": "get_logs_api_logs__program_name__get", "parameters": [ { "name": "program_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Program Name" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/login": { "get": { "summary": "Login Form", "description": "Render the login form.", "operationId": "login_form_login_get", "parameters": [ { "name": "error", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } } ], "responses": { "200": { "description": "Successful Response", "content": { "text/html": { "schema": { "type": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "summary": "Login", "description": "Process login form submission.", "operationId": "login_login_post", "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Body_login_login_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/logout": { "post": { "summary": "Logout", "description": "Log out by clearing the session cookie.", "operationId": "logout_logout_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/health": { "get": { "summary": "Health", "description": "Health check endpoint (always open).", "operationId": "health_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } }, "components": { "schemas": { "Body_login_login_post": { "properties": { "token_input": { "type": "string", "title": "Token Input" } }, "type": "object", "required": [ "token_input" ], "title": "Body_login_login_post" }, "ClassifyJobPostingRequest": { "properties": { "message": { "type": "string", "title": "Message" }, "author": { "type": "string", "title": "Author" }, "channel_name": { "type": "string", "title": "Channel Name" } }, "type": "object", "required": [ "message", "author", "channel_name" ], "title": "ClassifyJobPostingRequest" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } } } }