fruitpicker01 commited on
Commit
bb6689f
·
verified ·
1 Parent(s): 0a0069b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -14
app.py CHANGED
@@ -78,20 +78,7 @@ def generate_standard_prompt(description, advantages, *selected_values):
78
  # Функции для генерации сообщений
79
  def generate_message_gpt4o(prompt, temperature):
80
  try:
81
- headers = {
82
- "Content-Type": "application/json",
83
- "Authorization": f"Bearer {openai_api_key}"
84
- }
85
- data = {
86
- "model": "chatgpt-4o-latest",
87
- "messages": [{"role": "system", "content": prompt}],
88
- "max_tokens": 101, # Значение max_tokens можно зафиксировать, если не нужно передавать его
89
- "temperature": temperature # Используем переданное значение температуры
90
- }
91
- response = requests.post("https://api.openai.com/v1/chat/completions", json=data, headers=headers)
92
- response_data = response.json()
93
- message = response_data["choices"][0]["message"]["content"].strip()
94
- return clean_message(message)
95
  except Exception as e:
96
  return f"Ошибка при обращении к ChatGPT-4o-Latest: {e}"
97
 
 
78
  # Функции для генерации сообщений
79
  def generate_message_gpt4o(prompt, temperature):
80
  try:
81
+ print(temperature)
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  except Exception as e:
83
  return f"Ошибка при обращении к ChatGPT-4o-Latest: {e}"
84