Update chat view decorators

This commit is contained in:
shamoon 2025-04-28 21:23:16 -07:00
parent a83b9a3a4d
commit a957c5f053
No known key found for this signature in database

View File

@ -1140,8 +1140,14 @@ class DocumentViewSet(
) )
@method_decorator(ensure_csrf_cookie, name="dispatch") @method_decorator(
@method_decorator(login_required, name="dispatch") [
ensure_csrf_cookie,
login_required,
cache_control(no_cache=True),
],
name="dispatch",
)
class ChatStreamingView(View): class ChatStreamingView(View):
def post(self, request): def post(self, request):
request.compress_exempt = True request.compress_exempt = True
@ -1177,7 +1183,6 @@ class ChatStreamingView(View):
stream_chat_with_documents(query_str=question, documents=documents), stream_chat_with_documents(query_str=question, documents=documents),
content_type="text/event-stream", content_type="text/event-stream",
) )
response["Cache-Control"] = "no-cache"
return response return response