mirror of
https://github.com/ArthurDanjou/artapi.git
synced 2026-01-14 19:19:27 +01:00
feat: modifier le type des collections de compétences et de contacts, ajouter une nouvelle fonctionnalité pour récupérer les usages par catégorie
This commit is contained in:
@@ -34,7 +34,7 @@ export default defineContentConfig({
|
||||
})
|
||||
}),
|
||||
skills: defineCollection({
|
||||
type: 'data',
|
||||
type: 'page',
|
||||
source: 'skills.json',
|
||||
schema: z.object({
|
||||
description: z.string(),
|
||||
@@ -74,7 +74,7 @@ export default defineContentConfig({
|
||||
})
|
||||
}),
|
||||
contact: defineCollection({
|
||||
type: 'data',
|
||||
type: 'page',
|
||||
source: 'contact.json',
|
||||
schema: z.object({
|
||||
body: z.array(z.object({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Balance and Drive: Beyond the Data
|
||||
title: "Balance and Drive: Beyond the Data"
|
||||
description: Exploring my passions outside of data science and machine learning engineering that fuel my creativity and performance.
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"description": "As a software engineer and mathematics student, I combine scientific rigor with technical pragmatism to design solutions tailored to the challenges of data and mathematical projects. My approach focuses on a deep understanding of needs, from data preparation to deployment, while emphasizing modeling and performance optimization.Passionate about artificial intelligence and data science, I strive to balance innovation with statistical robustness. Always eager to learn, I explore both technological advancements and entrepreneurial or financial challenges. Curious and enthusiastic, I enjoy sharing knowledge and discovering new concepts, whether in theorems or emerging technologies.",
|
||||
"body": [
|
||||
{
|
||||
"id": "Programming",
|
||||
"id": "programming",
|
||||
"name": "Programming",
|
||||
"items": [
|
||||
{
|
||||
|
||||
18
server/api/uses_by_category.get.ts
Normal file
18
server/api/uses_by_category.get.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { queryCollection } from '@nuxt/content/server'
|
||||
import { z } from 'zod'
|
||||
|
||||
const querySchema = z.object({
|
||||
categoryName: z.enum(['homelab', 'ide', 'hardware', 'software'])
|
||||
})
|
||||
|
||||
export default defineCachedEventHandler(async (event) => {
|
||||
const { categoryName } = await getValidatedQuery(event, querySchema.parse)
|
||||
|
||||
return await queryCollection(event, 'uses')
|
||||
.where('extension', '=', 'md')
|
||||
.where('category', '=', categoryName)
|
||||
.all()
|
||||
}, {
|
||||
name: 'uses-list',
|
||||
maxAge: 3600 // 1 hour
|
||||
})
|
||||
@@ -187,7 +187,7 @@ function createServer() {
|
||||
title: 'Get Resume Link',
|
||||
description: 'Provide a link to download Arthur Danjou\'s resume in the requested language.',
|
||||
inputSchema: {
|
||||
// @ts-expect-error zod inference issue
|
||||
// @ts-expect-error - need to wait for support for zod 4
|
||||
lang: z.enum(['en', 'fr']).describe('The language for the resume, \'en\' or \'fr\'.')
|
||||
}
|
||||
},
|
||||
@@ -200,14 +200,33 @@ function createServer() {
|
||||
}
|
||||
)
|
||||
|
||||
// Prompts : toutes les commandes de artchat
|
||||
server.registerTool(
|
||||
'get_uses_by_category',
|
||||
{
|
||||
title: 'Get Uses by Category',
|
||||
description: 'Retrieves uses Arthur Danjou uses filtered by a specific category.',
|
||||
inputSchema: {
|
||||
// @ts-expect-error - need to wait for support for zod 4
|
||||
categoryName: z.enum(['homelab', 'ide', 'hardware', 'software']).describe('The name of the category to filter uses by.')
|
||||
}
|
||||
},
|
||||
async (params: { categoryName: 'homelab' | 'ide' | 'hardware' | 'software' }) => {
|
||||
const result = await $fetch<unknown>('/api/uses_by_category', { query: params })
|
||||
return {
|
||||
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
||||
structuredContent: result as unknown
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// Prompts
|
||||
server.registerPrompt(
|
||||
'artmcp-resume',
|
||||
{
|
||||
title: 'Get Resume of Arthur Danjou',
|
||||
description: 'Get Resume in French or English format of Arthur Danjou',
|
||||
argsSchema: {
|
||||
// @ts-expect-error zod inference issue
|
||||
// @ts-expect-error - need to wait for support for zod 4
|
||||
lang: z.enum(['en', 'fr']).describe('The language for the resume, \'en\' or \'fr\'.')
|
||||
}
|
||||
},
|
||||
@@ -338,6 +357,31 @@ function createServer() {
|
||||
}
|
||||
)
|
||||
|
||||
server.registerPrompt(
|
||||
'get_uses_by_category',
|
||||
{
|
||||
title: 'Get Uses by Category',
|
||||
description: 'Retrieves uses Arthur Danjou uses filtered by a specific category.',
|
||||
argsSchema: {
|
||||
// @ts-expect-error - need to wait for support for zod 4
|
||||
categoryName: z.enum(['homelab', 'ide', 'hardware', 'software']).describe('Type of project (dashboard, landing page, admin panel, etc.)')
|
||||
}
|
||||
},
|
||||
async ({ categoryName }) => {
|
||||
return {
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
content: {
|
||||
type: 'text',
|
||||
text: `How can I view the setup of Arthur for this category : ${categoryName}?`
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
return server
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user