Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

refactor(backend): remove page context from chat service (#11844)

Swiftyd5c0f5b2df67
diff --git a/autogpt_platform/backend/backend/api/features/chat/service.py b/autogpt_platform/backend/backend/api/features/chat/service.py
index 43fb7b35a7..e10343fff6 100644
--- a/autogpt_platform/backend/backend/api/features/chat/service.py
+++ b/autogpt_platform/backend/backend/api/features/chat/service.py
@@ -237,18 +237,9 @@ async def stream_chat_completion(
)
if message:
- # Build message content with context if provided
- message_content = message
- if context and context.get("url") and context.get("content"):
- context_text = f"Page URL: {context['url']}\n\nPage Content:\n{context['content']}\n\n---\n\nUser Message: {message}"
- message_content = context_text
- logger.info(
- f"Including page context: URL={context['url']}, content_length={len(context['content'])}"
- )
-
session.messages.append(
ChatMessage(
- role="user" if is_user_message else "assistant", content=message_content
+ role="user" if is_user_message else "assistant", content=message
)
)
logger.info(