code refactoring and agent improvement

This commit is contained in:
DenAntonov
2025-06-14 23:35:48 +03:00
parent bd0b11dc4a
commit 5665c4bf1e
9 changed files with 111 additions and 487 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 = (GIGA_AUTH) => new
GigaChat({
model: 'GigaChat-2',
scope: 'GIGACHAT_API_PERS',
streaming: false,
credentials: GIGA_AUTH,
httpsAgent
});
export default gigachat;