();
const {
diff --git a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessageBody.tsx b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessageBody.tsx
index e0bcfc7d..0a4b8a32 100644
--- a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessageBody.tsx
+++ b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessageBody.tsx
@@ -36,7 +36,7 @@
* DATA.
*/
-import { ChatMessageType, ToolEventResponse } from "src/api/chatApi.ts";
+import { ChatMessageType, ChatEvent } from "src/api/chatApi.ts";
import UserQuestion from "pages/RagChatTab/ChatOutput/ChatMessages/UserQuestion.tsx";
import { Divider, Flex, Typography } from "antd";
import Images from "src/components/images/Images.ts";
@@ -53,7 +53,7 @@ export const ChatMessageBody = ({
streamedEvents,
}: {
data: ChatMessageType;
- streamedEvents?: ToolEventResponse[];
+ streamedEvents?: ChatEvent[];
}) => {
return (
diff --git a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/MarkdownResponse.tsx b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/MarkdownResponse.tsx
index d8488085..7da784db 100644
--- a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/MarkdownResponse.tsx
+++ b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/MarkdownResponse.tsx
@@ -58,7 +58,7 @@ export const MarkdownResponse = ({ data }: { data: ChatMessageType }) => {
const { href, className, children, ...other } = props;
if (className === "rag_citation") {
if (data.source_nodes.length === 0) {
- return undefined;
+ return {props.children};
}
const { source_nodes } = data;
const sourceNodeIndex = source_nodes.findIndex(
@@ -66,10 +66,13 @@ export const MarkdownResponse = ({ data }: { data: ChatMessageType }) => {
);
if (sourceNodeIndex >= 0) {
return (
-
+
+ {props.children}
+
+
);
}
if (!href?.startsWith("http")) {
diff --git a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/StreamedEvents.tsx b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/StreamedEvents.tsx
index 1c099d37..801620eb 100644
--- a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/StreamedEvents.tsx
+++ b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/StreamedEvents.tsx
@@ -36,13 +36,13 @@
* DATA.
*/
-import { ToolEventResponse } from "src/api/chatApi.ts";
+import { ChatEvent } from "src/api/chatApi.ts";
import { Button, Card, Flex, Spin, Typography } from "antd";
import { format } from "date-fns";
import { useState } from "react";
import { MinusOutlined, PlusOutlined } from "@ant-design/icons";
-const StreamedEvent = ({ event }: { event: ToolEventResponse }) => {
+const StreamedEvent = ({ event }: { event: ChatEvent }) => {
return (
@@ -76,7 +76,7 @@ const StreamedEvent = ({ event }: { event: ToolEventResponse }) => {
const StreamedEvents = ({
streamedEvents,
}: {
- streamedEvents?: ToolEventResponse[];
+ streamedEvents?: ChatEvent[];
}) => {
const [collapsed, setCollapsed] = useState(true);
diff --git a/ui/src/pages/RagChatTab/State/RagChatContext.tsx b/ui/src/pages/RagChatTab/State/RagChatContext.tsx
index 5b80dd2d..eb9a43e1 100644
--- a/ui/src/pages/RagChatTab/State/RagChatContext.tsx
+++ b/ui/src/pages/RagChatTab/State/RagChatContext.tsx
@@ -40,7 +40,7 @@ import { createContext, Dispatch, SetStateAction } from "react";
import {
ChatHistoryResponse,
ChatMessageType,
- ToolEventResponse,
+ ChatEvent,
} from "src/api/chatApi.ts";
import { Session } from "src/api/sessionApi.ts";
import { DataSourceType } from "src/api/dataSourceApi.ts";
@@ -64,10 +64,7 @@ export interface RagChatContextType {
>;
};
streamedChatState: [string, Dispatch>];
- streamedEventState: [
- ToolEventResponse[],
- Dispatch>,
- ];
+ streamedEventState: [ChatEvent[], Dispatch>];
streamedAbortControllerState: [
AbortController | undefined,
Dispatch>,