mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 04:40:38 +08:00
adding support for Anthropic, Cohere, Replicate, Azure
This commit is contained in:
@ -3,7 +3,7 @@ import logging
|
|||||||
import openai
|
import openai
|
||||||
from openai.error import APIError, RateLimitError, Timeout, TryAgain
|
from openai.error import APIError, RateLimitError, Timeout, TryAgain
|
||||||
from retry import retry
|
from retry import retry
|
||||||
|
from litellm import acompletion
|
||||||
from pr_agent.config_loader import get_settings
|
from pr_agent.config_loader import get_settings
|
||||||
|
|
||||||
OPENAI_RETRIES=5
|
OPENAI_RETRIES=5
|
||||||
@ -57,7 +57,7 @@ class AiHandler:
|
|||||||
TryAgain: If there is an attribute error during OpenAI inference.
|
TryAgain: If there is an attribute error during OpenAI inference.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
response = await openai.ChatCompletion.acreate(
|
response = await acompletion(
|
||||||
model=model,
|
model=model,
|
||||||
deployment_id=self.deployment_id,
|
deployment_id=self.deployment_id,
|
||||||
messages=[
|
messages=[
|
||||||
|
Reference in New Issue
Block a user