mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
aider.repo.simple_send_with_retries
This commit is contained in:
parent
e2a32fec7e
commit
661a521693
3 changed files with 23 additions and 32 deletions
|
@ -42,3 +42,16 @@ def send_with_retries(model, messages, functions, stream):
|
|||
|
||||
res = openai.ChatCompletion.create(**kwargs)
|
||||
return hash_object, res
|
||||
|
||||
|
||||
def simple_send_with_retries(model, messages):
|
||||
try:
|
||||
_hash, response = send_with_retries(
|
||||
model=model,
|
||||
messages=messages,
|
||||
functions=None,
|
||||
stream=False,
|
||||
)
|
||||
return response.choices[0].message.content
|
||||
except (AttributeError, openai.error.InvalidRequestError):
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue