Skip to content

Commit a674243

Browse files
style: remove unrelated formatting changes
1 parent 4887ee5 commit a674243

File tree

4 files changed

+19
-36
lines changed

4 files changed

+19
-36
lines changed

components/VercelChat/ToolComponents.tsx

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import dynamic from "next/dynamic";
1010

1111
const MermaidDiagram = dynamic(
1212
() => import("@/components/VercelChat/tools/mermaid/MermaidDiagram"),
13-
{ ssr: false, loading: () => <MermaidDiagramSkeleton /> },
13+
{ ssr: false, loading: () => <MermaidDiagramSkeleton /> }
1414
);
1515
import { GenerateMermaidDiagramResult } from "@/lib/tools/generateMermaidDiagram";
1616
import CreateArtistToolCall from "./tools/CreateArtistToolCall";
@@ -43,12 +43,9 @@ import type { BrowserToolResultType } from "./tools/browser/BrowserToolResult";
4343
const BrowserToolResult = dynamic(
4444
() =>
4545
import("./tools/browser/BrowserToolResult").then(
46-
(mod) => mod.BrowserToolResult,
46+
(mod) => mod.BrowserToolResult
4747
),
48-
{
49-
ssr: false,
50-
loading: () => <BrowserToolSkeleton toolName="browser_agent" />,
51-
},
48+
{ ssr: false, loading: () => <BrowserToolSkeleton toolName="browser_agent" /> }
5249
);
5350
import { isSearchProgressUpdate } from "@/lib/search/searchProgressUtils";
5451
import { GetSpotifyPlayButtonClickedResult } from "@/lib/supabase/getSpotifyPlayButtonClicked";
@@ -108,10 +105,8 @@ import { Sora2VideoSkeleton } from "./tools/sora2/Sora2VideoSkeleton";
108105

109106
const Sora2VideoResult = dynamic(
110107
() =>
111-
import("./tools/sora2/Sora2VideoResult").then(
112-
(mod) => mod.Sora2VideoResult,
113-
),
114-
{ ssr: false, loading: () => <Sora2VideoSkeleton /> },
108+
import("./tools/sora2/Sora2VideoResult").then((mod) => mod.Sora2VideoResult),
109+
{ ssr: false, loading: () => <Sora2VideoSkeleton /> }
115110
);
116111
import CatalogSongsSkeleton from "./tools/catalog/CatalogSongsSkeleton";
117112
import CatalogSongsResult, {
@@ -318,10 +313,7 @@ export function getToolCallComponent(part: ToolUIPart) {
318313
<GetChatsSkeleton />
319314
</div>
320315
);
321-
} else if (
322-
toolName === "get_task_run_status" ||
323-
toolName === "prompt_sandbox"
324-
) {
316+
} else if (toolName === "get_task_run_status" || toolName === "prompt_sandbox") {
325317
return (
326318
<div key={toolCallId}>
327319
<RunPageSkeleton />
@@ -343,10 +335,10 @@ export function getToolCallComponent(part: ToolUIPart) {
343335

344336
export function getToolResultComponent(part: ToolUIPart | DynamicToolUIPart) {
345337
const { toolCallId, output, type } = part;
346-
const result =
347-
type === "dynamic-tool"
348-
? JSON.parse((output as CallToolResult).content[0].text)
349-
: output;
338+
const isMcp = type === "dynamic-tool";
339+
const result = isMcp
340+
? JSON.parse((output as CallToolResult).content[0].text)
341+
: output;
350342
const toolName = getToolOrDynamicToolName(part);
351343
const isSearchWebTool = toolName === "search_web";
352344
const isDeepResearchTool = toolName === "web_deep_research";
@@ -606,10 +598,7 @@ export function getToolResultComponent(part: ToolUIPart | DynamicToolUIPart) {
606598
<GetChatsResult result={result as GetChatsResultType} />
607599
</div>
608600
);
609-
} else if (
610-
toolName === "get_task_run_status" ||
611-
toolName === "prompt_sandbox"
612-
) {
601+
} else if (toolName === "get_task_run_status" || toolName === "prompt_sandbox") {
613602
const runId =
614603
toolName === "get_task_run_status"
615604
? ((part as DynamicToolUIPart).input as { runId: string }).runId

components/VercelChat/tools/CreateArtistToolResult.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export function CreateArtistToolResult({
2828
return (
2929
<div className="flex items-center space-x-4 p-3 rounded-md bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900 my-2">
3030
<div className="h-12 w-12 rounded-full bg-red-200 dark:bg-red-800 flex items-center justify-center">
31-
<span className="text-lg font-medium text-red-600 dark:text-red-400">
32-
!
33-
</span>
31+
<span className="text-lg font-medium text-red-600 dark:text-red-400">!</span>
3432
</div>
3533
<div>
3634
<p className="font-medium dark:text-white">Artist Creation Failed</p>

hooks/useChatTransport.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { usePrivy } from "@privy-io/react-auth";
66
export function useChatTransport() {
77
const { getAccessToken } = usePrivy();
88
const baseUrl = getClientApiBaseUrl();
9+
910
const getHeaders = useCallback(async () => {
1011
const accessToken = await getAccessToken();
1112
return accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined;

providers/VercelChatProvider.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,24 @@ interface VercelChatContextType {
3434
attachments: FileUIPart[];
3535
pendingAttachments: FileUIPart[];
3636
setAttachments: (
37-
attachments: FileUIPart[] | ((prev: FileUIPart[]) => FileUIPart[]),
37+
attachments: FileUIPart[] | ((prev: FileUIPart[]) => FileUIPart[])
3838
) => void;
3939
removeAttachment: (index: number) => void;
4040
clearAttachments: () => void;
4141
hasPendingUploads: boolean;
4242
textAttachments: TextAttachment[];
4343
setTextAttachments: (
44-
attachments:
45-
| TextAttachment[]
46-
| ((prev: TextAttachment[]) => TextAttachment[]),
44+
attachments: TextAttachment[] | ((prev: TextAttachment[]) => TextAttachment[])
4745
) => void;
48-
addTextAttachment: (
49-
file: File,
50-
type: TextAttachment["type"],
51-
) => Promise<void>;
46+
addTextAttachment: (file: File, type: TextAttachment["type"]) => Promise<void>;
5247
removeTextAttachment: (index: number) => void;
5348
model: string;
5449
setModel: (model: string) => void;
5550
}
5651

5752
// Create the context
5853
const VercelChatContext = createContext<VercelChatContextType | undefined>(
59-
undefined,
54+
undefined
6055
);
6156

6257
// Props for the provider component
@@ -130,7 +125,7 @@ export function VercelChatProvider({
130125

131126
// When a message is sent successfully, clear the attachments
132127
const handleSendMessageWithClear = async (
133-
event: React.FormEvent<HTMLFormElement>,
128+
event: React.FormEvent<HTMLFormElement>
134129
) => {
135130
await handleSendMessage(event);
136131

@@ -190,7 +185,7 @@ export function useVercelChatContext() {
190185

191186
if (context === undefined) {
192187
throw new Error(
193-
"useVercelChatContext must be used within a VercelChatProvider",
188+
"useVercelChatContext must be used within a VercelChatProvider"
194189
);
195190
}
196191

0 commit comments

Comments
 (0)