Skip to content

Commit 1370c2a

Browse files
authored
Merge branch 'master' into 64-when-using-azure-ai-search-openwebui-does-not-show-citationssources
2 parents 08acff5 + 9726ce8 commit 1370c2a

2 files changed

Lines changed: 9 additions & 20 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,16 @@ The functions include a built-in encryption mechanism for sensitive information:
137137
- **Advanced Image Processing**: Optimized image handling with configurable compression, resizing, and quality settings.
138138
- **Configurable Parameters**: Environment variables for image optimization (quality, max dimensions, format conversion).
139139
- Grounding with Google search with [google_search_tool.py filter](./filters/google_search_tool.py)
140-
- Ability to forward User Headers and change gemini base url
141140
- Native tool calling support
141+
- Configurable API version support
142142
143143
🔗 [Google Gemini Pipeline in Open WebUI](https://openwebui.com/f/owndev/google_gemini)
144144
145145
🔗 [Learn More About Google Gemini](https://ai.google.dev/gemini-api/docs?hl=de)
146146
147+
> [!NOTE]
148+
> **For LiteLLM Users**: To use Google Gemini models through LiteLLM, configure LiteLLM directly in Open WebUI's Admin Panel → Settings → Connections → OpenAI section instead of using this pipeline. For more information about LiteLLM, visit the [official LiteLLM GitHub repository](https://github.com/BerriAI/litellm).
149+
147150
## Filters 🔍
148151
149152
> [!NOTE]

pipelines/google/google_gemini.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
author_url: https://github.com/owndev/
55
project_url: https://github.com/owndev/Open-WebUI-Functions
66
funding_url: https://github.com/sponsors/owndev
7-
version: 1.6.0
7+
version: 1.6.1
88
license: Apache License 2.0
99
description: Highly optimized Google Gemini pipeline with advanced image generation capabilities, intelligent compression, and streamlined processing workflows.
1010
features:
@@ -30,7 +30,6 @@
3030
- Optimized payload creation for image generation models
3131
- Configurable image processing parameters (size, quality, compression)
3232
- Flexible upload fallback options and optimization controls
33-
- Ability to forward User Headers and change gemini base url
3433
"""
3534

3635
import os
@@ -159,10 +158,9 @@ class Valves(BaseModel):
159158
default=os.getenv("GOOGLE_API_KEY", ""),
160159
description="API key for Google Generative AI (used if USE_VERTEX_AI is false).",
161160
)
162-
ENABLE_FORWARD_USER_INFO_HEADERS: bool = Field(
163-
default=os.getenv("ENABLE_FORWARD_USER_INFO_HEADERS", "false").lower()
164-
== "true",
165-
description="Whether to forward user information headers.",
161+
API_VERSION: str = Field(
162+
default=os.getenv("GOOGLE_API_VERSION", "v1alpha"),
163+
description="API version to use for Google Generative AI (e.g., v1alpha, v1beta, v1).",
166164
)
167165
USE_VERTEX_AI: bool = Field(
168166
default=os.getenv("GOOGLE_GENAI_USE_VERTEXAI", "false").lower() == "true",
@@ -479,20 +477,8 @@ def _get_client(self) -> genai.Client:
479477
)
480478
else:
481479
self.log.debug("Initializing Google Generative AI client with API Key")
482-
headers = {}
483-
if (
484-
self.valves.ENABLE_FORWARD_USER_INFO_HEADERS
485-
and hasattr(self, "user")
486-
and self.user
487-
):
488-
headers = {
489-
"X-OpenWebUI-User-Name": self.user.name,
490-
"X-OpenWebUI-User-Id": self.user.id,
491-
"X-OpenWebUI-User-Email": self.user.email,
492-
"X-OpenWebUI-User-Role": self.user.role,
493-
}
494480
options = types.HttpOptions(
495-
api_version="v1alpha", base_url=self.valves.BASE_URL, headers=headers
481+
api_version=self.valves.API_VERSION, base_url=self.valves.BASE_URL
496482
)
497483
return genai.Client(
498484
api_key=self.valves.GOOGLE_API_KEY.get_decrypted(), http_options=options

0 commit comments

Comments
 (0)