feat: AI context, Webhooks, Kanban drag-drop, and UI fixes

This commit is contained in:
2026-04-29 17:43:18 +05:00
parent 89b3340253
commit bc2f99408d
29 changed files with 991 additions and 52 deletions
+31
View File
@@ -0,0 +1,31 @@
export const generateAIResponse = async (prompt: string, systemPrompt = 'You are a helpful assistant.') => {
const config = useRuntimeConfig()
const apiKey = config.deepseekApiKey || process.env.DEEPSEEK_API_KEY
if (!apiKey) {
throw new Error('DEEPSEEK_API_KEY is not configured')
}
try {
const response = await $fetch('https://api.deepseek.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: {
model: 'deepseek-chat',
messages: [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: prompt }
],
stream: false
}
}) as any
return response.choices[0].message.content
} catch (error: any) {
console.error('DeepSeek AI error:', error.data || error.message)
throw new Error(`AI generation failed: ${error.message}`)
}
}