Basic support for the temperature parameter

This commit is contained in:
nullstreak 2024-02-14 03:27:16 +01:00
parent 2cd863f55f
commit 12f7a89517
2 changed files with 3 additions and 0 deletions

View File

@ -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',

View File

@ -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
)