remove challenge's content

This commit is contained in:
2026-03-26 22:33:23 -06:00
parent cbdd1265bf
commit 504c2bb70b
2 changed files with 5 additions and 13 deletions

View File

@@ -53,12 +53,11 @@ class PromptConsumer(AsyncWebsocketConsumer):
try:
# Build history for LLM
history = await self.get_history_for_llm()
task_content = await self.get_task_content()
# Stream AI response
full_response = ""
try:
async for chunk in stream_chat(task_content, history):
async for chunk in stream_chat(history):
full_response += chunk
await self.send(text_data=json.dumps({
"type": "stream",
@@ -139,9 +138,3 @@ class PromptConsumer(AsyncWebsocketConsumer):
def get_history_for_llm(self):
messages = self.conversation.messages.all()
return [{"role": m.role, "content": m.content} for m in messages]
@database_sync_to_async
def get_task_content(self):
from task.models import Task
task = Task.objects.get(id=self.task_id)
return task.content