(fix) type error, ui adjust

This commit is contained in:
ManishMadan2882
2025-06-09 19:50:07 +05:30
parent c0d385b983
commit ef35864e16
4 changed files with 12 additions and 18 deletions

View File

@@ -107,13 +107,15 @@ const ConversationBubble = forwardRef<
<div
onMouseEnter={() => setIsQuestionHovered(true)}
onMouseLeave={() => setIsQuestionHovered(false)}
className={className}
>
<div className="flex flex-col items-end">
{filesAttached && filesAttached.length > 0 && (
<div className="mb-2 mr-12 flex flex-wrap justify-end gap-2">
<div className="mb-4 mr-12 flex flex-wrap justify-end gap-2">
{filesAttached.map((file, index) => (
<div
key={index}
title={file.fileName}
className="flex items-center rounded-xl bg-[#EFF3F4] p-2 text-[14px] text-[#5D5D5D] dark:bg-[#393B3D] dark:text-bright-gray"
>
<div className="mr-2 items-center justify-center rounded-lg bg-purple-30 p-[5.5px]">
@@ -132,7 +134,7 @@ const ConversationBubble = forwardRef<
)}
<div
ref={ref}
className={`flex flex-row-reverse justify-items-start ${className}`}
className={`flex flex-row-reverse justify-items-start`}
>
<Avatar
size="SMALL"

View File

@@ -279,12 +279,12 @@ export function handleSendFeedback(
});
}
export function handleFetchSharedAnswerStreaming( //for shared conversations
export function handleFetchSharedAnswerStreaming(
question: string,
signal: AbortSignal,
apiKey: string,
history: Array<any> = [],
attachments: string[] = [], // Add attachments parameter with default empty array
attachments: string[] = [],
onEvent: (event: MessageEvent) => void,
): Promise<Answer> {
history = history.map((item) => {
@@ -301,7 +301,7 @@ export function handleFetchSharedAnswerStreaming( //for shared conversations
history: JSON.stringify(history),
api_key: apiKey,
save_conversation: false,
attachments: attachments.length > 0 ? attachments : undefined, // Add attachments to payload
attachments: attachments.length > 0 ? attachments : undefined,
};
conversationService
.answerStream(payload, null, signal)
@@ -376,13 +376,10 @@ export function handleFetchSharedAnswer(
const payload = {
question: question,
api_key: apiKey,
attachments:
attachments && attachments.length > 0 ? attachments : undefined,
};
// Add attachments to payload if they exist
if (attachments && attachments.length > 0) {
payload.attachments = attachments;
}
return conversationService
.answer(payload, null, signal)
.then((response) => {