Skip to content

Commit cab6e5c

Browse files
committed
refactor: Remove GOOGLE provider
It's deprecated on inference gateway. Signed-off-by: Eden Reich <[email protected]>
1 parent fb4eabb commit cab6e5c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

inference_gateway/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Provider(str, Enum):
1010
OLLAMA = "ollama"
1111
GROQ = "groq"
1212
OPENAI = "openai"
13-
GOOGLE = "google"
1413
CLOUDFLARE = "cloudflare"
1514
COHERE = "cohere"
1615

@@ -68,7 +67,8 @@ def list_models(self) -> List[ProviderModels]:
6867
return response.json()
6968

7069
def generate_content(self, provider: Provider, model: str, messages: List[Message]) -> Dict:
71-
payload = {"model": model, "messages": [msg.to_dict() for msg in messages]}
70+
payload = {"model": model, "messages": [
71+
msg.to_dict() for msg in messages]}
7272

7373
response = self.session.post(
7474
f"{self.base_url}/llms/{provider.value}/generate", json=payload

tests/test_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def test_client_initialization():
2424
assert client.base_url == "http://test-api"
2525
assert "Authorization" not in client.session.headers
2626

27-
client_with_token = InferenceGatewayClient("http://test-api", token="test-token")
27+
client_with_token = InferenceGatewayClient(
28+
"http://test-api", token="test-token")
2829
assert "Authorization" in client_with_token.session.headers
2930
assert client_with_token.session.headers["Authorization"] == "Bearer test-token"
3031

@@ -42,7 +43,8 @@ def test_list_models(mock_get, client, mock_response):
4243
@patch("requests.Session.post")
4344
def test_generate_content(mock_post, client, mock_response):
4445
"""Test content generation"""
45-
messages = [Message(Role.SYSTEM, "You are a helpful assistant"), Message(Role.USER, "Hello!")]
46+
messages = [Message(Role.SYSTEM, "You are a helpful assistant"), Message(
47+
Role.USER, "Hello!")]
4648

4749
mock_post.return_value = mock_response
4850
response = client.generate_content(Provider.OPENAI, "gpt-4", messages)
@@ -86,7 +88,6 @@ def test_provider_enum():
8688
assert Provider.OPENAI == "openai"
8789
assert Provider.OLLAMA == "ollama"
8890
assert Provider.GROQ == "groq"
89-
assert Provider.GOOGLE == "google"
9091
assert Provider.CLOUDFLARE == "cloudflare"
9192
assert Provider.COHERE == "cohere"
9293

0 commit comments

Comments
 (0)