Compare commits

...

5 Commits

Author SHA1 Message Date
2d076373d8 Merge 728919f7bf into 4d24d73161 2025-02-20 10:46:59 +01:00
4d24d73161 Merge pull request #631 from user1007017/patch-1
Update README.md grammatical error
2025-02-20 10:37:33 +05:30
5f0b87f4a9 Update README.md 2025-02-15 19:06:46 +01:00
nix
728919f7bf formating 2025-01-31 20:09:58 +01:00
nix
68048dfd56 add websocket subpath support 2025-01-31 20:01:26 +01:00
2 changed files with 11 additions and 6 deletions

View File

@ -44,7 +44,7 @@ Want to know more about its architecture and how it works? You can read it [here
- **Normal Mode:** Processes your query and performs a web search.
- **Focus Modes:** Special modes to better answer specific types of questions. Perplexica currently has 6 focus modes:
- **All Mode:** Searches the entire web to find the best results.
- **Writing Assistant Mode:** Helpful for writing tasks that does not require searching the web.
- **Writing Assistant Mode:** Helpful for writing tasks that do not require searching the web.
- **Academic Search Mode:** Finds articles and papers, ideal for academic research.
- **YouTube Search Mode:** Finds YouTube videos based on the search query.
- **Wolfram Alpha Search Mode:** Answers queries that need calculations or data analysis using Wolfram Alpha.

View File

@ -377,11 +377,16 @@ const ChatWindow = ({ id }: { id?: string }) => {
const [isReady, setIsReady] = useState(false);
const [isWSReady, setIsWSReady] = useState(false);
const ws = useSocket(
process.env.NEXT_PUBLIC_WS_URL!,
setIsWSReady,
setHasError,
);
let websocketUrl = process.env.NEXT_PUBLIC_WS_URL!;
if (websocketUrl.startsWith('/')) {
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
const host = window.location.host;
const path = websocketUrl;
websocketUrl = `${protocol}${host}${path}`;
}
const ws = useSocket(websocketUrl, setIsWSReady, setHasError);
const [loading, setLoading] = useState(false);
const [messageAppeared, setMessageAppeared] = useState(false);