matt HOFFNER commited on
Commit
ac695ee
·
1 Parent(s): c23d919

console.log testing

Browse files
src/app/search/web/page.jsx CHANGED
@@ -2,6 +2,7 @@
2
  import { useEffect, useState } from "react";
3
 
4
  export default function WebSearchPage({ searchParams }) {
 
5
  const [aiResponse, setAiResponse] = useState(null);
6
  const startIndex = searchParams.start || "1";
7
 
@@ -21,7 +22,9 @@ export default function WebSearchPage({ searchParams }) {
21
  return () => {
22
  openaiRes.close();
23
  };
24
- }, [searchParams, startIndex]);
 
 
25
 
26
 
27
  return <>{aiResponse ? JSON.stringify(aiResponse) : 'Loading...'}</>;
 
2
  import { useEffect, useState } from "react";
3
 
4
  export default function WebSearchPage({ searchParams }) {
5
+ console.log(searchParams);
6
  const [aiResponse, setAiResponse] = useState(null);
7
  const startIndex = searchParams.start || "1";
8
 
 
22
  return () => {
23
  openaiRes.close();
24
  };
25
+ }, [searchParams, startIndex, aiResponse]);
26
+
27
+ console.log(aiResponse);
28
 
29
 
30
  return <>{aiResponse ? JSON.stringify(aiResponse) : 'Loading...'}</>;
src/pages/api/llm.js CHANGED
@@ -55,7 +55,6 @@ export default function handler(req, res) {
55
 
56
  while (true) {
57
  response = await getCompletion(messages);
58
- console.log(response);
59
 
60
  if (response.data.choices[0].finish_reason === "stop") {
61
  res.write(`data: ${JSON.stringify({ result: response.data.choices[0].message.content })}\n\n`);
 
55
 
56
  while (true) {
57
  response = await getCompletion(messages);
 
58
 
59
  if (response.data.choices[0].finish_reason === "stop") {
60
  res.write(`data: ${JSON.stringify({ result: response.data.choices[0].message.content })}\n\n`);