mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-21 00:36:43 +08:00
### What problem does this PR solve? - Implements the `Encode` method in the Google Gemini driver, which was previously a stub returning `not implemented` - Uses the `google.golang.org/genai` SDK's `EmbedContent` API, which routes to the `batchEmbedContents` endpoint internally — all texts are sent in a single request - Adds `text-embedding-004` (max 2048 tokens) to `conf/models/google.json` - Response values are `[]float32` from the SDK and are cast to `[]float64` to satisfy the `ModelDriver` interface ## Files changed - `internal/entity/models/google.go` — full `Encode` implementation - `conf/models/google.json` — adds `text-embedding-004` embedding model ### Type of change - [x] New Feature (non-breaking change which adds functionality)
44 lines
791 B
JSON
44 lines
791 B
JSON
{
|
|
"name": "Google",
|
|
"url": {
|
|
"default": "https://generativelanguage.googleapis.com"
|
|
},
|
|
"url_suffix": {
|
|
"models": "v1beta/models"
|
|
},
|
|
"class": "gemini",
|
|
"models": [
|
|
{
|
|
"name": "gemini-2.5-flash",
|
|
"max_tokens": 1048576,
|
|
"model_types": [
|
|
"chat"
|
|
],
|
|
"thinking": {
|
|
"default_value": true,
|
|
"clear_thinking": true
|
|
}
|
|
},
|
|
{
|
|
"name": "text-embedding-004",
|
|
"max_tokens": 2048,
|
|
"model_types": [
|
|
"embedding"
|
|
]
|
|
}
|
|
],
|
|
"features": {
|
|
"thinking": {
|
|
"default_value": true,
|
|
"supported_models": [
|
|
"gemini-2.5-flash"
|
|
]
|
|
},
|
|
"reasoning_effort": {
|
|
"default_value": "high",
|
|
"supported_modes": [
|
|
"gemini-2.5-flash"
|
|
]
|
|
}
|
|
}
|
|
} |