summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/H2o.py
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner.lohaus@netformic.com>2023-08-22 23:27:34 +0200
committerHeiner Lohaus <heiner.lohaus@netformic.com>2023-08-22 23:27:34 +0200
commit98d3304108de3e55c18f2af8a66a501541ec658b (patch)
treea2d80ab0c39ec93ebb97967a9f5a32f0c662c99e /g4f/Provider/H2o.py
parent ~ | Merge pull request #829 (diff)
downloadgpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.tar
gpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.tar.gz
gpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.tar.bz2
gpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.tar.lz
gpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.tar.xz
gpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.tar.zst
gpt4free-98d3304108de3e55c18f2af8a66a501541ec658b.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/H2o.py8
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,
)