Nina commited on
Commit
3991cc7
1 Parent(s): 91c4196

create anonymous user_id

Browse files
Files changed (1) hide show
  1. utils.py +9 -4
utils.py CHANGED
@@ -49,8 +49,13 @@ def set_openai_api_key(text):
49
  return f"You're all set: this is your api key: {openai.api_key}"
50
 
51
 
52
- def get_random_string(length):
53
- # choose from all lowercase letter
 
 
 
 
 
54
  letters = string.ascii_lowercase
55
- result_str = "".join(random.choice(letters) for i in range(length))
56
- print("Random string of length", length, "is:", result_str)
 
49
  return f"You're all set: this is your api key: {openai.api_key}"
50
 
51
 
52
+ def create_user_id(length):
53
+ """Create user_id
54
+ Args:
55
+ length (int): length of user id
56
+ Returns:
57
+ str: String to id user
58
+ """
59
  letters = string.ascii_lowercase
60
+ user_id = "".join(random.choice(letters) for i in range(length))
61
+ return user_id