This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// author: 叙白 | |
// date: 2024-10-09 | |
// name: DeepSeek.js | |
// 注意:请在脚本中的变量功能中添加 deepseek_key 变量,值为 DeepSeek 的 API Key | |
// 如果您使用转发平台的 API ,则值为转发平台的 API Key, 并且修改BASE_URL | |
// 此脚本仅兼容openai格式(openai, deepseek, kimi以及更多兼容openai格式的都可使用,温度需要根据各家ai自行调整) | |
// 依次为base_url, 默认模型,默认温度,不懂请勿修改 | |
const BASE_URL = "https://api.deepseek.com/v1/chat/completions"; | |
const DEFAULT_MODEL = "deepseek-chat"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 检查响应状态码是否是 302 | |
if ($response.status === 302) { | |
// 获取 Location 重定向的 URL | |
let locationUrl = $response.headers['Location']; | |
locationUrl =decodeURIComponent(escape(locationUrl)); | |
const jsonResult = {"url": locationUrl}; | |
$done({ |