mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
implement deployment id
This commit is contained in:
parent
bf03f43b44
commit
b107db98fa
8 changed files with 21 additions and 13 deletions
|
@ -28,10 +28,15 @@ CACHE = None
|
|||
f"{details.get('exception','Exception')}\nRetry in {details['wait']:.1f} seconds."
|
||||
),
|
||||
)
|
||||
def send_with_retries(client, model_name, messages, functions, stream):
|
||||
def send_with_retries(client, model, messages, functions, stream):
|
||||
if not client:
|
||||
raise ValueError("No openai client provided")
|
||||
|
||||
if model.deployment_id:
|
||||
model_name = model.deployment_id
|
||||
else:
|
||||
model_name = model.name
|
||||
|
||||
kwargs = dict(
|
||||
model=model_name,
|
||||
messages=messages,
|
||||
|
@ -57,11 +62,11 @@ def send_with_retries(client, model_name, messages, functions, stream):
|
|||
return hash_object, res
|
||||
|
||||
|
||||
def simple_send_with_retries(client, model_name, messages):
|
||||
def simple_send_with_retries(client, model, messages):
|
||||
try:
|
||||
_hash, response = send_with_retries(
|
||||
client=client,
|
||||
model_name=model_name,
|
||||
model=model,
|
||||
messages=messages,
|
||||
functions=None,
|
||||
stream=False,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue