mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-25 12:16:17 +03:00
Basic support for the temperature parameter
This commit is contained in:
parent
2cd863f55f
commit
12f7a89517
@ -60,6 +60,7 @@ class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin):
|
|||||||
json_data = {
|
json_data = {
|
||||||
'model' : cls.get_model(model),
|
'model' : cls.get_model(model),
|
||||||
'messages': messages,
|
'messages': messages,
|
||||||
|
'temperature': kwargs.get("temperature", 0.7),
|
||||||
'stream' : True
|
'stream' : True
|
||||||
}
|
}
|
||||||
async with session.post('https://api.deepinfra.com/v1/openai/chat/completions',
|
async with session.post('https://api.deepinfra.com/v1/openai/chat/completions',
|
||||||
|
@ -90,12 +90,14 @@ class Api:
|
|||||||
messages = item_data.get('messages')
|
messages = item_data.get('messages')
|
||||||
provider = item_data.get('provider', '').replace('g4f.Provider.', '')
|
provider = item_data.get('provider', '').replace('g4f.Provider.', '')
|
||||||
provider = provider if provider and provider != "Auto" else None
|
provider = provider if provider and provider != "Auto" else None
|
||||||
|
temperature = item_data.get('temperature')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = g4f.ChatCompletion.create(
|
response = g4f.ChatCompletion.create(
|
||||||
model=model,
|
model=model,
|
||||||
stream=stream,
|
stream=stream,
|
||||||
messages=messages,
|
messages=messages,
|
||||||
|
temperature = temperature,
|
||||||
provider = provider,
|
provider = provider,
|
||||||
ignored=self.list_ignored_providers
|
ignored=self.list_ignored_providers
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user