diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-08-25 18:22:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-25 18:22:38 +0200 |
commit | b2baf46e3cb2ad27d666217bb14c54d89fbb8c66 (patch) | |
tree | 60052aad3746053eb4aec5b7e44d75404f4d11fe /g4f/Provider/H2o.py | |
parent | ~ | Merge pull request #841 (diff) | |
parent | Merge branch 'main' into up (diff) | |
download | gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.tar gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.tar.gz gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.tar.bz2 gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.tar.lz gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.tar.xz gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.tar.zst gpt4free-b2baf46e3cb2ad27d666217bb14c54d89fbb8c66.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/H2o.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/g4f/Provider/H2o.py b/g4f/Provider/H2o.py index f9b799bb..305a0bbf 100644 --- a/g4f/Provider/H2o.py +++ b/g4f/Provider/H2o.py @@ -11,6 +11,7 @@ class H2o(BaseProvider): url = "https://gpt-gm.h2o.ai" working = True supports_stream = True + model = "h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v1" @staticmethod def create_completion( @@ -47,8 +48,9 @@ class H2o(BaseProvider): "https://gpt-gm.h2o.ai/conversation", headers=headers, json=data, - ) - conversation_id = response.json()["conversationId"] + ).json() + if "conversationId" not in response: + return data = { "inputs": conversation, @@ -71,7 +73,7 @@ class H2o(BaseProvider): } response = session.post( - f"https://gpt-gm.h2o.ai/conversation/{conversation_id}", + f"https://gpt-gm.h2o.ai/conversation/{response['conversationId']}", headers=headers, json=data, ) |