chore: update

This commit is contained in:
Junyan Qin
2025-11-07 23:19:51 +08:00
parent 92614062cc
commit c5aa5be4d8
2 changed files with 24 additions and 26 deletions
+8 -6
View File
@@ -30,12 +30,12 @@ class PipelineService:
def __init__(self, ap: app.Application) -> None:
self.ap = ap
async def get_pipeline_metadata(self) -> dict:
async def get_pipeline_metadata(self) -> list[dict]:
return [
self.ap.pipeline_config_meta_trigger.data,
self.ap.pipeline_config_meta_safety.data,
self.ap.pipeline_config_meta_ai.data,
self.ap.pipeline_config_meta_output.data,
self.ap.pipeline_config_meta_trigger,
self.ap.pipeline_config_meta_safety,
self.ap.pipeline_config_meta_ai,
self.ap.pipeline_config_meta_output,
]
async def get_pipelines(self, sort_by: str = 'created_at', sort_order: str = 'DESC') -> list[dict]:
@@ -142,7 +142,9 @@ class PipelineService:
)
await self.ap.pipeline_mgr.remove_pipeline(pipeline_uuid)
async def update_pipeline_extensions(self, pipeline_uuid: str, bound_plugins: list[dict], bound_mcp_servers: list[str] = None) -> None:
async def update_pipeline_extensions(
self, pipeline_uuid: str, bound_plugins: list[dict], bound_mcp_servers: list[str] = None
) -> None:
"""Update the bound plugins and MCP servers for a pipeline"""
# Get current pipeline
result = await self.ap.persistence_mgr.execute_async(
+10 -14
View File
@@ -2,6 +2,8 @@ from __future__ import annotations
import os
from typing import Any
import yaml
import importlib.resources as resources
from .. import stage, app
from ..bootutils import config
@@ -146,17 +148,11 @@ class LoadConfigStage(stage.BootingStage):
)
await ap.sensitive_meta.dump_config()
ap.pipeline_config_meta_trigger = await config.load_yaml_config(
'metadata/pipeline/trigger.yaml',
'metadata/pipeline/trigger.yaml',
)
ap.pipeline_config_meta_safety = await config.load_yaml_config(
'metadata/pipeline/safety.yaml',
'metadata/pipeline/safety.yaml',
)
ap.pipeline_config_meta_ai = await config.load_yaml_config(
'metadata/pipeline/ai.yaml', 'metadata/pipeline/ai.yaml'
)
ap.pipeline_config_meta_output = await config.load_yaml_config(
'metadata/pipeline/output.yaml', 'metadata/pipeline/output.yaml'
)
async def load_resource_yaml_template_data(resource_name: str) -> dict:
with resources.files('langbot.templates').joinpath(resource_name).open('r', encoding='utf-8') as f:
return yaml.load(f, Loader=yaml.FullLoader)
ap.pipeline_config_meta_trigger = await load_resource_yaml_template_data('metadata/pipeline/trigger.yaml')
ap.pipeline_config_meta_safety = await load_resource_yaml_template_data('metadata/pipeline/safety.yaml')
ap.pipeline_config_meta_ai = await load_resource_yaml_template_data('metadata/pipeline/ai.yaml')
ap.pipeline_config_meta_output = await load_resource_yaml_template_data('metadata/pipeline/output.yaml')