feat: add is_finalized to MetaPluginResponse and remove direct db interaction from meta plugins
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -25,6 +25,7 @@ pub struct MetaData {
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
pub struct MetaPluginResponse {
|
||||
pub metadata: Vec<MetaData>,
|
||||
pub is_finalized: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, strum::EnumIter, strum::Display, strum::EnumString)]
|
||||
@@ -93,12 +94,18 @@ pub trait MetaPlugin {
|
||||
// Update the meta plugin with new data
|
||||
fn update(&mut self, data: &[u8]) -> MetaPluginResponse {
|
||||
// Default implementation does nothing
|
||||
MetaPluginResponse::default()
|
||||
MetaPluginResponse {
|
||||
metadata: Vec::new(),
|
||||
is_finalized: false,
|
||||
}
|
||||
}
|
||||
|
||||
fn finalize(&mut self) -> MetaPluginResponse {
|
||||
// Default implementation does nothing
|
||||
MetaPluginResponse::default()
|
||||
MetaPluginResponse {
|
||||
metadata: Vec::new(),
|
||||
is_finalized: true,
|
||||
}
|
||||
}
|
||||
|
||||
fn meta_name(&self) -> String;
|
||||
@@ -111,7 +118,10 @@ pub trait MetaPlugin {
|
||||
// Initialize the plugin
|
||||
fn initialize(&mut self) -> MetaPluginResponse {
|
||||
// Default implementation does nothing
|
||||
MetaPluginResponse::default()
|
||||
MetaPluginResponse {
|
||||
metadata: Vec::new(),
|
||||
is_finalized: false,
|
||||
}
|
||||
}
|
||||
|
||||
// Access to outputs mapping
|
||||
|
||||
Reference in New Issue
Block a user