mirror of
https://github.com/discourse/discourse.git
synced 2026-08-10 21:51:49 +08:00
## What does this change? Adds Google Vertex AI as a supported LLM provider for `discourse-ai`. This provider reuses the existing Gemini dialect, but sends requests to Vertex AI's native `generateContent` and `streamGenerateContent` endpoints. It supports Google Cloud environment credentials through the metadata server, so deployments running on Google Cloud do not need to store an API key in Discourse. ## Details - Adds a `google_vertex_ai` provider. - Adds a `GoogleVertexAi` endpoint. - Reuses Gemini prompt translation and response handling. - Adds Vertex provider params for `project_id` and `region`. - Adds a Gemini Vertex preset. - Supports `global` and regional Vertex AI endpoints. - Accepts model names with a leading `google/` prefix and strips it for native Vertex URLs. - Moves provider-specific URL and credential requirements onto endpoint capabilities: - `supports_environment_credentials?` - `requires_configured_url?` ## Tests ```bash bin/rspec plugins/discourse-ai/spec/lib/completions/endpoints/google_vertex_ai_spec.rb \ plugins/discourse-ai/spec/lib/completions/llm_presets_spec.rb \ plugins/discourse-ai/spec/models/llm_model_spec.rb ``` 18 examples, 0 failures --------- Co-authored-by: Rafael Silva <xfalcox@gmail.com> |
||
|---|---|---|
| .. | ||
| concerns | ||
| discourse_ai | ||