mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-21 03:46:11 +00:00
chore: update
This commit is contained in:
@@ -30,12 +30,12 @@ class PipelineService:
|
|||||||
def __init__(self, ap: app.Application) -> None:
|
def __init__(self, ap: app.Application) -> None:
|
||||||
self.ap = ap
|
self.ap = ap
|
||||||
|
|
||||||
async def get_pipeline_metadata(self) -> dict:
|
async def get_pipeline_metadata(self) -> list[dict]:
|
||||||
return [
|
return [
|
||||||
self.ap.pipeline_config_meta_trigger.data,
|
self.ap.pipeline_config_meta_trigger,
|
||||||
self.ap.pipeline_config_meta_safety.data,
|
self.ap.pipeline_config_meta_safety,
|
||||||
self.ap.pipeline_config_meta_ai.data,
|
self.ap.pipeline_config_meta_ai,
|
||||||
self.ap.pipeline_config_meta_output.data,
|
self.ap.pipeline_config_meta_output,
|
||||||
]
|
]
|
||||||
|
|
||||||
async def get_pipelines(self, sort_by: str = 'created_at', sort_order: str = 'DESC') -> list[dict]:
|
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)
|
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"""
|
"""Update the bound plugins and MCP servers for a pipeline"""
|
||||||
# Get current pipeline
|
# Get current pipeline
|
||||||
result = await self.ap.persistence_mgr.execute_async(
|
result = await self.ap.persistence_mgr.execute_async(
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
import yaml
|
||||||
|
import importlib.resources as resources
|
||||||
|
|
||||||
from .. import stage, app
|
from .. import stage, app
|
||||||
from ..bootutils import config
|
from ..bootutils import config
|
||||||
@@ -146,17 +148,11 @@ class LoadConfigStage(stage.BootingStage):
|
|||||||
)
|
)
|
||||||
await ap.sensitive_meta.dump_config()
|
await ap.sensitive_meta.dump_config()
|
||||||
|
|
||||||
ap.pipeline_config_meta_trigger = await config.load_yaml_config(
|
async def load_resource_yaml_template_data(resource_name: str) -> dict:
|
||||||
'metadata/pipeline/trigger.yaml',
|
with resources.files('langbot.templates').joinpath(resource_name).open('r', encoding='utf-8') as f:
|
||||||
'metadata/pipeline/trigger.yaml',
|
return yaml.load(f, Loader=yaml.FullLoader)
|
||||||
)
|
|
||||||
ap.pipeline_config_meta_safety = await config.load_yaml_config(
|
ap.pipeline_config_meta_trigger = await load_resource_yaml_template_data('metadata/pipeline/trigger.yaml')
|
||||||
'metadata/pipeline/safety.yaml',
|
ap.pipeline_config_meta_safety = await load_resource_yaml_template_data('metadata/pipeline/safety.yaml')
|
||||||
'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')
|
||||||
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'
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user