Skip to main content

feagi_api/endpoints/
insight.rs

1// Copyright 2025 Neuraville Inc.
2// Licensed under the Apache License, Version 2.0
3
4//! Insight API Endpoints - Exact port from Python `/v1/insight/*`
5
6// Removed - using crate::common::State instead
7use crate::common::ApiState;
8use crate::common::{ApiError, ApiResult, Json, State};
9use std::collections::HashMap;
10
11/// Get membrane potential status for multiple neurons.
12#[utoipa::path(
13    post,
14    path = "/v1/insight/neurons/membrane_potential_status",
15    tag = "insight"
16)]
17pub async fn post_neurons_membrane_potential_status(
18    State(_state): State<ApiState>,
19    Json(_req): Json<HashMap<String, serde_json::Value>>,
20) -> ApiResult<Json<HashMap<String, f32>>> {
21    Err(ApiError::internal("Not yet implemented"))
22}
23
24/// Get synaptic potential status for a specific neuron.
25#[utoipa::path(
26    post,
27    path = "/v1/insight/neuron/synaptic_potential_status",
28    tag = "insight"
29)]
30pub async fn post_neuron_synaptic_potential_status(
31    State(_state): State<ApiState>,
32    Json(_req): Json<HashMap<String, serde_json::Value>>,
33) -> ApiResult<Json<serde_json::Value>> {
34    Err(ApiError::internal("Not yet implemented"))
35}
36
37/// Set membrane potential for multiple neurons.
38#[utoipa::path(
39    post,
40    path = "/v1/insight/neurons/membrane_potential_set",
41    tag = "insight"
42)]
43pub async fn post_neurons_membrane_potential_set(
44    State(_state): State<ApiState>,
45    Json(_req): Json<HashMap<String, serde_json::Value>>,
46) -> ApiResult<Json<HashMap<String, String>>> {
47    Err(ApiError::internal("Not yet implemented"))
48}
49
50/// Set synaptic potential for a specific neuron.
51#[utoipa::path(
52    post,
53    path = "/v1/insight/neuron/synaptic_potential_set",
54    tag = "insight"
55)]
56pub async fn post_neuron_synaptic_potential_set(
57    State(_state): State<ApiState>,
58    Json(_req): Json<HashMap<String, serde_json::Value>>,
59) -> ApiResult<Json<HashMap<String, String>>> {
60    Err(ApiError::internal("Not yet implemented"))
61}
62
63/// Get analytics data for neural activity and performance insights.
64#[utoipa::path(get, path = "/v1/insight/analytics", tag = "insight")]
65pub async fn get_analytics(
66    State(_state): State<ApiState>,
67) -> ApiResult<Json<HashMap<String, serde_json::Value>>> {
68    Ok(Json(HashMap::new()))
69}
70
71/// Get detailed insight data for debugging and analysis.
72#[utoipa::path(get, path = "/v1/insight/data", tag = "insight")]
73pub async fn get_data(
74    State(_state): State<ApiState>,
75) -> ApiResult<Json<HashMap<String, serde_json::Value>>> {
76    Ok(Json(HashMap::new()))
77}