Add dependencies and update code for PDF parsing and searching

This commit is contained in:
n4ze3m
2024-02-25 00:12:46 +05:30
parent f87953ba5c
commit 06b32176a9
22 changed files with 577 additions and 249 deletions

View File

@@ -44,7 +44,7 @@ export const useStoreMessage = create<State>((set) => ({
setMessages: (messages) => set({ messages }),
history: [],
setHistory: (history) => set({ history }),
streaming: true,
streaming: false,
setStreaming: (streaming) => set({ streaming }),
isFirstMessage: true,
setIsFirstMessage: (isFirstMessage) => set({ isFirstMessage }),

View File

@@ -1,11 +1,21 @@
import { create } from "zustand"
type WebSearch = {
search_engine: string
search_url: string
search_query: string
search_results: {
title: string
link: string
}[]
}
export type Message = {
isBot: boolean
name: string
message: string
sources: any[]
images?: string[]
search?: WebSearch
}
export type ChatHistory = {
@@ -44,7 +54,7 @@ export const useStoreMessageOption = create<State>((set) => ({
setMessages: (messages) => set({ messages }),
history: [],
setHistory: (history) => set({ history }),
streaming: true,
streaming: false,
setStreaming: (streaming) => set({ streaming }),
isFirstMessage: true,
setIsFirstMessage: (isFirstMessage) => set({ isFirstMessage }),

11
src/store/webui.tsx Normal file
View File

@@ -0,0 +1,11 @@
import { create } from "zustand"
type State = {
sendWhenEnter: boolean
setSendWhenEnter: (sendWhenEnter: boolean) => void
}
export const useWebUI = create<State>((set) => ({
sendWhenEnter: true,
setSendWhenEnter: (sendWhenEnter) => set({ sendWhenEnter })
}))