Rooni commited on
Commit
5ef393e
·
verified ·
1 Parent(s): 8f4ee3c

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +9 -9
server.js CHANGED
@@ -7,7 +7,7 @@ const app = express();
7
  //app.use(express.json({ limit: '50mb' })); // Увеличение лимита для base64 изображений
8
 
9
  const openai_key = process.env.OPENAI_KEY;
10
- const base_url = "https://rooni-gemini-reverse-proxy.hf.space/v1beta/models/gemini-1.5-pro-latest:streamGenerateContent?alt=sse"; //https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:streamGenerateContent?alt=sse
11
 
12
  const limiter = rateLimit({
13
  windowMs: 40 * 1000, // 40 секунд
@@ -46,10 +46,10 @@ app.post('/gen', async (req, res) => {
46
  payload = {
47
  "generationConfig": {"temperature": 0.8, "topP": 1},
48
  "safetySettings": [
49
- {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_NONE"},
50
- {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_NONE"},
51
- {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_NONE"},
52
- {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_NONE"}
53
  ],
54
  "contents": [
55
  {"parts": [{"text": start}], "role": "user"},
@@ -61,10 +61,10 @@ app.post('/gen', async (req, res) => {
61
  payload = {
62
  "generationConfig": {"temperature": 0.8, "topP": 1},
63
  "safetySettings": [
64
- {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_NONE"},
65
- {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_NONE"},
66
- {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_NONE"},
67
- {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_NONE"}
68
  ],
69
  "contents": [
70
  {"parts": [{"text": start}], "role": "user"},
 
7
  //app.use(express.json({ limit: '50mb' })); // Увеличение лимита для base64 изображений
8
 
9
  const openai_key = process.env.OPENAI_KEY;
10
+ const base_url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-002:streamGenerateContent?alt=sse"; //https://rooni-gemini-reverse-proxy.hf.space/v1beta/models/gemini-1.5-pro-002:streamGenerateContent?alt=sse
11
 
12
  const limiter = rateLimit({
13
  windowMs: 40 * 1000, // 40 секунд
 
46
  payload = {
47
  "generationConfig": {"temperature": 0.8, "topP": 1},
48
  "safetySettings": [
49
+ {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_SOME"},
50
+ {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_MOST"},
51
+ {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_MOST"},
52
+ {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_MOST"}
53
  ],
54
  "contents": [
55
  {"parts": [{"text": start}], "role": "user"},
 
61
  payload = {
62
  "generationConfig": {"temperature": 0.8, "topP": 1},
63
  "safetySettings": [
64
+ {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_SOME"},
65
+ {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_MOST"},
66
+ {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_MOST"},
67
+ {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_MOST"}
68
  ],
69
  "contents": [
70
  {"parts": [{"text": start}], "role": "user"},