summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
Diffstat (limited to 'g4f')
-rw-r--r--g4f/Provider/DeepInfra.py1
-rw-r--r--g4f/api/__init__.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/g4f/Provider/DeepInfra.py b/g4f/Provider/DeepInfra.py
index 8e36128d..183f00ea 100644
--- a/g4f/Provider/DeepInfra.py
+++ b/g4f/Provider/DeepInfra.py
@@ -60,6 +60,7 @@ class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin):
json_data = {
'model' : cls.get_model(model),
'messages': messages,
+ 'temperature': kwargs.get("temperature", 0.7),
'stream' : True
}
async with session.post('https://api.deepinfra.com/v1/openai/chat/completions',
diff --git a/g4f/api/__init__.py b/g4f/api/__init__.py
index 15e8b3a5..3f0778a1 100644
--- a/g4f/api/__init__.py
+++ b/g4f/api/__init__.py
@@ -90,12 +90,14 @@ class Api:
messages = item_data.get('messages')
provider = item_data.get('provider', '').replace('g4f.Provider.', '')
provider = provider if provider and provider != "Auto" else None
+ temperature = item_data.get('temperature')
try:
response = g4f.ChatCompletion.create(
model=model,
stream=stream,
messages=messages,
+ temperature = temperature,
provider = provider,
ignored=self.list_ignored_providers
)