Skip to content

An AI-powered search engine with a generative UI

cleanup: remove unused video search artifact component and references

Yoshiki Miurae540ed0d28d9
diff --git a/components/artifact/artifact-content.tsx b/components/artifact/artifact-content.tsx
index af2203b0..13a8a8bb 100644
--- a/components/artifact/artifact-content.tsx
+++ b/components/artifact/artifact-content.tsx
@@ -11,7 +11,6 @@ export function ArtifactContent({ part }: { part: Part | null }) {
switch (part.type) {
case 'tool-search':
case 'tool-fetch':
- case 'tool-videoSearch':
case 'tool-askQuestion':
return <ToolInvocationContent part={part} />
case 'reasoning':
diff --git a/components/artifact/tool-invocation-content.tsx b/components/artifact/tool-invocation-content.tsx
index 9c1eaa5d..27cd045d 100644
--- a/components/artifact/tool-invocation-content.tsx
+++ b/components/artifact/tool-invocation-content.tsx
@@ -3,16 +3,11 @@
import type { ToolPart } from '@/lib/types/ai'
import { SearchArtifactContent } from '@/components/artifact/search-artifact-content'
-import { VideoSearchArtifactContent } from '@/components/artifact/video-search-artifact-content'
export function ToolInvocationContent({ part }: { part: ToolPart }) {
switch (part.type) {
case 'tool-search':
return <SearchArtifactContent tool={part as ToolPart<'search'>} />
- case 'tool-videoSearch':
- return (
- <VideoSearchArtifactContent tool={part as ToolPart<'videoSearch'>} />
- )
default:
return <div className="p-4">Details for this tool are not available</div>
}
diff --git a/components/artifact/video-search-artifact-content.tsx b/components/artifact/video-search-artifact-content.tsx
deleted file mode 100644
index ba492133..00000000
--- a/components/artifact/video-search-artifact-content.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-'use client'
-
-import {
- type SerperSearchResultItem,
- type SerperSearchResults
-} from '@/lib/types'
-import type { ToolPart } from '@/lib/types/ai'
-
-import { ToolArgsSection } from '@/components/section'
-import { VideoResultGrid } from '@/components/video-result-grid'
-
-export function VideoSearchArtifactContent({
- tool
-}: {
- tool: ToolPart<'videoSearch'>
-}) {
- const videoResults: SerperSearchResults | undefined =
- tool.state === 'output-available' ? tool.output : undefined
- const query = tool.input?.query
-
- const videos = (videoResults?.videos || []).filter(
- (video: SerperSearchResultItem) => {
- try {
- return new URL(video.link).pathname === '/watch'
- } catch (e) {
- console.error('Invalid video URL:', video.link)
- return false
- }
- }
- )
-
- if (videos.length === 0) {
- return (
- <div className="p-4 space-y-4">
- <ToolArgsSection tool="videoSearch">{query}</ToolArgsSection>
- <p className="text-muted-foreground">No video results</p>
- </div>
- )
- }
-
- return (
- <div className="space-y-4 p-4">
- <ToolArgsSection tool="videoSearch">{query}</ToolArgsSection>
- <VideoResultGrid
- videos={videos}
- query={query || ''}
- displayMode="artifact"
- />
- </div>
- )
-}
diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx
index d25d454d..4829b5fe 100644
--- a/components/chat-panel.tsx
+++ b/components/chat-panel.tsx
@@ -96,7 +96,6 @@ export function ChatPanel({
return (
(lastPart?.type === 'tool-search' ||
lastPart?.type === 'tool-fetch' ||
- lastPart?.type === 'tool-videoSearch' ||
lastPart?.type === 'tool-askQuestion') &&
((lastPart as any)?.state === 'input-streaming' ||
(lastPart as any)?.state === 'input-available')
diff --git a/components/inspector/inspector-drawer.tsx b/components/inspector/inspector-drawer.tsx
index a304dc0a..e906510b 100644
--- a/components/inspector/inspector-drawer.tsx
+++ b/components/inspector/inspector-drawer.tsx
@@ -23,8 +23,6 @@ export function InspectorDrawer() {
return 'search'
case 'tool-fetch':
return 'fetch'
- case 'tool-videoSearch':
- return 'videoSearch'
case 'tool-askQuestion':
return 'askQuestion'
case 'reasoning':
diff --git a/components/inspector/inspector-panel.tsx b/components/inspector/inspector-panel.tsx
index 155de137..f5c94670 100644
--- a/components/inspector/inspector-panel.tsx
+++ b/components/inspector/inspector-panel.tsx
@@ -25,7 +25,6 @@ export function InspectorPanel() {
switch (part.type) {
case 'tool-search':
case 'tool-fetch':
- case 'tool-videoSearch':
case 'tool-askQuestion':
const toolName = part.type.replace('tool-', '')
return {
diff --git a/components/render-message.tsx b/components/render-message.tsx
index 506aee2e..1bb4d84b 100644
--- a/components/render-message.tsx
+++ b/components/render-message.tsx
@@ -77,7 +77,6 @@ export function RenderMessage({
switch (part.type) {
case 'tool-search':
case 'tool-fetch':
- case 'tool-videoSearch':
case 'tool-askQuestion':
case 'tool-relatedQuestions':
return (
diff --git a/components/tool-badge.tsx b/components/tool-badge.tsx
index 6557d524..dafb447a 100644
--- a/components/tool-badge.tsx
+++ b/components/tool-badge.tsx
@@ -1,6 +1,6 @@
import React from 'react'
-import { Film, Link, Search } from 'lucide-react'
+import { Link, Search } from 'lucide-react'
import { Badge } from './ui/badge'
@@ -17,8 +17,7 @@ export const ToolBadge: React.FC<ToolBadgeProps> = ({
}) => {
const icon: Record<string, React.ReactNode> = {
search: <Search size={14} />,
- fetch: <Link size={14} />,
- videoSearch: <Film size={14} />
+ fetch: <Link size={14} />
}
return (
diff --git a/lib/utils/message-mapping.ts b/lib/utils/message-mapping.ts
index 18fec7bb..7eeb9abd 100644
--- a/lib/utils/message-mapping.ts
+++ b/lib/utils/message-mapping.ts
@@ -250,7 +250,6 @@ export function mapUIMessagePartsToDBParts(
case 'tool-search':
case 'tool-fetch':
case 'tool-question':
- case 'tool-videoSearch':
case 'tool-relatedQuestions':
// These are tool parts with state tracking
if (!isExtendedToolPart(part)) {
@@ -374,7 +373,6 @@ export function mapDBPartToUIMessagePart(
'search',
'retrieve',
'question',
- 'videoSearch',
'relatedQuestions'
].includes(toolName)
) {
@@ -443,8 +441,6 @@ function getToolNameFromType(toolName: string): string {
retrieve: 'retrieve',
askQuestion: 'question',
question: 'question',
- videoSearch: 'videoSearch',
- 'video-search': 'videoSearch',
relatedQuestions: 'relatedQuestions'
}
@@ -484,7 +480,6 @@ function getOriginalToolName(dbToolName: string): string {
search: 'search',
retrieve: 'retrieve',
question: 'askQuestion',
- videoSearch: 'videoSearch',
dynamic: 'dynamic' // For dynamic tools, the actual tool name is stored separately
}