Skip to content

Commit

Permalink
fix: code
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Aug 29, 2024
1 parent f538182 commit 3555a77
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export function LlamaIndexStream(
return createParser(res)
.pipeThrough(createCallbacksTransformer(callbacks))
.pipeThrough(
createStreamDataTransformer(callbacks?.experimental_streamData),
createStreamDataTransformer(),
);
}
6 changes: 3 additions & 3 deletions examples/llamaindex-straming/app/components/chat-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ChatInput, ChatMessages } from "./ui/chat";
import { useAtom, useAtomValue, useSetAtom } from "jotai/react";
import { Suspense } from "react";
import { atom } from "jotai/vanilla";
import { Message } from "ai";
import type { Message } from "ai";

const {
messagesAtom,
Expand All @@ -24,11 +24,11 @@ const {
},
});

const clearMessagesAtom = atom(null, async (get, set) =>
const clearMessagesAtom = atom(null, async (_get, set) =>
set(messagesAtom, [] as Message[]),
);

const saveMessagesEffectAtom = atomEffect((get, set) => {
const saveMessagesEffectAtom = atomEffect((get, _set) => {
const messages = get(messagesAtom);
const idbPromise = import("idb-keyval");
const abortController = new AbortController();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PauseCircle, RefreshCw, Eraser } from "lucide-react";

import { Button } from "../button";
import { ChatHandler } from "./chat.interface";
import type { ChatHandler } from "./chat.interface";

export default function ChatActions(
props: Pick<ChatHandler, "stop" | "reload" | "clear"> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from "../button";
import { Input } from "../input";
import { ChatHandler } from "./chat.interface";
import type { ChatHandler } from "./chat.interface";

export default function ChatInput(
props: Pick<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Check, Copy } from "lucide-react";

import { Button } from "../button";
import ChatAvatar from "./chat-avatar";
import { Message } from "./chat.interface";
import type { Message } from "./chat.interface";
import Markdown from "./markdown";
import { useCopyToClipboard } from "./use-copy-to-clipboard";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useRef } from "react";

import ChatActions from "./chat-actions";
import ChatMessage from "./chat-message";
import { ChatHandler } from "./chat.interface";
import type { ChatHandler } from "./chat.interface";

export default function ChatMessages(
props: Pick<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import React, { FC, memo } from "react";
import React, { type FC, memo } from "react";
import { Check, Copy, Download } from "lucide-react";
import { Prism, SyntaxHighlighterProps } from "react-syntax-highlighter";
import { Prism, type SyntaxHighlighterProps } from "react-syntax-highlighter";
import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism";

import { Button } from "../button";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, memo } from "react";
import ReactMarkdown, { Options } from "react-markdown";
import { type FC, memo } from "react";
import ReactMarkdown, { type Options } from "react-markdown";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";

Expand Down
1 change: 1 addition & 0 deletions examples/llamaindex-straming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@radix-ui/react-slot": "^1.0.2",
"ai": "^3.3.20",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"foxact": "^0.2.37",
"idb-keyval": "^6.2.1",
"jotai": "^2.6.5",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3555a77

Please sign in to comment.