diff --git a/frontend/src/app/chat/page.tsx b/frontend/src/app/chat/page.tsx index cf1ebde1..ed634339 100644 --- a/frontend/src/app/chat/page.tsx +++ b/frontend/src/app/chat/page.tsx @@ -4,7 +4,7 @@ import { useState, useRef, useEffect } from "react" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Input } from "@/components/ui/input" -import { MessageCircle, Send, Loader2, User, Bot, Zap, Settings, ChevronDown, ChevronRight, Upload, FileText } from "lucide-react" +import { MessageCircle, Send, Loader2, User, Bot, Zap, Settings, ChevronDown, ChevronRight, Upload } from "lucide-react" interface Message { role: "user" | "assistant" @@ -24,6 +24,12 @@ interface FunctionCall { type EndpointType = "chat" | "langflow" +interface RequestBody { + prompt: string + stream?: boolean + previous_response_id?: string +} + export default function ChatPage() { const [messages, setMessages] = useState([]) const [input, setInput] = useState("") @@ -162,7 +168,7 @@ export default function ChatPage() { const apiEndpoint = endpoint === "chat" ? "/api/chat" : "/api/langflow" try { - const requestBody: any = { + const requestBody: RequestBody = { prompt: userMessage.content, stream: true } @@ -506,7 +512,7 @@ export default function ChatPage() { try { const apiEndpoint = endpoint === "chat" ? "/api/chat" : "/api/langflow" - const requestBody: any = { prompt: userMessage.content } + const requestBody: RequestBody = { prompt: userMessage.content } // Add previous_response_id if we have one for this endpoint const currentResponseId = previousResponseIds[endpoint] @@ -720,7 +726,7 @@ export default function ChatPage() { <>

Drop your document here

-

I'll process it and add it to our conversation context

+

I'll process it and add it to our conversation context

) : isUploading ? ( <>