From a456f82806541b265d88d357d37979d2da0f2697 Mon Sep 17 00:00:00 2001 From: Mollie Munoz Date: Tue, 3 Dec 2024 14:42:47 -0800 Subject: [PATCH] New attachments recognized by GC (#277) - Allows GC to recognize new attachments via user message. - GC already setup to set user decision to update_outline as a result. - Immediately moves on to updating outline with new attachment content. --- .../agents/document/gc_draft_outline_feedback_config.py | 2 +- .../assistant/agents/document_agent.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/assistants/prospector-assistant/assistant/agents/document/gc_draft_outline_feedback_config.py b/assistants/prospector-assistant/assistant/agents/document/gc_draft_outline_feedback_config.py index 0bfb42dc..f07bdfee 100644 --- a/assistants/prospector-assistant/assistant/agents/document/gc_draft_outline_feedback_config.py +++ b/assistants/prospector-assistant/assistant/agents/document/gc_draft_outline_feedback_config.py @@ -65,7 +65,7 @@ class ArtifactModel(BaseModel): a. At any time, if the user asks for a change to the outline, the conversation_status must be marked as user_completed. The user_decision must be marked as update_outline. The final_response must inform the user that a new outline is being generated based off the request. -b. At any time, if the user has provided new attachments (detected via the filenames in the artifact), +b. At any time, if the user has provided new attachments (detected via `Newly attached files:` in the user message), the conversation_status must be marked as user_completed. The user_decision must be marked as update_outline. The final_response must inform the user that a new outline is being generated based on the addition of new attachments. diff --git a/assistants/prospector-assistant/assistant/agents/document_agent.py b/assistants/prospector-assistant/assistant/agents/document_agent.py index e074155f..f5acf6f9 100644 --- a/assistants/prospector-assistant/assistant/agents/document_agent.py +++ b/assistants/prospector-assistant/assistant/agents/document_agent.py @@ -941,6 +941,13 @@ async def _gc_outline_feedback( user_message = None else: user_message = message.content + + # if any files attached with message, include in user_message for GC knowledge: + if len(message.filenames) != 0: + user_message = user_message + " Newly attached files: " + filenames = ", ".join(message.filenames) + user_message = user_message + filenames + response_message, conversation_status, next_step_name = await guided_conversation.step_conversation( last_user_message=user_message, )