mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 15:54:13 +01:00
- Added '@nuxtjs/mdc' module to nuxt.config.ts for improved UI components. - Configured MDC settings to disable anchor links for headings. - Updated API proxy settings to include '/api/uses' and a general '/api/' endpoint. - Introduced new dependencies for AI SDKs and tools in package.json. - Created a new chat API endpoint to handle AI interactions with various tools. - Implemented utility functions for activity tracking, resource reading, resume retrieval, statistics, status monitoring, and categorized tool usage. - Updated social links in types/index.ts to redirect through a custom domain. - Updated worker configuration to include AI binding for Cloudflare.
18 lines
847 B
TypeScript
18 lines
847 B
TypeScript
import type { UIToolInvocation } from 'ai'
|
|
import { tool } from 'ai'
|
|
import { z } from 'zod'
|
|
|
|
export type UsesByCategoryUIToolInvocation = UIToolInvocation<typeof usesByCategoryTool>
|
|
|
|
export const usesByCategoryTool = tool({
|
|
description: 'Retrieves a filtered list of tools, software, and hardware used by Arthur Danjou based on a specific category. Available categories: homelab, IDE, hardware, and software.',
|
|
inputSchema: z.object({
|
|
categoryName: z.enum(['homelab', 'ide', 'hardware', 'software']).describe('The category to filter by: \'homelab\', \'ide\', \'hardware\', or \'software\'.')
|
|
}),
|
|
execute: async ({ categoryName }: { categoryName: 'homelab' | 'ide' | 'hardware' | 'software' }) => {
|
|
const uses = await $fetch<{ category: string }[]>('/api/uses')
|
|
|
|
return uses.filter(use => use.category === categoryName)
|
|
}
|
|
})
|