Skip to content

Commit

Permalink
post rebase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Dec 2, 2024
1 parent d193c4f commit a38373e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
26 changes: 14 additions & 12 deletions web/src/app/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ export function ChatPage({
(assistant) => assistant.id === existingChatSessionAssistantId
)
: defaultAssistantId !== undefined
? availableAssistants.find(
(assistant) => assistant.id === defaultAssistantId
)
: undefined
? availableAssistants.find(
(assistant) => assistant.id === defaultAssistantId
)
: undefined
);
// Gather default temperature settings
const search_param_temperature = searchParams.get(
Expand All @@ -256,12 +256,12 @@ export function ChatPage({
const defaultTemperature = search_param_temperature
? parseFloat(search_param_temperature)
: selectedAssistant?.tools.some(
(tool) =>
tool.in_code_tool_id === "SearchTool" ||
tool.in_code_tool_id === "InternetSearchTool"
)
? 0
: 0.7;
(tool) =>
tool.in_code_tool_id === "SearchTool" ||
tool.in_code_tool_id === "InternetSearchTool"
)
? 0
: 0.7;

const setSelectedAssistantFromId = (assistantId: number) => {
// NOTE: also intentionally look through available assistants here, so that
Expand Down Expand Up @@ -1158,8 +1158,8 @@ export function ChatPage({
const currentAssistantId = alternativeAssistantOverride
? alternativeAssistantOverride.id
: alternativeAssistant
? alternativeAssistant.id
: liveAssistant.id;
? alternativeAssistant.id
: liveAssistant.id;

resetInputBar();
let messageUpdates: Message[] | null = null;
Expand Down Expand Up @@ -1985,6 +1985,7 @@ export function ChatPage({
<div className="md:hidden">
<Modal noPadding noScroll>
<ChatFilters
setPresentingDocument={setPresentingDocument}
modal={true}
filterManager={filterManager}
ccPairs={ccPairs}
Expand Down Expand Up @@ -2140,6 +2141,7 @@ export function ChatPage({
`}
>
<ChatFilters
setPresentingDocument={setPresentingDocument}
modal={false}
filterManager={filterManager}
ccPairs={ccPairs}
Expand Down
13 changes: 12 additions & 1 deletion web/src/app/chat/documentSidebar/ChatFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { ChatDocumentDisplay } from "./ChatDocumentDisplay";
import { usePopup } from "@/components/admin/connectors/Popup";
import { removeDuplicateDocs } from "@/lib/documentUtils";
import { Message } from "../interfaces";
import { ForwardedRef, forwardRef, useEffect, useState } from "react";
import {
Dispatch,
ForwardedRef,
forwardRef,
SetStateAction,
useEffect,
useState,
} from "react";
import { FilterManager } from "@/lib/hooks";
import { CCPairBasicInfo, DocumentSet, Tag } from "@/lib/types";
import { SourceSelector } from "../shared_chat_search/SearchFilters";
Expand All @@ -25,6 +32,7 @@ interface ChatFiltersProps {
tags: Tag[];
documentSets: DocumentSet[];
showFilters: boolean;
setPresentingDocument: Dispatch<SetStateAction<DanswerDocument | null>>;
}

export const ChatFilters = forwardRef<HTMLDivElement, ChatFiltersProps>(
Expand All @@ -43,6 +51,7 @@ export const ChatFilters = forwardRef<HTMLDivElement, ChatFiltersProps>(
isOpen,
ccPairs,
tags,
setPresentingDocument,
documentSets,
showFilters,
},
Expand Down Expand Up @@ -134,6 +143,8 @@ export const ChatFilters = forwardRef<HTMLDivElement, ChatFiltersProps>(
}`}
>
<ChatDocumentDisplay
setPresentingDocument={setPresentingDocument}
closeSidebar={closeSidebar}
modal={modal}
document={document}
isSelected={selectedDocumentIds.includes(
Expand Down

0 comments on commit a38373e

Please sign in to comment.