mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 03:20:46 +02:00
Allow chat history to be sent to AI engine (#6128)
# Description of Changes Add an extra parameter to every agent to receive the conversation history in addition to the current message. This will make it possible to answer followup questions from the AI without needing to give full context in your message.
This commit is contained in:
@@ -32,7 +32,9 @@ class StubUserSpecAgent(UserSpecAgent):
|
||||
],
|
||||
)
|
||||
|
||||
async def _build_edit_plan(self, user_message: str) -> EditPlanResponse:
|
||||
async def _build_edit_plan(
|
||||
self, user_message: str, conversation_history: list[ConversationMessage]
|
||||
) -> EditPlanResponse:
|
||||
return self.edit_plan
|
||||
|
||||
async def _run_draft_agent(self, request: AgentDraftRequest, edit_plan: EditPlanResponse) -> AgentDraft:
|
||||
@@ -46,7 +48,9 @@ class ClarifyingUserSpecAgent(UserSpecAgent):
|
||||
def __init__(self, runtime: AppRuntime) -> None:
|
||||
super().__init__(runtime)
|
||||
|
||||
async def _build_edit_plan(self, user_message: str) -> EditClarificationRequest:
|
||||
async def _build_edit_plan(
|
||||
self, user_message: str, conversation_history: list[ConversationMessage]
|
||||
) -> EditClarificationRequest:
|
||||
return EditClarificationRequest(
|
||||
question="Which pages should be changed?",
|
||||
reason="The request does not specify the target pages.",
|
||||
|
||||
Reference in New Issue
Block a user