jinzhou commited on
Commit
154c33a
·
1 Parent(s): 09fd80d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -44,6 +44,8 @@ class Conversation:
44
 
45
  def askWithProxy(self, question):
46
  print("start askWithProxy")
 
 
47
  headers = {
48
  'Authorization': f'Bearer {OPENAI_AI_KEY}',
49
  'Content-Type': 'application/json'
@@ -55,12 +57,11 @@ class Conversation:
55
  "messages": [
56
  {
57
  "role": "user",
58
- "content": question
59
  }
60
  ]
61
  }
62
  try:
63
- self.messages.append( {"role": "user", "content": question})
64
  response = requests.post(OPENAI_URL, headers=headers, json=payload)
65
  response.raise_for_status() # 抛出异常,如果响应码不是200
66
  data = response.json()
 
44
 
45
  def askWithProxy(self, question):
46
  print("start askWithProxy")
47
+ self.messages.append( {"role": "user", "content": question})
48
+
49
  headers = {
50
  'Authorization': f'Bearer {OPENAI_AI_KEY}',
51
  'Content-Type': 'application/json'
 
57
  "messages": [
58
  {
59
  "role": "user",
60
+ "content": self.messages
61
  }
62
  ]
63
  }
64
  try:
 
65
  response = requests.post(OPENAI_URL, headers=headers, json=payload)
66
  response.raise_for_status() # 抛出异常,如果响应码不是200
67
  data = response.json()