Skip to content

Commit a6381d7

Browse files
feat(providers): Add Google provider support (#21)
* feat(providers): Add Google provider support Update OpenAPI specification and regenerate TypeScript types to include Google provider. - Download latest openapi.yaml from inference-gateway repository - Regenerate types with openapi-typescript - Add google provider to Provider enum Closes #19 Co-authored-by: Eden Reich <edenreich@users.noreply.github.com> * fix(oas-download): Update OpenAPI specification URL to correct repository path Signed-off-by: Eden Reich <eden.reich@gmail.com> * docs(fix): Update provider names to lowercase for consistency Signed-off-by: Eden Reich <eden.reich@gmail.com> * chore(env): Update environment settings for production and add missing provider configurations Signed-off-by: Eden Reich <eden.reich@gmail.com> --------- Signed-off-by: Eden Reich <eden.reich@gmail.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
1 parent 83e61a0 commit a6381d7

File tree

5 files changed

+579
-49
lines changed

5 files changed

+579
-49
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ try {
116116
},
117117
],
118118
},
119-
Provider.OpenAI
119+
Provider.openai
120120
); // Provider is optional
121121

122122
console.log('Response:', response.choices[0].message.content);
@@ -159,7 +159,7 @@ try {
159159
onFinish: () => console.log('\nStream completed'),
160160
onError: (error) => console.error('Stream error:', error),
161161
},
162-
Provider.Groq // Provider is optional
162+
Provider.groq // Provider is optional
163163
);
164164
} catch (error) {
165165
console.error('Error:', error);
@@ -241,7 +241,7 @@ const client = new InferenceGatewayClient({
241241
});
242242

243243
try {
244-
const response = await client.proxy(Provider.OpenAI, 'embeddings', {
244+
const response = await client.proxy(Provider.openai, 'embeddings', {
245245
method: 'POST',
246246
body: JSON.stringify({
247247
model: 'text-embedding-ada-002',

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tasks:
55
oas-download:
66
desc: Download OpenAPI specification
77
cmds:
8-
- curl -o openapi.yaml https://raw.githubusercontent.com/inference-gateway/inference-gateway/refs/heads/main/openapi.yaml
8+
- curl -o openapi.yaml https://raw.githubusercontent.com/inference-gateway/schemas/refs/heads/main/openapi.yaml
99

1010
lint:
1111
desc: Lint the SDK

examples/.env.example

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
# General settings
3-
ENVIRONMENT=development
4-
ENABLE_TELEMETRY=false
5-
ENABLE_AUTH=false
3+
ENVIRONMENT=production
4+
ALLOWED_MODELS=
5+
# Telemetry
6+
TELEMETRY_ENABLE=false
7+
TELEMETRY_METRICS_PORT=9464
68
# Model Context Protocol (MCP)
79
MCP_ENABLE=false
810
MCP_EXPOSE=false
@@ -13,10 +15,35 @@ MCP_TLS_HANDSHAKE_TIMEOUT=3s
1315
MCP_RESPONSE_HEADER_TIMEOUT=3s
1416
MCP_EXPECT_CONTINUE_TIMEOUT=1s
1517
MCP_REQUEST_TIMEOUT=5s
16-
# OpenID Connect
17-
OIDC_ISSUER_URL=http://keycloak:8080/realms/inference-gateway-realm
18-
OIDC_CLIENT_ID=inference-gateway-client
19-
OIDC_CLIENT_SECRET=
18+
MCP_MAX_RETRIES=3
19+
MCP_RETRY_INTERVAL=5s
20+
MCP_INITIAL_BACKOFF=1s
21+
MCP_ENABLE_RECONNECT=true
22+
MCP_RECONNECT_INTERVAL=30s
23+
MCP_POLLING_ENABLE=true
24+
MCP_POLLING_INTERVAL=30s
25+
MCP_POLLING_TIMEOUT=5s
26+
MCP_DISABLE_HEALTHCHECK_LOGS=true
27+
# Agent-to-Agent (A2A) Protocol
28+
A2A_ENABLE=false
29+
A2A_EXPOSE=false
30+
A2A_AGENTS=
31+
A2A_CLIENT_TIMEOUT=30s
32+
A2A_POLLING_ENABLE=true
33+
A2A_POLLING_INTERVAL=1s
34+
A2A_POLLING_TIMEOUT=30s
35+
A2A_MAX_POLL_ATTEMPTS=30
36+
A2A_MAX_RETRIES=3
37+
A2A_RETRY_INTERVAL=5s
38+
A2A_INITIAL_BACKOFF=1s
39+
A2A_ENABLE_RECONNECT=true
40+
A2A_RECONNECT_INTERVAL=30s
41+
A2A_DISABLE_HEALTHCHECK_LOGS=true
42+
# Authentication
43+
AUTH_ENABLE=false
44+
AUTH_OIDC_ISSUER=http://keycloak:8080/realms/inference-gateway-realm
45+
AUTH_OIDC_CLIENT_ID=inference-gateway-client
46+
AUTH_OIDC_CLIENT_SECRET=
2047
# Server settings
2148
SERVER_HOST=0.0.0.0
2249
SERVER_PORT=8080
@@ -31,6 +58,9 @@ CLIENT_MAX_IDLE_CONNS=20
3158
CLIENT_MAX_IDLE_CONNS_PER_HOST=20
3259
CLIENT_IDLE_CONN_TIMEOUT=30s
3360
CLIENT_TLS_MIN_VERSION=TLS12
61+
CLIENT_DISABLE_COMPRESSION=true
62+
CLIENT_RESPONSE_HEADER_TIMEOUT=10s
63+
CLIENT_EXPECT_CONTINUE_TIMEOUT=1s
3464
# Providers
3565
ANTHROPIC_API_URL=https://api.anthropic.com/v1
3666
ANTHROPIC_API_KEY=
@@ -46,3 +76,5 @@ OPENAI_API_URL=https://api.openai.com/v1
4676
OPENAI_API_KEY=
4777
DEEPSEEK_API_URL=https://api.deepseek.com
4878
DEEPSEEK_API_KEY=
79+
GOOGLE_API_URL=https://generativelanguage.googleapis.com/v1beta/openai
80+
GOOGLE_API_KEY=

0 commit comments

Comments
 (0)