Skip to content

Commit

Permalink
Merge pull request #162 from simplaj/main
Browse files Browse the repository at this point in the history
fix base_url not work in groq
  • Loading branch information
marklysze authored Dec 11, 2024
2 parents fd0112e + ace3127 commit 5f15f54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autogen/oai/groq.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(self, **kwargs):

if "response_format" in kwargs and kwargs["response_format"] is not None:
warnings.warn("response_format is not supported for Groq API, it will be ignored.", UserWarning)
self.base_url = kwargs.get("base_url", None)

def message_retrieval(self, response) -> List:
"""
Expand Down Expand Up @@ -149,7 +150,7 @@ def create(self, params: Dict) -> ChatCompletion:
groq_params["messages"] = groq_messages

# We use chat model by default, and set max_retries to 5 (in line with typical retries loop)
client = Groq(api_key=self.api_key, max_retries=5)
client = Groq(api_key=self.api_key, max_retries=5, base_url=self.base_url)

# Token counts will be returned
prompt_tokens = 0
Expand Down

0 comments on commit 5f15f54

Please sign in to comment.