| 1234567891011121314151617181920212223242526272829303132333435363738 |
- const config = require('../config');
- const PATH = 'chat/completions';
- const TIMEOUT_MS = 120000;
- // 普通 AI 请求参数
- function getBody(prompt, imageUrl) {
- return {
- model: config.MODEL_NAME || 'gpt-4o',
- messages: [{
- role: 'user',
- content: [
- { type: 'text', text: prompt },
- { type: 'image_url', image_url: { url: imageUrl, detail: 'high' } }
- ]
- }],
- max_tokens: 300,
- stream: false
- };
- }
- // 豆包请求参数
- function getDoubaoBody(prompt, imageUrl) {
- return {
- model: config.DOUBAO_MODEL,
- messages: [{
- role: 'user',
- content: [
- { type: 'text', text: prompt },
- { type: 'image_url', image_url: { url: imageUrl, detail: 'high' } }
- ]
- }],
- max_tokens: 300,
- stream: false
- };
- }
- module.exports = { path: PATH, getBody, getDoubaoBody, timeoutMs: TIMEOUT_MS };
|