Files
ragflow/conf/models/google.json
Joseff f4f8bed9f7 Go: implement Encode (embeddings) in Google Gemini driver (#14682)
### 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)
2026-05-11 11:24:21 +08:00

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"
]
}
}
}