feagi_api/endpoints/
input.rs1use crate::common::ApiState;
8use crate::common::{ApiError, ApiResult, Json, State};
9use std::collections::HashMap;
10
11#[utoipa::path(
13 get,
14 path = "/v1/input/vision",
15 tag = "input",
16 responses(
17 (status = 200, description = "Vision input configuration", body = HashMap<String, serde_json::Value>),
18 (status = 500, description = "Internal server error")
19 )
20)]
21pub async fn get_vision(
22 State(_state): State<ApiState>,
23) -> ApiResult<Json<HashMap<String, serde_json::Value>>> {
24 Ok(Json(HashMap::new()))
26}
27
28#[utoipa::path(
30 post,
31 path = "/v1/input/vision",
32 tag = "input",
33 responses(
34 (status = 200, description = "Vision input updated", content_type = "application/json"),
35 (status = 500, description = "Not yet implemented")
36 )
37)]
38pub async fn post_vision(
39 State(_state): State<ApiState>,
40 Json(_req): Json<HashMap<String, serde_json::Value>>,
41) -> ApiResult<Json<HashMap<String, String>>> {
42 Err(ApiError::internal("Not yet implemented"))
43}
44
45#[utoipa::path(get, path = "/v1/input/sources", tag = "input")]
47pub async fn get_sources(State(_state): State<ApiState>) -> ApiResult<Json<Vec<String>>> {
48 Ok(Json(vec!["vision".to_string()]))
49}
50
51#[utoipa::path(post, path = "/v1/input/configure", tag = "input")]
53pub async fn post_configure(
54 State(_state): State<ApiState>,
55 Json(_req): Json<HashMap<String, serde_json::Value>>,
56) -> ApiResult<Json<HashMap<String, String>>> {
57 Ok(Json(HashMap::from([(
58 "message".to_string(),
59 "Input configured".to_string(),
60 )])))
61}