Skip to content

Commit

Permalink
fix default assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuo-danswer committed Sep 30, 2024
1 parent 5d63108 commit b041160
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
12 changes: 6 additions & 6 deletions web/src/app/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export function ChatPage({
user,
availableAssistants
);
const finalAssistants = user
? orderAssistantsForUser(visibleAssistants, user)
: visibleAssistants;

const existingChatSessionAssistantId = selectedChatSession?.persona_id;
const [selectedAssistant, setSelectedAssistant] = useState<
Expand Down Expand Up @@ -215,7 +218,7 @@ export function ChatPage({
const liveAssistant =
alternativeAssistant ||
selectedAssistant ||
visibleAssistants[0] ||
finalAssistants[0] ||
availableAssistants[0];

useEffect(() => {
Expand Down Expand Up @@ -685,7 +688,7 @@ export function ChatPage({
useEffect(() => {
if (messageHistory.length === 0 && chatSessionIdRef.current === null) {
setSelectedAssistant(
visibleAssistants.find((persona) => persona.id === defaultAssistantId)
finalAssistants.find((persona) => persona.id === defaultAssistantId)
);
}
}, [defaultAssistantId]);
Expand Down Expand Up @@ -2384,10 +2387,7 @@ export function ChatPage({
showDocs={() => setDocumentSelection(true)}
selectedDocuments={selectedDocuments}
// assistant stuff
assistantOptions={orderAssistantsForUser(
visibleAssistants,
user
)}
assistantOptions={finalAssistants}
selectedAssistant={liveAssistant}
setSelectedAssistant={onAssistantChange}
setAlternativeAssistant={setAlternativeAssistant}
Expand Down
8 changes: 0 additions & 8 deletions web/src/lib/chat/fetchChatData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,6 @@ export async function fetchChatData(searchParams: {
!hasAnyConnectors &&
(!user || user.role === "admin");

const shouldDisplaySourcesIncompleteModal =
hasAnyConnectors &&
!shouldShowWelcomeModal &&
!ccPairs.some(
(ccPair) => ccPair.has_successful_run && ccPair.docs_indexed > 0
) &&
(!user || user.role == "admin");

// if no connectors are setup, only show personas that are pure
// passthrough and don't do any retrieval
if (!hasAnyConnectors) {
Expand Down

0 comments on commit b041160

Please sign in to comment.