mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-24 20:52:08 +01:00
feat: integrate new AI tools and enhance API functionality
- 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.
This commit is contained in:
25
shared/utils/tools/read-resources.ts
Normal file
25
shared/utils/tools/read-resources.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { UIToolInvocation } from 'ai'
|
||||
import { tool } from 'ai'
|
||||
import { z } from 'zod'
|
||||
|
||||
export type resourceUIToolInvocation = UIToolInvocation<typeof resourceTool>
|
||||
|
||||
export const resourceTool = tool({
|
||||
description: 'Read a resource from the server API',
|
||||
inputSchema: z.object({
|
||||
resource: z.enum([
|
||||
'contact',
|
||||
'education',
|
||||
'experiences',
|
||||
'hobbies',
|
||||
'languages',
|
||||
'profile',
|
||||
'projects',
|
||||
'skills',
|
||||
'uses'
|
||||
]).describe('resource name')
|
||||
}),
|
||||
execute: async ({ resource }) => {
|
||||
return await $fetch(`/api/${resource}`)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user