Update src/agent/mod.rs
Browse files- src/agent/mod.rs +16 -0
src/agent/mod.rs
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use axum::{extract::State, Json};
|
| 2 |
+
use serde_json::json;
|
| 3 |
+
use std::sync::Arc;
|
| 4 |
+
use crate::AppState;
|
| 5 |
+
|
| 6 |
+
pub async fn chat_handler(
|
| 7 |
+
State(state): State<Arc<AppState>>,
|
| 8 |
+
Json(payload): Json<serde_json::Value>
|
| 9 |
+
) -> Json<serde_json::Value> {
|
| 10 |
+
let _ = state.tx.send(json!({"type": "log", "data": "Thinking..."}).to_string());
|
| 11 |
+
|
| 12 |
+
// Gemini API Call Logic here using reqwest
|
| 13 |
+
// Use model ID: gemini-2.0-flash-exp (current flash preview ID)
|
| 14 |
+
|
| 15 |
+
Json(json!({"status": "ok"}))
|
| 16 |
+
}
|