Formatting nits (#2311)

* stream in all cases

* update code block

* code formatting nits

* proper ports

* proper ports

* remove unnecessary lines
This commit is contained in:
pablodanswer
2024-09-03 09:05:02 -07:00
committed by GitHub
parent a3b1b1db38
commit 5b1f3c8d4e
5 changed files with 16 additions and 2 deletions

View File

@@ -248,6 +248,13 @@ class Answer:
if self.is_cancelled: if self.is_cancelled:
return return
yield cast(str, message.content) yield cast(str, message.content)
if (
message.additional_kwargs.get("usage_metadata", {}).get("stop")
== "length"
):
yield StreamStopInfo(
stop_reason=StreamStopReason.CONTEXT_LENGTH
)
if not tool_call_chunk: if not tool_call_chunk:
return # no tool call needed return # no tool call needed

View File

@@ -99,7 +99,6 @@ import ExceptionTraceModal from "@/components/modals/ExceptionTraceModal";
import { SEARCH_TOOL_NAME } from "./tools/constants"; import { SEARCH_TOOL_NAME } from "./tools/constants";
import { useUser } from "@/components/user/UserProvider"; import { useUser } from "@/components/user/UserProvider";
import { Stop } from "@phosphor-icons/react";
const TEMP_USER_MESSAGE_ID = -1; const TEMP_USER_MESSAGE_ID = -1;
const TEMP_ASSISTANT_MESSAGE_ID = -2; const TEMP_ASSISTANT_MESSAGE_ID = -2;

View File

@@ -364,7 +364,7 @@ export const AIMessage = ({
<FileDisplay files={files || []} /> <FileDisplay files={files || []} />
{typeof content === "string" ? ( {typeof content === "string" ? (
<div className="overflow-x-visible w-full pr-2"> <div className="overflow-x-visible max-w-content-max">
<ReactMarkdown <ReactMarkdown
key={messageId} key={messageId}
className="prose max-w-full text-base" className="prose max-w-full text-base"

View File

@@ -230,3 +230,10 @@ form {
gap: 1.2rem; gap: 1.2rem;
align-items: start; align-items: start;
} }
ol > li > p,
ul > li > p {
margin-top: 0;
margin-bottom: 0;
display: inline; /* Make paragraphs inline to reduce vertical space */
}

View File

@@ -65,6 +65,7 @@ module.exports = {
maxWidth: { maxWidth: {
"document-sidebar": "1000px", "document-sidebar": "1000px",
"message-max": "850px", "message-max": "850px",
"content-max": "725px",
"searchbar-max": "800px", "searchbar-max": "800px",
}, },
colors: { colors: {