@@ -15,8 +15,10 @@ class TestClient(unittest.TestCase):
15
15
@patch (
16
16
"aisuite.providers.anthropic_provider.AnthropicProvider.chat_completions_create"
17
17
)
18
+ @patch ("aisuite.providers.google_provider.GoogleProvider.chat_completions_create" )
18
19
def test_client_chat_completions (
19
20
self ,
21
+ mock_google ,
20
22
mock_anthropic ,
21
23
mock_azure ,
22
24
mock_bedrock ,
@@ -31,6 +33,7 @@ def test_client_chat_completions(
31
33
mock_anthropic .return_value = "Anthropic Response"
32
34
mock_groq .return_value = "Groq Response"
33
35
mock_mistral .return_value = "Mistral Response"
36
+ mock_google .return_value = "Google Response"
34
37
35
38
# Provider configurations
36
39
provider_configs = {
@@ -50,6 +53,11 @@ def test_client_chat_completions(
50
53
ProviderNames .MISTRAL : {
51
54
"api_key" : "mistral-api-key" ,
52
55
},
56
+ ProviderNames .GOOGLE : {
57
+ "project_id" : "test_google_project_id" ,
58
+ "region" : "us-west4" ,
59
+ "application_credentials" : "test_google_application_credentials" ,
60
+ },
53
61
}
54
62
55
63
# Initialize the client
@@ -104,6 +112,14 @@ def test_client_chat_completions(
104
112
self .assertEqual (mistral_response , "Mistral Response" )
105
113
mock_mistral .assert_called_once ()
106
114
115
+ # Test Google model
116
+ google_model = ProviderNames .GOOGLE + ":" + "google-model"
117
+ google_response = client .chat .completions .create (
118
+ google_model , messages = messages
119
+ )
120
+ self .assertEqual (google_response , "Google Response" )
121
+ mock_google .assert_called_once ()
122
+
107
123
# Test that new instances of Completion are not created each time we make an inference call.
108
124
compl_instance = client .chat .completions
109
125
next_compl_instance = client .chat .completions
0 commit comments