use std::collections::BTreeMap;
use std::sync::Arc;
use lora_store::GraphStorage;
use crate::eval::EvalContext;
use crate::value::LoraValue;
#[derive(Clone)]
pub(crate) struct StreamCtx<'a, S: GraphStorage> {
pub storage: &'a S,
pub params: Arc<BTreeMap<String, LoraValue>>,
}
impl<'a, S: GraphStorage> StreamCtx<'a, S> {
pub(crate) fn new(storage: &'a S, params: Arc<BTreeMap<String, LoraValue>>) -> Self {
Self { storage, params }
}
pub(crate) fn eval_ctx<'b>(&'b self) -> EvalContext<'b, S> {
EvalContext {
storage: self.storage,
params: &self.params,
}
}
}