Skip to content

api_routes

diapason.server.api_routes

Extended API routes for agents, workflows, memory, traces, etc.

create_agent(req, request) async

Spawn a new agent.

feedback_stats(request) async

Get feedback statistics.

get_budget(request) async

Get current budget usage and limits.

get_optimize_run(run_id, request) async

Get optimization run details.

get_session(session_id, request) async

Get a specific session.

get_trace(trace_id, request) async

Get a specific trace by ID.

include_all_routes(app)

Include all extended API routers in a FastAPI app.

install_skill(request) async

Install a skill (placeholder).

kill_agent(agent_id, request) async

Kill a running agent.

learning_policy(request) async

Return current routing policy configuration.

learning_stats(request) async

Return learning system statistics across all sub-policies.

list_agents(request) async

List available agent types and running agents.

list_optimize_runs(request) async

List optimization runs.

list_sessions(request, limit=20) async

List active sessions.

list_skills(request) async

List installed skills.

list_traces(request, limit=20) async

List recent traces.

memory_config(request) async

Return current memory configuration.

Reports memory as unavailable (rather than falsely claiming backend_type: sqlite) when the native diapason_rust extension is missing, so the UI can show the real cause instead of a healthy-looking config that backs a silent no-op (#502).

memory_index(req, request) async

Index files from a path into memory.

Search memory for relevant content.

memory_stats(request) async

Get memory backend statistics.

memory_store(req, request) async

Store content in memory.

message_agent(agent_id, req, request) async

Send a message to a running agent.

prometheus_metrics(request) async

Prometheus-compatible metrics endpoint.

remove_skill(skill_name, request) async

Remove a skill (placeholder).

set_budget_limits(req, request) async

Update budget limits.

speech_health(request) async

Check if a speech backend is available.

start_optimize_run(req, request) async

Start a new optimization run.

submit_feedback(req, request) async

Submit feedback for a trace.

telemetry_energy(request) async

Get energy monitoring data.

telemetry_stats(request) async

Get aggregated telemetry statistics.

transcribe_speech(request) async

Transcribe uploaded audio to text.

websocket_chat_stream(websocket) async

Stream chat responses over a WebSocket connection.

Accepts JSON messages of the form::

{"message": "...", "model": "...", "agent": "..."}

Sends back JSON chunks::

{"type": "chunk", "content": "..."}   -- per-token streaming
{"type": "done",  "content": "..."}   -- final assembled response
{"type": "error", "detail": "..."}    -- on failure