- 新增 OpenAI-compatible LLM client,支持 base_url、api_key、model 配置 - 固化意图识别、参数抽取、部署计划生成的结构化 JSON 提示词 - 增加 MCP client 配置读取和真实 session 接入说明 - 实现 checkpoint 自动保存、resume 断点续跑和已完成步骤跳过 - 实现人工确认流程,支持失败 IP 回滚 approve/reject - 新增 chat 常驻式 CLI 对话框,支持自然语言分析、参数设置、执行确认、状态查看、回滚确认和续跑 - 同步 README,补充 LLM、MCP、checkpoint、confirm/resume、chat 使用方式 - 增加相关单元测试,覆盖 LLM client、MCP 配置、确认/续跑和交互式 CLI
25 lines
602 B
Python
25 lines
602 B
Python
"""Shared LLM client protocol."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Protocol
|
|
|
|
from pam_deploy_graph.models import ExecutionStrategy, LlmDeployPlan, LlmIntentResult, LlmParamResult
|
|
|
|
|
|
class LlmClient(Protocol):
|
|
def understand_request(self, text: str) -> LlmIntentResult:
|
|
...
|
|
|
|
def extract_params(self, text: str, base_params: dict[str, Any] | None = None) -> LlmParamResult:
|
|
...
|
|
|
|
def generate_plan(
|
|
self,
|
|
*,
|
|
params: dict[str, Any],
|
|
intent: str,
|
|
strategy: ExecutionStrategy,
|
|
) -> LlmDeployPlan:
|
|
...
|