mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-03 12:34:37 +00:00
feat(pipeline): use default config in create
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
import json
|
||||
import datetime
|
||||
import sqlalchemy
|
||||
|
||||
@@ -66,8 +67,7 @@ class PipelineService:
|
||||
pipeline_data['for_version'] = self.ap.ver_mgr.get_current_version()
|
||||
pipeline_data['stages'] = default_stage_order.copy()
|
||||
pipeline_data['is_default'] = default
|
||||
|
||||
# TODO: 检查pipeline config是否完整
|
||||
pipeline_data['config'] = json.load(open('templates/default-pipeline-config.json', 'r', encoding='utf-8'))
|
||||
|
||||
await self.ap.persistence_mgr.execute_async(
|
||||
sqlalchemy.insert(persistence_pipeline.LegacyPipeline).values(**pipeline_data)
|
||||
|
||||
@@ -72,7 +72,7 @@ class PersistenceManager:
|
||||
if result.first() is None:
|
||||
self.ap.logger.info("Creating default pipeline...")
|
||||
|
||||
pipeline_config = json.load(open('templates/default-pipeline-config.json'))
|
||||
pipeline_config = json.load(open('templates/default-pipeline-config.json', 'r', encoding='utf-8'))
|
||||
|
||||
pipeline_data = {
|
||||
'uuid': str(uuid.uuid4()),
|
||||
|
||||
Reference in New Issue
Block a user