mirror of
https://github.com/ArthurDanjou/artchat.git
synced 2026-01-14 13:54:01 +01:00
feat: add new articles on AI agents and machine learning
- Created a new article on "Understanding AI Agents, LLMs, and RAG" detailing the synergy between AI agents, LLMs, and Retrieval-Augmented Generation. - Added an introductory article on "What is Machine Learning?" covering types, model selection, workflow, and evaluation metrics. chore: setup ESLint and Nuxt configuration - Added ESLint configuration for code quality. - Initialized Nuxt configuration with various modules and settings for the application. chore: initialize package.json and TypeScript configuration - Created package.json for dependency management and scripts. - Added TypeScript configuration for the project. feat: implement API endpoints for activity and stats - Developed API endpoint to fetch user activity from Lanyard. - Created a stats endpoint to retrieve Wakatime coding statistics with caching. feat: add various assets and images - Included multiple images and assets for articles and projects. - Added placeholder files to maintain directory structure. refactor: define types for chat, lanyard, time, and wakatime - Created TypeScript types for chat messages, Lanyard activities, time formatting, and Wakatime statistics.
This commit is contained in:
26
types/chat.ts
Normal file
26
types/chat.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
export enum ChatType {
|
||||
WEATHER = 'weather',
|
||||
LOCATION = 'location',
|
||||
THEME = 'theme',
|
||||
LANGUAGE = 'language',
|
||||
ABOUT = 'about',
|
||||
PROJECTS = 'projects',
|
||||
WRITINGS = 'writings',
|
||||
EXPERIENCES = 'experiences',
|
||||
SKILLS = 'skills',
|
||||
HOBBIES = 'hobbies',
|
||||
STACK = 'stack',
|
||||
STATUS = 'status',
|
||||
CREDITS = 'credits',
|
||||
CONTACT = 'contact',
|
||||
STATS = 'stats',
|
||||
ACTIVITY = 'activity',
|
||||
RESUME = 'resume',
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id: number
|
||||
content: string
|
||||
sender: string
|
||||
type: ChatType
|
||||
}
|
||||
34
types/index.ts
Normal file
34
types/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
export * from './chat'
|
||||
export * from './lanyard'
|
||||
export * from './time'
|
||||
export * from './wakatime'
|
||||
|
||||
export const IDEs = [
|
||||
{ name: 'Visual Studio Code', icon: 'i-logos:visual-studio-code' },
|
||||
{ name: 'IntelliJ IDEA Ultimate', icon: 'i-logos:intellij-idea' },
|
||||
{ name: 'WebStorm', icon: 'i-logos:webstorm' },
|
||||
{ name: 'PyCharm Professional', icon: 'i-logos:pycharm' },
|
||||
{ name: 'Cursor', icon: 'i-vscode-icons-file-type-cursorrules' },
|
||||
] as const
|
||||
|
||||
export interface Tag {
|
||||
label: string
|
||||
title?: string
|
||||
translation: string
|
||||
}
|
||||
|
||||
export const TAGS: readonly Tag[] = [
|
||||
{ label: 'R', translation: 'tags.r' },
|
||||
{ label: 'AI', translation: 'tags.ai' },
|
||||
{ label: 'Data', translation: 'tags.data' },
|
||||
{ label: 'Web', translation: 'tags.web' },
|
||||
{ label: 'Python', translation: 'tags.python' },
|
||||
{ label: 'Maths', translation: 'tags.maths' },
|
||||
] as const
|
||||
|
||||
export const socials = [
|
||||
{ icon: 'i-ph:x-logo-duotone', label: 'Twitter', to: 'https://twitter.com/ArthurDanj' },
|
||||
{ icon: 'i-ph:github-logo-duotone', label: 'GitHub', to: 'https://github.com/ArthurDanjou' },
|
||||
{ icon: 'i-ph:linkedin-logo-duotone', label: 'LinkedIn', to: 'https://www.linkedin.com/in/arthurdanjou/' },
|
||||
{ icon: 'i-ph:discord-logo-duotone', label: 'Discord', to: 'https://discordapp.com/users/179635349100691456' },
|
||||
] as const
|
||||
17
types/lanyard.ts
Normal file
17
types/lanyard.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
interface LanyardActivity {
|
||||
name: string
|
||||
state: string
|
||||
details: string
|
||||
timestamps: {
|
||||
start: number
|
||||
}
|
||||
assets?: {
|
||||
small_text: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface Activity {
|
||||
data: {
|
||||
activities: LanyardActivity[]
|
||||
}
|
||||
}
|
||||
71
types/time.ts
Normal file
71
types/time.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
type TimeUnit = (n: number, past?: boolean) => string
|
||||
type TimeFormatter = (n: string) => string
|
||||
|
||||
interface ActivityMessages {
|
||||
justNow: string
|
||||
past: TimeFormatter
|
||||
future: TimeFormatter
|
||||
month: TimeUnit
|
||||
year: TimeUnit
|
||||
day: TimeUnit
|
||||
week: TimeUnit
|
||||
hour: TimeUnit
|
||||
minute: TimeUnit
|
||||
second: TimeUnit
|
||||
invalid: string
|
||||
}
|
||||
|
||||
function createTimeUnit(singular: string, plural: string, pastSingular?: string, futureSingular?: string): TimeUnit {
|
||||
return (n: number, past = true) => {
|
||||
if (n === 1) {
|
||||
return past ? (pastSingular || `last ${singular}`) : (futureSingular || `next ${singular}`)
|
||||
}
|
||||
return `${n} ${plural}`
|
||||
}
|
||||
}
|
||||
|
||||
function createSimpleTimeUnit(unit: string): TimeUnit {
|
||||
return (n: number) => `${n} ${unit}${n > 1 ? 's' : ''}`
|
||||
}
|
||||
|
||||
export const activityMessages: Record<'en' | 'fr' | 'es', ActivityMessages> = {
|
||||
en: {
|
||||
justNow: 'just now',
|
||||
past: (n: string) => n.match(/\d/) ? `${n} ago` : n,
|
||||
future: (n: string) => n.match(/\d/) ? `in ${n}` : n,
|
||||
month: createTimeUnit('month', 'months'),
|
||||
year: createTimeUnit('year', 'years'),
|
||||
day: createTimeUnit('day', 'days', 'yesterday', 'tomorrow'),
|
||||
week: createTimeUnit('week', 'weeks'),
|
||||
hour: createSimpleTimeUnit('hour'),
|
||||
minute: createSimpleTimeUnit('minute'),
|
||||
second: createSimpleTimeUnit('second'),
|
||||
invalid: '',
|
||||
},
|
||||
fr: {
|
||||
justNow: 'à l\'instant',
|
||||
past: (n: string) => n.match(/\d/) ? `il y a ${n}` : n,
|
||||
future: (n: string) => n.match(/\d/) ? `dans ${n}` : n,
|
||||
month: (n: number, past = true) => n === 1 ? (past ? 'le mois dernier' : 'le mois prochain') : `${n} mois`,
|
||||
year: (n: number, past = true) => n === 1 ? (past ? 'l\'année dernière' : 'l\'année prochaine') : `${n} ans`,
|
||||
day: (n: number, past = true) => n === 1 ? (past ? 'hier' : 'demain') : `${n} jours`,
|
||||
week: (n: number, past = true) => n === 1 ? (past ? 'la semaine dernière' : 'la semaine prochaine') : `${n} semaines`,
|
||||
hour: createSimpleTimeUnit('heure'),
|
||||
minute: createSimpleTimeUnit('minute'),
|
||||
second: createSimpleTimeUnit('seconde'),
|
||||
invalid: '',
|
||||
},
|
||||
es: {
|
||||
justNow: 'justo ahora',
|
||||
past: (n: string) => n.match(/\d/) ? `hace ${n}` : n,
|
||||
future: (n: string) => n.match(/\d/) ? `dentro de ${n}` : n,
|
||||
month: (n: number, past = true) => n === 1 ? (past ? 'el mes pasado' : 'el próximo mes') : `${n} meses`,
|
||||
year: (n: number, past = true) => n === 1 ? (past ? 'el año pasado' : 'el próximo año') : `${n} años`,
|
||||
day: (n: number, past = true) => n === 1 ? (past ? 'ayer' : 'mañana') : `${n} días`,
|
||||
week: (n: number, past = true) => n === 1 ? (past ? 'la semana pasada' : 'la próxima semana') : `${n} semanas`,
|
||||
hour: createSimpleTimeUnit('hora'),
|
||||
minute: createSimpleTimeUnit('minuto'),
|
||||
second: createSimpleTimeUnit('segundo'),
|
||||
invalid: '',
|
||||
},
|
||||
}
|
||||
26
types/wakatime.ts
Normal file
26
types/wakatime.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
interface WakatimeData {
|
||||
name: string
|
||||
percent: number
|
||||
}
|
||||
|
||||
export interface Stats {
|
||||
coding: {
|
||||
data: {
|
||||
grand_total: {
|
||||
total_seconds_including_other_language: number
|
||||
}
|
||||
range: {
|
||||
start: string
|
||||
}
|
||||
}
|
||||
}
|
||||
editors: {
|
||||
data: WakatimeData[]
|
||||
}
|
||||
os: {
|
||||
data: WakatimeData[]
|
||||
}
|
||||
languages: {
|
||||
data: WakatimeData[]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user