feat: 集成Hermes智能体系统,增强聊天和差旅报销功能
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
@@ -8,6 +9,8 @@ from typing import Any
|
||||
|
||||
import yaml
|
||||
|
||||
from app.core.config import ROOT_DIR
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class HermesModelRoute:
|
||||
@@ -35,6 +38,26 @@ def get_hermes_config_path() -> Path:
|
||||
return get_hermes_home() / "config.yaml"
|
||||
|
||||
|
||||
def sync_repository_hermes_skills(
|
||||
*,
|
||||
source_root: Path | None = None,
|
||||
target_root: Path | None = None,
|
||||
) -> Path:
|
||||
source = source_root or ROOT_DIR / "hermes" / "skills"
|
||||
target = target_root or get_hermes_home() / "skills"
|
||||
if not source.exists():
|
||||
return target
|
||||
|
||||
target.mkdir(parents=True, exist_ok=True)
|
||||
for item in source.iterdir():
|
||||
destination = target / item.name
|
||||
if item.is_dir():
|
||||
shutil.copytree(item, destination, dirs_exist_ok=True)
|
||||
elif item.is_file():
|
||||
shutil.copy2(item, destination)
|
||||
return target
|
||||
|
||||
|
||||
def capture_hermes_config_snapshot(config_path: Path | None = None) -> HermesConfigSnapshot:
|
||||
target_path = config_path or get_hermes_config_path()
|
||||
if not target_path.exists():
|
||||
|
||||
Reference in New Issue
Block a user