Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-undo-functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
shatfield4 committed Nov 12, 2024
2 parents 919bd13 + 4d15d4b commit 5a27975
Show file tree
Hide file tree
Showing 15 changed files with 597 additions and 34 deletions.
3 changes: 1 addition & 2 deletions collector/utils/WhisperProviders/OpenAiWhisper.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class OpenAiWhisper {
.create({
file: fs.createReadStream(fullFilePath),
model: this.model,
response_format: "text",
temperature: this.temperature,
})
.then((response) => {
Expand All @@ -33,7 +32,7 @@ class OpenAiWhisper {
};
}

return { content: response, error: null };
return { content: response.text, error: null };
})
.catch((error) => {
this.#log(
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/DefaultChat/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ import { userFromStorage } from "@/utils/request";
import { AI_BACKGROUND_COLOR, USER_BACKGROUND_COLOR } from "@/utils/constants";
import useUser from "@/hooks/useUser";
import { useTranslation, Trans } from "react-i18next";
import Appearance from "@/models/appearance";

export default function DefaultChatContainer() {
const { showScrollbar } = Appearance.getSettings();
const [mockMsgs, setMockMessages] = useState([]);
const { user } = useUser();
const [fetchedMessages, setFetchedMessages] = useState([]);
Expand Down Expand Up @@ -305,7 +307,9 @@ export default function DefaultChatContainer() {
return (
<div
style={{ height: isMobile ? "100%" : "calc(100% - 32px)" }}
className="transition-all duration-500 relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-main-gradient w-full h-full overflow-y-scroll border-2 border-outline"
className={`relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-main-gradient w-full border-2 border-outline overflow-y-scroll ${
showScrollbar ? "show-scrollbar" : "no-scroll"
}`}
>
{isMobile && <SidebarMobileHeader />}
{fetchedMessages.length === 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export default function AnthropicAiOptions({ settings }) {
"claude-2.0",
"claude-2.1",
"claude-3-haiku-20240307",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-opus-latest",
"claude-3-5-haiku-latest",
"claude-3-5-haiku-20241022",
"claude-3-5-sonnet-latest",
"claude-3-5-sonnet-20241022",
"claude-3-5-sonnet-20240620",
].map((model) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function PATAlert({ accessToken }) {
<br />
<br />
<a
href="https://gitlab.com/-/profile/personal_access_tokens"
href="https://gitlab.com/-/user_settings/personal_access_tokens"
rel="noreferrer"
target="_blank"
className="underline"
Expand Down Expand Up @@ -319,7 +319,7 @@ function PATTooltip({ accessToken }) {
, the GitLab API may limit the number of files that can be collected
due to rate limits. You can{" "}
<a
href="https://gitlab.com/-/profile/personal_access_tokens"
href="https://gitlab.com/-/user_settings/personal_access_tokens"
rel="noreferrer"
target="_blank"
className="underline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default function ChatHistory({
const chatHistoryRef = useRef(null);
const [textSize, setTextSize] = useState("normal");
const [isUserScrolling, setIsUserScrolling] = useState(false);
const showScrollbar = Appearance.getSettings()?.showScrollbar || false;
const isStreaming = history[history.length - 1]?.animate;
const { showScrollbar } = Appearance.getSettings();

const getTextSizeClass = (size) => {
switch (size) {
Expand Down Expand Up @@ -205,7 +205,7 @@ export default function ChatHistory({
return (
<div
className={`markdown text-white/80 font-light ${textSize} h-full md:h-[83%] pb-[100px] pt-6 md:pt-0 md:pb-20 md:mx-0 overflow-y-scroll flex flex-col justify-start ${
showScrollbar ? "" : "no-scroll"
showScrollbar ? "show-scrollbar" : "no-scroll"
}`}
id="chat-history"
ref={chatHistoryRef}
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/hooks/useGetProvidersModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ const PROVIDER_DEFAULT_MODELS = {
"claude-instant-1.2",
"claude-2.0",
"claude-2.1",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-3-sonnet-20240229",
"claude-3-opus-latest",
"claude-3-5-haiku-latest",
"claude-3-5-haiku-20241022",
"claude-3-5-sonnet-latest",
"claude-3-5-sonnet-20241022",
"claude-3-5-sonnet-20240620",
],
azure: [],
Expand Down
44 changes: 41 additions & 3 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,53 @@ a {
}
}

#chat-history::-webkit-scrollbar,
.show-scrollbar {
overflow-y: scroll !important;
scrollbar-width: thin !important;
scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.1) !important;
-webkit-overflow-scrolling: touch !important;
}

.show-scrollbar::-webkit-scrollbar {
width: 8px !important;
display: block !important;
background: transparent !important;
}

.show-scrollbar::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1) !important;
margin: 3px !important;
border-radius: 4px !important;
}

.show-scrollbar::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.3) !important;
border-radius: 4px !important;
border: none !important;
min-height: 40px !important;
}

.show-scrollbar::-webkit-scrollbar,
.show-scrollbar::-webkit-scrollbar-thumb,
.show-scrollbar::-webkit-scrollbar-track {
visibility: visible !important;
opacity: 1 !important;
}

.show-scrollbar,
.show-scrollbar::-webkit-scrollbar,
.show-scrollbar::-webkit-scrollbar-thumb,
.show-scrollbar::-webkit-scrollbar-track {
transition: none !important;
animation: none !important;
}

#chat-container::-webkit-scrollbar,
.no-scroll::-webkit-scrollbar {
display: none !important;
}

/* Hide scrollbar for IE, Edge and Firefox */
#chat-history,
#chat-container,
.no-scroll {
-ms-overflow-style: none !important;
/* IE and Edge */
Expand Down
Loading

0 comments on commit 5a27975

Please sign in to comment.