mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 01:36:30 +02:00
Added source connector integration to chat input options
This commit is contained in:
parent
b8c23030c5
commit
cf162101a6
6 changed files with 2828 additions and 2157 deletions
|
|
@ -88,7 +88,8 @@ export function useChatAPI({ token, search_space_id }: UseChatAPIProps) {
|
|||
const createChat = useCallback(
|
||||
async (
|
||||
initialMessage: string,
|
||||
researchMode: ResearchMode
|
||||
researchMode: ResearchMode,
|
||||
selectedConnectors: string[]
|
||||
): Promise<string | null> => {
|
||||
if (!token) {
|
||||
console.error("Authentication token not found");
|
||||
|
|
@ -107,7 +108,7 @@ export function useChatAPI({ token, search_space_id }: UseChatAPIProps) {
|
|||
body: JSON.stringify({
|
||||
type: researchMode,
|
||||
title: "Untitled Chat",
|
||||
initial_connectors: [],
|
||||
initial_connectors: selectedConnectors,
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
|
|
@ -139,7 +140,8 @@ export function useChatAPI({ token, search_space_id }: UseChatAPIProps) {
|
|||
async (
|
||||
chatId: string,
|
||||
messages: Message[],
|
||||
researchMode: ResearchMode
|
||||
researchMode: ResearchMode,
|
||||
selectedConnectors: string[]
|
||||
) => {
|
||||
if (!token) return;
|
||||
|
||||
|
|
@ -164,7 +166,7 @@ export function useChatAPI({ token, search_space_id }: UseChatAPIProps) {
|
|||
body: JSON.stringify({
|
||||
type: researchMode,
|
||||
title: title,
|
||||
initial_connectors: [],
|
||||
initial_connectors: selectedConnectors,
|
||||
messages: messages,
|
||||
search_space_id: Number(search_space_id),
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue