artificialguybr commited on
Commit
b62c322
1 Parent(s): a3ee2e2

Refactor user function and call_nvidia_api function

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -26,7 +26,6 @@ def user(message, history):
26
  history = history or []
27
  history.append({"role": "user", "content": message})
28
  return history
29
-
30
  def call_nvidia_api(history):
31
  # Preparar o payload com o hist贸rico de chat formatado
32
  payload = {
@@ -36,10 +35,10 @@ def call_nvidia_api(history):
36
  "max_tokens": 500,
37
  "seed": 42,
38
  "stream": False
39
-
 
40
  session = requests.Session()
41
  response = session.post(INVOKE_URL, headers=headers, json=payload)
42
-
43
  # Novo m茅todo de polling para verificar o status da resposta
44
  while response.status_code == 202:
45
  request_id = response.headers.get("NVCF-REQID")
 
26
  history = history or []
27
  history.append({"role": "user", "content": message})
28
  return history
 
29
  def call_nvidia_api(history):
30
  # Preparar o payload com o hist贸rico de chat formatado
31
  payload = {
 
35
  "max_tokens": 500,
36
  "seed": 42,
37
  "stream": False
38
+ }
39
+
40
  session = requests.Session()
41
  response = session.post(INVOKE_URL, headers=headers, json=payload)
 
42
  # Novo m茅todo de polling para verificar o status da resposta
43
  while response.status_code == 202:
44
  request_id = response.headers.get("NVCF-REQID")