Skip to content

Commit dab5be0

Browse files
committed
Update method name
1 parent 1e5859b commit dab5be0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

aisuite/providers/google_provider.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class GoogleProvider(ProviderInterface):
1515
"""Implements the ProviderInterface for interacting with Google's Vertex AI."""
1616

1717
def __init__(self, **config):
18-
"""Set up the Google AI client with a project ID."""
19-
2018
"""Set up the Google AI client with a project ID."""
2119
self.project_id = config.get("project_id") or os.getenv("GOOGLE_PROJECT_ID")
2220
self.location = config.get("region") or os.getenv("GOOGLE_REGION")
@@ -72,7 +70,7 @@ def chat_completions_create(self, model, messages, **kwargs):
7270
response = chat.send_message(last_message)
7371

7472
# Convert the response to the format expected by the OpenAI API
75-
return self.convert_response_to_openai_format(response)
73+
return self.normalize_response(response)
7674

7775
def convert_openai_to_vertex_ai(self, messages):
7876
"""Convert OpenAI messages to Google AI messages."""
@@ -98,8 +96,8 @@ def transform_roles(self, messages):
9896
message["role"] = role
9997
return messages
10098

101-
def convert_response_to_openai_format(self, response):
102-
"""Convert Google AI response to OpenAI's ChatCompletionResponse format."""
99+
def normalize_response(self, response):
100+
"""Normalize the response from Google AI to match OpenAI's response format."""
103101
openai_response = ChatCompletionResponse()
104102
openai_response.choices[0].message.content = (
105103
response.candidates[0].content.parts[0].text

0 commit comments

Comments
 (0)