diff options
author | Raju Komati <komatiraju032@gmail.com> | 2023-04-24 20:36:24 +0200 |
---|---|---|
committer | Raju Komati <komatiraju032@gmail.com> | 2023-04-24 20:36:24 +0200 |
commit | 98afd5b9854c242dd05808951935ef61ffc36e98 (patch) | |
tree | ca4d9b08f9aca88a4daf2fc0571699359c55824c /testing | |
parent | added validation for model parameter (diff) | |
parent | userid and session_token (diff) | |
download | gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.tar gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.tar.gz gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.tar.bz2 gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.tar.lz gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.tar.xz gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.tar.zst gpt4free-98afd5b9854c242dd05808951935ef61ffc36e98.zip |
Diffstat (limited to 'testing')
-rw-r--r-- | testing/ora_gpt4.py | 36 | ||||
-rw-r--r-- | testing/phind_test.py | 31 |
2 files changed, 27 insertions, 40 deletions
diff --git a/testing/ora_gpt4.py b/testing/ora_gpt4.py index 1191d0ad..41f20876 100644 --- a/testing/ora_gpt4.py +++ b/testing/ora_gpt4.py @@ -1,5 +1,31 @@ import ora +ora.user_id = '...' +ora.session_token = '...' + +gpt4_chatbot_ids = ['b8b12eaa-5d47-44d3-92a6-4d706f2bcacf', 'fbe53266-673c-4b70-9d2d-d247785ccd91', 'bd5781cf-727a-45e9-80fd-a3cfce1350c6', '993a0102-d397-47f6-98c3-2587f2c9ec3a', 'ae5c524e-d025-478b-ad46-8843a5745261', 'cc510743-e4ab-485e-9191-76960ecb6040', 'a5cd2481-8e24-4938-aa25-8e26d6233390', '6bca5930-2aa1-4bf4-96a7-bea4d32dcdac', '884a5f2b-47a2-47a5-9e0f-851bbe76b57c', 'd5f3c491-0e74-4ef7-bdca-b7d27c59e6b3', 'd72e83f6-ef4e-4702-844f-cf4bd432eef7', '6e80b170-11ed-4f1a-b992-fd04d7a9e78c', '8ef52d68-1b01-466f-bfbf-f25c13ff4a72', 'd0674e11-f22e-406b-98bc-c1ba8564f749', 'a051381d-6530-463f-be68-020afddf6a8f', '99c0afa1-9e32-4566-8909-f4ef9ac06226', '1be65282-9c59-4a96-99f8-d225059d9001', 'dba16bd8-5785-4248-a8e9-b5d1ecbfdd60', '1731450d-3226-42d0-b41c-4129fe009524', '8e74635d-000e-4819-ab2c-4e986b7a0f48', 'afe7ed01-c1ac-4129-9c71-2ca7f3800b30', 'e374c37a-8c44-4f0e-9e9f-1ad4609f24f5'] +chatbot_id = gpt4_chatbot_ids[0] + +model = ora.CompletionModel.load(chatbot_id, 'gpt-4') +response = ora.Completion.create(model, 'hello') + +print(response.completion.choices[0].text) +conversation_id = response.id + +while True: + # pass in conversationId to continue conversation + + prompt = input('>>> ') + response = ora.Completion.create( + model = model, + prompt = prompt, + includeHistory = True, # remember history + conversationId = conversation_id) + + print(response.completion.choices[0].text) + + +# bots : # 1 normal # 2 solidity contract helper # 3 swift project helper @@ -16,12 +42,4 @@ import ora # 16 expert full-stack developer AI # 17 Solana development bot # 18 price guessing game bot -# 19 AI Ethicist and Philosopher - -gpt4_chatbot_ids = ['b8b12eaa-5d47-44d3-92a6-4d706f2bcacf', 'fbe53266-673c-4b70-9d2d-d247785ccd91', 'bd5781cf-727a-45e9-80fd-a3cfce1350c6', '993a0102-d397-47f6-98c3-2587f2c9ec3a', 'ae5c524e-d025-478b-ad46-8843a5745261', 'cc510743-e4ab-485e-9191-76960ecb6040', 'a5cd2481-8e24-4938-aa25-8e26d6233390', '6bca5930-2aa1-4bf4-96a7-bea4d32dcdac', '884a5f2b-47a2-47a5-9e0f-851bbe76b57c', 'd5f3c491-0e74-4ef7-bdca-b7d27c59e6b3', 'd72e83f6-ef4e-4702-844f-cf4bd432eef7', '6e80b170-11ed-4f1a-b992-fd04d7a9e78c', '8ef52d68-1b01-466f-bfbf-f25c13ff4a72', 'd0674e11-f22e-406b-98bc-c1ba8564f749', 'a051381d-6530-463f-be68-020afddf6a8f', '99c0afa1-9e32-4566-8909-f4ef9ac06226', '1be65282-9c59-4a96-99f8-d225059d9001', 'dba16bd8-5785-4248-a8e9-b5d1ecbfdd60', '1731450d-3226-42d0-b41c-4129fe009524', '8e74635d-000e-4819-ab2c-4e986b7a0f48', 'afe7ed01-c1ac-4129-9c71-2ca7f3800b30', 'e374c37a-8c44-4f0e-9e9f-1ad4609f24f5'] -chatbot_id = gpt4_chatbot_ids[0] - -model = ora.CompletionModel.load(chatbot_id, 'gpt-4') -response = ora.Completion.create(model, 'hello') - -print(response.completion.choices[0].text) +# 19 AI Ethicist and Philosopher
\ No newline at end of file diff --git a/testing/phind_test.py b/testing/phind_test.py deleted file mode 100644 index 3e9217e1..00000000 --- a/testing/phind_test.py +++ /dev/null @@ -1,31 +0,0 @@ -import phind - -# set cf_clearance cookie -phind.cf_clearance = 'hWfIdYKgcnxnU5ayolWe9t7eEmAbULywS.qfHkm1T_A-1682166681-0-160' - -prompt = 'hello world' - -# normal completion -result = phind.Completion.create( - model = 'gpt-4', - prompt = prompt, - results = phind.Search.create(prompt, actualSearch = False), # create search (set actualSearch to False to disable internet) - creative = False, - detailed = False, - codeContext = '') # up to 3000 chars of code - -print(result.completion.choices[0].text) - -prompt = 'who won the quatar world cup' - -# help needed: not getting newlines from the stream, please submit a PR if you know how to fix this -# stream completion -for result in phind.StreamingCompletion.create( - model = 'gpt-3.5', - prompt = prompt, - results = phind.Search.create(prompt, actualSearch = True), # create search (set actualSearch to False to disable internet) - creative = False, - detailed = False, - codeContext = ''): # up to 3000 chars of code - - print(result.completion.choices[0].text, end='', flush=True)
\ No newline at end of file |