feat: новая функция

This commit is contained in:
2025-10-08 18:01:14 +03:00
parent 2c53bce32a
commit 725e7fd5a2
60 changed files with 5427 additions and 3921 deletions

View File

@@ -22,7 +22,8 @@ const { requireAuth } = require('../middleware/auth');
router.get('/status', requireAuth, async (req, res) => {
try {
const axios = require('axios');
const ollamaUrl = process.env.OLLAMA_BASE_URL || 'http://ollama:11434';
const ollamaConfig = require('../services/ollamaConfig');
const ollamaUrl = ollamaConfig.getBaseUrl();
// Проверяем API Ollama через HTTP запрос
try {
@@ -54,7 +55,8 @@ router.get('/status', requireAuth, async (req, res) => {
router.get('/models', requireAuth, async (req, res) => {
try {
const axios = require('axios');
const ollamaUrl = process.env.OLLAMA_BASE_URL || 'http://ollama:11434';
const ollamaConfig = require('../services/ollamaConfig');
const ollamaUrl = ollamaConfig.getBaseUrl();
const response = await axios.get(`${ollamaUrl}/api/tags`, {
timeout: 5000