Files
multy-stub/server/routers/kfu-m-24-1/sber_mobile/support-ai-agent/gigachat.ts
Дмитриев Максим Сергеевич f37f34d803 fix getting giga token
2025-06-14 18:26:13 +03:00

20 lines
588 B
TypeScript

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