PSNbst commited on
Commit
74ca486
·
verified ·
1 Parent(s): b37a493

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -66,10 +66,8 @@ def generate_natural_language_description(tags, api_key=None):
66
  ],
67
  model="gpt-4o",
68
  )
69
- # 调试输出 response 对象
70
- print("Response object:", response)
71
- # 通过属性访问 response 内容
72
- return response.choices[0].message["content"].strip()
73
  except Exception as e:
74
  return f"GPT generation failed. Error: {e}"
75
 
 
66
  ],
67
  model="gpt-4o",
68
  )
69
+ generated_content = response.choices[0].message.content.strip()
70
+ return generated_content
 
 
71
  except Exception as e:
72
  return f"GPT generation failed. Error: {e}"
73