Beracles commited on
Commit
9a20d2b
·
1 Parent(s): 3033731

update prompts

Browse files
Files changed (2) hide show
  1. app.py +5 -2
  2. extract.py +1 -1
app.py CHANGED
@@ -48,7 +48,7 @@ def run(info, game, nlp_command):
48
 
49
  service_start = beijing()
50
  print(f"[{service_start}] service starts >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
51
- print(f"[{beijing()}] [{user}] [{game}] [{nlp_command}]")
52
 
53
  call_pgai.from_cache = True
54
  outp = call_pgai.call_pgai(nlp_command, game)
@@ -67,7 +67,10 @@ def run(info, game, nlp_command):
67
  call_logger.call_logger(outp, identity, db_token)
68
  service_end = beijing()
69
  timecost = service_end.timestamp() - service_start.timestamp()
70
- print(f"[{service_end}] service ends, costs {timecost:.2f}s <<<<<<<<<<<<<<<<<<<<<")
 
 
 
71
  return json.dumps(outp, indent=4)
72
 
73
 
 
48
 
49
  service_start = beijing()
50
  print(f"[{service_start}] service starts >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
51
+ print(f"[{user}] [{game}] [{nlp_command}]")
52
 
53
  call_pgai.from_cache = True
54
  outp = call_pgai.call_pgai(nlp_command, game)
 
67
  call_logger.call_logger(outp, identity, db_token)
68
  service_end = beijing()
69
  timecost = service_end.timestamp() - service_start.timestamp()
70
+ print(
71
+ f"[{service_end}] service ends, costs {timecost:.2f}s "
72
+ + "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"
73
+ )
74
  return json.dumps(outp, indent=4)
75
 
76
 
extract.py CHANGED
@@ -7,7 +7,7 @@ def extract(info_str):
7
  try:
8
  info = dict(json.loads(info_str))
9
  except json.decoder.JSONDecodeError:
10
- return None, None, None, None
11
  user = info.get("user", "__fake__")
12
  source = info.get("source", None)
13
  username = info.get("username", None)
 
7
  try:
8
  info = dict(json.loads(info_str))
9
  except json.decoder.JSONDecodeError:
10
+ return "__fake__", None, None, None
11
  user = info.get("user", "__fake__")
12
  source = info.get("source", None)
13
  username = info.get("username", None)