Nina
commited on
Commit
·
5bba46e
1
Parent(s):
3afc54c
create anonymous user_id
Browse files
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
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
letters = string.ascii_lowercase
|
| 55 |
-
|
| 56 |
-
|
|
|
|
| 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
|