mirror of
https://github.com/wassname/stampy-chat.git
synced 2026-09-11 12:50:34 +08:00
display followups in UI
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ from typing import List
|
||||
from urllib.parse import quote
|
||||
import requests
|
||||
|
||||
SIMILARITY_THRESHOLD = 0.5 # total shot in the dark - play with this later
|
||||
SIMILARITY_THRESHOLD = 0.4 # bit of a shot in the dark - play with this later
|
||||
MAX_FOLLOWUPS = 3
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -426,6 +426,21 @@ const Home: NextPage = () => {
|
||||
return <></>
|
||||
})}
|
||||
|
||||
{(() => {
|
||||
if (loadState.state === "idle") {
|
||||
return <div className="flex flex-col items-end"> {
|
||||
loadState.followups.map((followup, i) => {
|
||||
return <li key={i}>
|
||||
<button className="border border-gray-300 px-1 my-1">
|
||||
<span> {followup.text} </span>
|
||||
</button>
|
||||
</li>
|
||||
})
|
||||
}</div>
|
||||
}
|
||||
return <></>;
|
||||
})()}
|
||||
|
||||
<SearchBox search={search} />
|
||||
|
||||
{(() => {
|
||||
|
||||
@@ -22,7 +22,7 @@ const SearchBox: React.FC<{search: (
|
||||
|
||||
if (loading) return <></>;
|
||||
return (<>
|
||||
<form className="flex mb-2" onSubmit={async (e) => {
|
||||
<form className="flex mb-2 mt-1" onSubmit={async (e) => {
|
||||
e.preventDefault();
|
||||
search(query, setQuery, setLoading);
|
||||
}}>
|
||||
|
||||
Reference in New Issue
Block a user