From 2b4079f8a9acc4ce70c6e4b3b7fa99f4c5bc9738 Mon Sep 17 00:00:00 2001 From: Hikeri <95499256+hikeri@users.noreply.github.com> Date: Thu, 27 Apr 2023 22:56:43 +0300 Subject: Update __init__.py --- forefront/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'forefront') diff --git a/forefront/__init__.py b/forefront/__init__.py index 44f5d44d..615057f8 100644 --- a/forefront/__init__.py +++ b/forefront/__init__.py @@ -38,9 +38,12 @@ class Account: "email_address": mail_adress } ) - - trace_token = response.json()['response']['id'] - if logging: print(trace_token) + + try: + trace_token = response.json()['response']['id'] + if logging: print(trace_token) + except KeyError: + return 'Failed to create account!' response = client.post( f"https://clerk.forefront.ai/v1/client/sign_ups/{trace_token}/prepare_verification?_clerk_js_version=4.32.6", -- cgit v1.2.3 From 51697d3216a29c143d241d028f8b4102e40246ac Mon Sep 17 00:00:00 2001 From: naa <44613678+naa7@users.noreply.github.com> Date: Fri, 28 Apr 2023 00:10:34 -0400 Subject: Updated README.md There is no need for logging as it takes so much space of terminal window. Also, added a print statement to add a line at the end of the Bot's response. --- forefront/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'forefront') diff --git a/forefront/README.md b/forefront/README.md index 5b084af5..a2be8187 100644 --- a/forefront/README.md +++ b/forefront/README.md @@ -4,7 +4,7 @@ import forefront # create an account -token = forefront.Account.create(logging=True) +token = forefront.Account.create(logging=False) print(token) # get a response @@ -12,4 +12,5 @@ for response in forefront.StreamingCompletion.create(token = token, prompt = 'hello world', model='gpt-4'): print(response.completion.choices[0].text, end = '') -``` \ No newline at end of file +print("") +``` -- cgit v1.2.3