mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +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
|
@ -2,10 +2,9 @@ import os
|
|||
from pathlib import Path, PurePosixPath
|
||||
|
||||
import git
|
||||
import openai
|
||||
|
||||
from aider import models, prompts, utils
|
||||
from aider.sendchat import send_with_retries
|
||||
from aider.sendchat import simple_send_with_retries
|
||||
|
||||
from .dump import dump # noqa: F401
|
||||
|
||||
|
@ -104,19 +103,10 @@ class GitRepo:
|
|||
dict(role="user", content=content),
|
||||
]
|
||||
|
||||
commit_message = None
|
||||
for model in [models.GPT35.name, models.GPT35_16k.name]:
|
||||
try:
|
||||
_hash, response = send_with_retries(
|
||||
model=models.GPT35.name,
|
||||
messages=messages,
|
||||
functions=None,
|
||||
stream=False,
|
||||
)
|
||||
commit_message = response.choices[0].message.content
|
||||
commit_message = simple_send_with_retries(model, messages)
|
||||
if commit_message:
|
||||
break
|
||||
except (AttributeError, openai.error.InvalidRequestError):
|
||||
pass
|
||||
|
||||
if not commit_message:
|
||||
self.io.tool_error("Failed to generate commit message!")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue