chore: remove broken googleSearch grounding and /v1/search endpoint

This commit is contained in:
Nikketryhard
2026-02-15 17:08:46 -06:00
parent cc5f48967a
commit afa96b88a5
5 changed files with 80 additions and 0 deletions

View File

@@ -73,6 +73,18 @@ pub struct GenerationParams {
pub frequency_penalty: Option<f64>,
/// Presence penalty (OpenAI) — mapped to presencePenalty in Gemini.
pub presence_penalty: Option<f64>,
/// Reasoning effort — mapped to thinkingConfig.thinkingLevel in Gemini 3.
/// Values: "low", "medium", "high" (maps 1:1 to Google's thinkingLevel).
pub reasoning_effort: Option<String>,
/// Response MIME type — injected as generationConfig.responseMimeType.
/// e.g., "application/json" for JSON mode.
pub response_mime_type: Option<String>,
/// Response schema — injected as generationConfig.responseSchema.
/// Used for structured output (json_schema format).
pub response_schema: Option<serde_json::Value>,
/// Enable Google Search grounding — injects {"googleSearch": {}} into tools.
/// Default off. When enabled, model responses include groundingMetadata.
pub google_search: bool,
}
/// Thread-safe store for intercepted data.
@@ -121,6 +133,10 @@ pub struct MitmStore {
// ── Generation parameters for MITM injection ─────────────────────────
/// Client-specified sampling parameters to inject into Google API requests.
generation_params: Arc<RwLock<Option<GenerationParams>>>,
// ── Grounding metadata capture ──────────────────────────────────────
/// Captured grounding metadata from Google API responses (search results).
captured_grounding: Arc<RwLock<Option<serde_json::Value>>>,
}
/// Aggregate statistics across all intercepted traffic.
@@ -164,6 +180,7 @@ impl MitmStore {
captured_thinking_text: Arc::new(RwLock::new(None)),
response_complete: Arc::new(AtomicBool::new(false)),
generation_params: Arc::new(RwLock::new(None)),
captured_grounding: Arc::new(RwLock::new(None)),
}
}
@@ -470,4 +487,23 @@ impl MitmStore {
pub async fn clear_generation_params(&self) {
*self.generation_params.write().await = None;
}
// ── Grounding metadata capture ──────────────────────────────────────
/// Store captured grounding metadata from API response.
pub async fn set_grounding(&self, meta: serde_json::Value) {
*self.captured_grounding.write().await = Some(meta);
}
/// Take (consume) captured grounding metadata.
#[allow(dead_code)]
pub async fn take_grounding(&self) -> Option<serde_json::Value> {
self.captured_grounding.write().await.take()
}
/// Peek at grounding metadata without consuming.
#[allow(dead_code)]
pub async fn peek_grounding(&self) -> Option<serde_json::Value> {
self.captured_grounding.read().await.clone()
}
}