diff --git a/package.json b/package.json index 674c52be..1e9ebca4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.5.5", + "version": "1.5.6", "main": "index.ts", "license": "BUSL-1.1", "scripts": { diff --git a/src/integrations/vercel-ai/index.ts b/src/integrations/vercel-ai/index.ts index b063b4c4..c9382eb0 100644 --- a/src/integrations/vercel-ai/index.ts +++ b/src/integrations/vercel-ai/index.ts @@ -1,6 +1,5 @@ import { EventAddons, EventData } from '@hawk.so/types'; import { generateText } from 'ai'; -import { openai } from '@ai-sdk/openai'; import { eventSolvingInput } from './inputs/eventSolving'; import { ctoInstruction } from './instructions/cto'; @@ -17,7 +16,7 @@ class VercelAIApi { /** * @todo make it dynamic, get from project settings */ - this.modelId = 'deepseek/deepseek-v3.1'; + this.modelId = 'deepseek/deepseek-v4-flash'; } /** @@ -32,6 +31,11 @@ class VercelAIApi { model: this.modelId, system: ctoInstruction, prompt: eventSolvingInput(payload), + providerOptions: { + gateway: { + order: ['novita', 'azure', 'deepseek'], + }, + }, }); return text; diff --git a/src/integrations/vercel-ai/instructions/cto.ts b/src/integrations/vercel-ai/instructions/cto.ts index 9d267044..111a1588 100644 --- a/src/integrations/vercel-ai/instructions/cto.ts +++ b/src/integrations/vercel-ai/instructions/cto.ts @@ -1,9 +1,24 @@ export const ctoInstruction = `Ты технический директор ИТ компании, тебе нужно пояснить ошибку и предложить решение. -Предоставь ответ в следующем формате: +Предоставь ответ **строго** в следующем формате на русском языке: -1. Описание проблемы -2. Решение проблемы -3. Описание того, как можно предотвратить подобную ошибку в будущем +[Краткое summary] -Ответь на русском языке.`; +## Описание проблемы +[Подробный, но лаконичный анализ сути проблемы] + +## Решение +[Конкретные шаги по исправлению + рекомендуемый лучший вариант] + +## Как избежать повторения +[Как предотвратить повторение подобной ошибки в будущем: процессы, инструменты, архитектурные решения, code review и т.д.] + +**Formatting instructions:** +- Output only valid Markdown. +- Use consistent indentation for all nested lists. +- Never use tabs instead of spaces. +- Use links if necessary. +- Never use numbering in headings. +- Prefer sections with nested headings to avoid deeply-nested lists. +- Never nest inline code-blocks inside headings. +- Never nest multiline code-blocks inside lists.`; diff --git a/src/types/vercel-ai.d.ts b/src/types/vercel-ai.d.ts deleted file mode 100644 index 33d02c19..00000000 --- a/src/types/vercel-ai.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare module 'ai' { - /** - * Minimal type for generateText used in server-side integration. - */ - export function generateText(input: { - model: any; - system?: string; - prompt: string; - }): Promise<{ text: string }>; -} - -declare module '@ai-sdk/openai' { - /** - * Minimal types for OpenAI provider. - */ - export function createOpenAI(config?: { apiKey?: string }): (model: string) => any; - export const openai: (model: string) => any; -}