Skip to content

Commit

Permalink
fix: by review
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: Fangyin Cheng <staneyffer@gmail.com>
  • Loading branch information
yihong0618 committed Dec 20, 2023
1 parent 4c0bab6 commit 0c21315
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
File renamed without changes.
12 changes: 11 additions & 1 deletion dbgpt/model/proxy/llms/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ def gemini_generate_stream(

import google.generativeai as genai

genai.configure(api_key=proxy_api_key)
if model_params.proxy_api_base:
from google.api_core import client_options

client_opts = client_options.ClientOptions(
api_endpoint=model_params.proxy_api_base
)
genai.configure(
api_key=proxy_api_key, transport="rest", client_options=client_opts
)
else:
genai.configure(api_key=proxy_api_key)
model = genai.GenerativeModel(
model_name=proxyllm_backend,
generation_config=generation_config,
Expand Down

0 comments on commit 0c21315

Please sign in to comment.