diff --git a/surfsense_web/components/chat/ChatPanel/ChatPanelContainer.tsx b/surfsense_web/components/chat/ChatPanel/ChatPanelContainer.tsx index 4648ae9c9..a4eb30ef9 100644 --- a/surfsense_web/components/chat/ChatPanel/ChatPanelContainer.tsx +++ b/surfsense_web/components/chat/ChatPanel/ChatPanelContainer.tsx @@ -13,6 +13,7 @@ export interface GeneratePodcastRequest { ids: number[]; search_space_id: number; podcast_title?: string; + user_prompt?: string; } export function ChatPanelContainer() { diff --git a/surfsense_web/components/chat/ChatPanel/ChatPanelView.tsx b/surfsense_web/components/chat/ChatPanel/ChatPanelView.tsx index 0f18a7e99..1d4ac4c71 100644 --- a/surfsense_web/components/chat/ChatPanel/ChatPanelView.tsx +++ b/surfsense_web/components/chat/ChatPanel/ChatPanelView.tsx @@ -73,7 +73,7 @@ export function ChatPanelView(props: ChatPanelViewProps) { tabIndex={0} onClick={handleGeneratePost} onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { + if (e.key === "Enter") { e.preventDefault(); handleGeneratePost(); } diff --git a/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx b/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx index 58a5318cb..2ee0d30cb 100644 --- a/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx +++ b/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx @@ -19,7 +19,7 @@ export function ConfigModal(props: ConfigModalProps) { const { generatePodcast } = props; - const [podcastTitle, setPodcastTitle] = useState(podcast?.title || chatDetails?.title); + const [userPromt, setUserPrompt] = useState(""); const handleGeneratePost = useCallback(async () => { if (!chatDetails) return; @@ -27,9 +27,10 @@ export function ConfigModal(props: ConfigModalProps) { type: "CHAT", ids: [chatDetails.id], search_space_id: chatDetails.search_space_id, - podcast_title: podcastTitle || podcast?.title || chatDetails.title, + podcast_title: podcast?.title || chatDetails.title, + user_prompt: userPromt, }); - }, [chatDetails, podcastTitle]); + }, [chatDetails, userPromt]); return ( @@ -49,11 +50,11 @@ export function ConfigModal(props: ConfigModalProps) { diff --git a/surfsense_web/lib/apis/podcast-apis.ts b/surfsense_web/lib/apis/podcast-apis.ts index 533dd88b7..0324d7066 100644 --- a/surfsense_web/lib/apis/podcast-apis.ts +++ b/surfsense_web/lib/apis/podcast-apis.ts @@ -28,8 +28,6 @@ export const getPodcastByChatId = async (chatId: string, authToken: string) => { export const generatePodcast = async (request: GeneratePodcastRequest, authToken: string) => { try { - const { podcast_title = "SurfSense Podcast" } = request; - const response = await fetch( `${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/podcasts/generate/`, { @@ -38,7 +36,7 @@ export const generatePodcast = async (request: GeneratePodcastRequest, authToken Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", }, - body: JSON.stringify({ ...request, podcast_title }), + body: JSON.stringify(request), } );