add support ai-agent

This commit is contained in:
Max
2025-06-12 20:58:54 +03:00
parent 7ecb73ac6e
commit ec6b30e220
7 changed files with 2611 additions and 116 deletions

View File

@@ -0,0 +1,18 @@
import { Agent } from 'node:https';
import { GigaChat } from 'langchain-gigachat';
const httpsAgent = new Agent({
rejectUnauthorized: false,
});
// Получаем GIGA_AUTH из переменной окружения (устанавливается в get-constants.js)
export const gigachat = new GigaChat({
model: 'GigaChat-2',
temperature: 0.7,
scope: 'GIGACHAT_API_PERS',
streaming: false,
credentials: process.env.GIGA_AUTH,
httpsAgent
});
export default gigachat;