feat(backend): настраиваемая LLM для конвертации PDF в JSON

- Добавлена переменная LLM_MODEL в конфиг
- Увеличен max_tokens до 32768 для крупных выписок
- Включен response_format: json_object
- Добавлен скрипт test:llm для проверки подключения к LLM-серверу
This commit is contained in:
vakabunga
2026-03-13 23:12:52 +03:00
parent 0638885812
commit b598216d24
6 changed files with 52 additions and 11 deletions

View File

@@ -105,12 +105,14 @@ export async function convertPdfToStatement(
try {
const completion = await openai.chat.completions.create({
model: 'gpt-4o-mini',
model: config.llmModel,
messages: [
{ role: 'system', content: PDF2JSON_PROMPT },
{ role: 'user', content: `Текст выписки:\n\n${text}` },
],
temperature: 0,
max_tokens: 32768,
response_format: { type: 'json_object' },
});
const content = completion.choices[0]?.message?.content?.trim();