mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 14:08:08 +01:00
prompt validator to prevent going off beaten track
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, Deque
|
||||
from typing import Optional, Deque, Dict, Any, List, Union, Literal
|
||||
from models.tool_definitions import AgentGoal
|
||||
|
||||
|
||||
@@ -13,3 +13,32 @@ class ToolWorkflowParams:
|
||||
class CombinedInput:
|
||||
tool_params: ToolWorkflowParams
|
||||
agent_goal: AgentGoal
|
||||
|
||||
|
||||
Message = Dict[str, Union[str, Dict[str, Any]]]
|
||||
ConversationHistory = Dict[str, List[Message]]
|
||||
NextStep = Literal["confirm", "question", "done"]
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToolPromptInput:
|
||||
prompt: str
|
||||
context_instructions: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class ValidationInput:
|
||||
prompt: str
|
||||
conversation_history: ConversationHistory
|
||||
agent_goal: AgentGoal
|
||||
|
||||
|
||||
@dataclass
|
||||
class ValidationResult:
|
||||
validationResult: bool
|
||||
validationFailedReason: dict = None
|
||||
|
||||
def __post_init__(self):
|
||||
# Initialize empty dict if None
|
||||
if self.validationFailedReason is None:
|
||||
self.validationFailedReason = {}
|
||||
|
||||
Reference in New Issue
Block a user