mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 16:36:53 +08:00
fix current_date
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import traceback
|
import traceback
|
||||||
import uuid
|
import uuid
|
||||||
from time import strftime
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Callable, Dict, List, Optional
|
from typing import Callable, Dict, List, Optional
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ class MoviePilotAgent:
|
|||||||
# 系统提示词
|
# 系统提示词
|
||||||
system_prompt = prompt_manager.get_agent_prompt(
|
system_prompt = prompt_manager.get_agent_prompt(
|
||||||
channel=self.channel
|
channel=self.channel
|
||||||
).format(current_date=strftime("%Y-%m-%d"))
|
)
|
||||||
|
|
||||||
# LLM 模型(用于 agent 执行)
|
# LLM 模型(用于 agent 执行)
|
||||||
llm = self._initialize_llm()
|
llm = self._initialize_llm()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"""提示词管理器"""
|
"""提示词管理器"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from time import strftime
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
@@ -81,7 +82,8 @@ class PromptManager:
|
|||||||
# 始终替换占位符,避免后续 .format() 时因残留花括号报 KeyError
|
# 始终替换占位符,避免后续 .format() 时因残留花括号报 KeyError
|
||||||
base_prompt = base_prompt.format(
|
base_prompt = base_prompt.format(
|
||||||
markdown_spec=markdown_spec,
|
markdown_spec=markdown_spec,
|
||||||
verbose_spec=verbose_spec
|
verbose_spec=verbose_spec,
|
||||||
|
current_date=strftime("%Y-%m-%d")
|
||||||
)
|
)
|
||||||
|
|
||||||
return base_prompt
|
return base_prompt
|
||||||
|
|||||||
Reference in New Issue
Block a user