Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix base_url not work in groq #162

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading