mirror of
https://github.com/katanemo/plano.git
synced 2026-05-11 08:42:48 +02:00
refactor brightstaff (#736)
This commit is contained in:
parent
1f23c573bf
commit
1ad3e0f64e
30 changed files with 1802 additions and 1700 deletions
|
|
@ -88,35 +88,18 @@ pub trait StateStorage: Send + Sync {
|
|||
combined_input.extend(current_input);
|
||||
|
||||
debug!(
|
||||
"PLANO | BRIGHTSTAFF | STATE_STORAGE | RESP_ID:{} | Merged state: prev_items={}, current_items={}, total_items={}, combined_json={}",
|
||||
prev_state.response_id,
|
||||
prev_count,
|
||||
current_count,
|
||||
combined_input.len(),
|
||||
serde_json::to_string(&combined_input).unwrap_or_else(|_| "serialization_error".to_string())
|
||||
response_id = %prev_state.response_id,
|
||||
prev_items = prev_count,
|
||||
current_items = current_count,
|
||||
total_items = combined_input.len(),
|
||||
combined_json = %serde_json::to_string(&combined_input).unwrap_or_else(|_| "serialization_error".to_string()),
|
||||
"merged conversation state"
|
||||
);
|
||||
|
||||
combined_input
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage backend type enum
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum StorageBackend {
|
||||
Memory,
|
||||
Supabase,
|
||||
}
|
||||
|
||||
impl StorageBackend {
|
||||
pub fn parse_backend(s: &str) -> Option<Self> {
|
||||
match s.to_lowercase().as_str() {
|
||||
"memory" => Some(StorageBackend::Memory),
|
||||
"supabase" => Some(StorageBackend::Supabase),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// === Utility functions for state management ===
|
||||
|
||||
/// Extract input items from InputParam, converting text to structured format
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ use std::io::Read;
|
|||
use std::sync::Arc;
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
use crate::handlers::streaming::StreamProcessor;
|
||||
use crate::state::{OpenAIConversationState, StateStorage};
|
||||
use crate::streaming::StreamProcessor;
|
||||
|
||||
/// Processor that wraps another processor and handles v1/responses state management
|
||||
/// Captures response_id and output from streaming responses, stores state after completion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue