Files

1 line
2.5 KiB
JSON

{"repo": "0ngkur/wizards-brain", "files": {"brain/deepseek.js": {"ab3e69ad78e1a7ebda11749d74de8938e560fa93": {"t": 1785746675.5619428, "n": 1467, "h": "d5a5548750e88d75", "c": "/**\n * deepseek.js — DeepSeek API Handler\n *\n * Sends chat messages to DeepSeek's OpenAI-compatible API.\n * Returns ONLY the model's response text.\n *\n * API Docs: https://platform.deepseek.com/api-docs\n */\n\n'use strict';\n\nconst axios = require('axios');\n\nconst BASE_URL = 'https://api.deepseek.com/v1';\nconst DEFAULT_MODEL = 'deepseek-chat';\n\n/**\n * Send a chat request to DeepSeek.\n *\n * @param {object} options\n * @param {string} options.apiKey - DeepSeek API key\n * @param {string} options.model - Model name (default: deepseek-chat)\n * @param {Array} options.messages - OpenAI-format messages array\n * @returns {Promise<string>} - Model response text\n */\nasync function chat({ apiKey, model = DEFAULT_MODEL, messages }) {\n if (!apiKey) throw new Error('[DeepSeek] API key is required.');\n\n const response = await axios.post(\n `${BASE_URL}/chat/completions`,\n {\n model,\n messages,\n temperature: 0.1, // Low temperature for deterministic code output\n max_tokens: 8192,\n response_format: { type: 'json_object' }, // Force JSON output\n },\n {\n headers: {\n 'Authorization': `Bearer ${apiKey}`,\n 'Content-Type': 'application/json',\n },\n timeout: 120_000, // 2 min timeout\n }\n );\n\n const choice = response.data?.choices?.[0];\n if (!choice) throw new Error('[DeepSeek] No choices returned from API.');\n\n return choice.message?.content ?? '';\n}\n\nmodule.exports = { chat };\n"}}, "config/config.json": {"ab3e69ad78e1a7ebda11749d74de8938e560fa93": {"t": 1785746789.0781243, "n": 651, "h": "ebc3a63723fbe9c3", "c": "{\n \"provider\": \"deepseek\",\n \"model\": {\n \"deepseek\": \"deepseek-chat\",\n \"qwen\": \"qwen-plus\",\n \"kimi\": \"moonshot-v1-8k\"\n },\n \"apiKeys\": {\n \"deepseek\": \"sk-3de873f49f6a4dab8b451a639a19fef4\",\n \"qwen\": \"\",\n \"kimi\": \"\"\n },\n \"agent\": {\n \"previewMode\": true,\n \"maxFileSize\": 100000,\n \"ignoreDirs\": [\"node_modules\", \".git\", \".planning\", \"dist\", \"build\"],\n \"ignoreExts\": [\".jpg\", \".jpeg\", \".png\", \".gif\", \".svg\", \".ico\", \".woff\", \".woff2\", \".ttf\", \".eot\", \".mp4\", \".mp3\", \".zip\"],\n \"maxContextFiles\": 20\n },\n \"safety\": {\n \"requireConfirmation\": true,\n \"validateExactMatch\": true,\n \"backupBeforeEdit\": true\n }\n}\n"}}}}