• Md Rakibul Islam Rocky's avatar
    Add Google Vertex AI provider (#1163) · 4db6d63b
    Md Rakibul Islam Rocky 提交于
    # Summary
    
    * Adds first-class **Google Vertex AI provider** using
    `@ai-sdk/google-vertex`.
    * Supports **Gemini 2.5** models and partner **MaaS (Model Garden)**
    models via full publisher IDs.
    * New **Vertex-specific settings UI** for Project, Location, and Service
    Account JSON.
    * Implements a **“thinking” toggle** for Gemini 2.5 Flash
    
      * Pro: always on
      * Flash: toggleable
      * Flash Lite: none
    * Fixes *“AI not found”* for Vertex built-ins by mapping to
    `publishers/google` paths.
    * Hardens **cross-platform file ops** and ensures all tests pass.
    
    ---
    
    # What’s New
    
    ### Vertex AI Provider
    
    * Uses `@ai-sdk/google-vertex` with `googleAuthOptions.credentials` from
    pasted Service Account JSON.
    * Configurable **project** and **location**.
    * Base URL → `/projects/{project}/locations/{location}`
    
      * Built-ins: `publishers/google/models/<id>`
      * Partner MaaS: `publishers/<partner>/models/...`
    
    ### Built-in Vertex Models
    
    * `gemini-2.5-pro`
    * `gemini-2.5-flash`
    * `gemini-2.5-flash-lite`
    
    ### Thinking Behavior
    
    * Vertex + Google marked as thinking-capable.
    * Pro: always thinking
    * Flash: toggle in UI
    * Flash Lite: none
    
    ### Vertex Settings UI
    
    * New **Google Vertex AI panel** for Project ID, Location, Service
    Account JSON.
    * Keys encrypted like other secrets.
    
    ---
    
    # Fixes
    
    * **Model resolution:** built-ins auto-map to
    `publishers/google/models/<id>`.
    * **Partner MaaS support:** full publisher IDs work directly (e.g.
    DeepSeek).
    * **Cross-platform paths:** normalize file ops with `toPosixPath`,
    preserve `safeJoin` semantics.
    
    ---
    
    # Why This Is Better
    
    * Users can select **Vertex alongside other providers**.
    * **More models** available through Model Garden.
    * **Dedicated setup UI** reduces misconfig.
    * **Thinking toggle** gives control over cost vs. reasoning depth.
    
    ---
    
    # Files Changed
    
    * **Provider & Models**: `language_model_helpers.ts`,
    `get_model_client.ts`
    * **Streaming**: `chat_stream_handlers.ts`
    * **Schemas & Encryption**: `schemas.ts`, `settings.ts`
    * **Settings UI**: `VertexConfiguration.tsx`, `ApiKeyConfiguration.tsx`
    * **Models UI**: `ModelsSection.tsx` (Flash toggle)
    * **Setup Detection**: `useLanguageModelProviders.ts`
    * **Path Utils**: `path_utils.ts`, `response_processor.ts`
    * **Deps**: `package.json` → `@ai-sdk/google-vertex@3.0.16`
    
    ---
    
    # Tests & Validation
    
    * **TypeScript**: `npm run ts` → 
    * **Lint**: `npm run lint` → 
    * **Unit tests**: `npm test` →  231 passed, 0 failed
    
    ---
    
    # Migration / Notes
    
    * No breaking changes.
    * For Vertex usage:
    
      * Ensure Vertex AI API is enabled.
      * Service Account needs `roles/aiplatform.user`.
      * Region must support model (e.g. `us-central1`).
    * Thinking toggle currently affects **only** Gemini 2.5 Flash.
    
    ---
    
    # Manual QA
    
    1. Configure Vertex with Project/Location/Service Account JSON.
    2. Test built-ins:
    
       * `gemini-2.5-pro`
       * `gemini-2.5-flash` (toggle on/off)
       * `gemini-2.5-flash-lite`
    3. Test MaaS partner model (e.g., DeepSeek) via full publisher ID.
    4. Verify other providers remain unaffected.
        
    <!-- This is an auto-generated description by cubic. -->
    ---
    
    ## Summary by cubic
    Adds a first-class Google Vertex AI provider with Gemini 2.5 models, a
    Vertex settings panel, and a “thinking” toggle for Gemini 2.5 Flash.
    Also fixes model resolution for Vertex and hardens cross-platform file
    operations.
    
    - **New Features**
    - Vertex AI provider via @ai-sdk/google-vertex with project, location,
    and service account JSON.
    - Built-in models: gemini-2.5-pro, gemini-2.5-flash,
    gemini-2.5-flash-lite.
    - “Thinking” support: Pro always on; Flash toggle in Models UI; Flash
    Lite none.
    - MaaS partners supported via full publisher paths (e.g.,
    publishers/<partner>/models/...).
      - Vertex settings UI with encrypted service account key storage.
    
    - **Bug Fixes**
      - Built-in Vertex models auto-map to publishers/google/models/<id>.
      - Consistent file ops across platforms using toPosixPath.
    - Vertex readiness detection requires project/location/service account
    JSON.
    - Streaming “thinking” behavior respects Vertex Flash toggle and Pro
    always-on.
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarMd Rakibul Islam Rocky <mdrirocky08@gmail.com>
    Co-authored-by: 's avatargraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
    Co-authored-by: 's avatarWill Chen <willchen90@gmail.com>
    4db6d63b
名称
最后提交
最后更新
..
chat 正在载入提交数据...
preview_panel 正在载入提交数据...
settings 正在载入提交数据...
ui 正在载入提交数据...
AppList.tsx 正在载入提交数据...
AppUpgrades.tsx 正在载入提交数据...
AutoApproveSwitch.tsx 正在载入提交数据...
AutoFixProblemsSwitch.tsx 正在载入提交数据...
AutoUpdateSwitch.tsx 正在载入提交数据...
CapacitorControls.tsx 正在载入提交数据...
ChatInputControls.tsx 正在载入提交数据...
ChatList.tsx 正在载入提交数据...
ChatModeSelector.tsx 正在载入提交数据...
ChatPanel.tsx 正在载入提交数据...
CommunityCodeConsentDialog.tsx 正在载入提交数据...
ConfirmationDialog.tsx 正在载入提交数据...
ContextFilesPicker.tsx 正在载入提交数据...
CreateAppDialog.tsx 正在载入提交数据...
CreateCustomModelDialog.tsx 正在载入提交数据...
CreateCustomProviderDialog.tsx 正在载入提交数据...
CreatePromptDialog.tsx 正在载入提交数据...
CustomErrorToast.tsx 正在载入提交数据...
DeleteConfirmationDialog.tsx 正在载入提交数据...
DyadProSuccessDialog.tsx 正在载入提交数据...
EditCustomModelDialog.tsx 正在载入提交数据...
ErrorBoundary.tsx 正在载入提交数据...
GitHubConnector.tsx 正在载入提交数据...
GitHubIntegration.tsx 正在载入提交数据...
HelpBotDialog.tsx 正在载入提交数据...
HelpDialog.tsx 正在载入提交数据...
ImportAppButton.tsx 正在载入提交数据...
ImportAppDialog.tsx 正在载入提交数据...
InputRequestToast.tsx 正在载入提交数据...
LoadingBlock.tsx 正在载入提交数据...
MaxChatTurnsSelector.tsx 正在载入提交数据...
ModelPicker.tsx 正在载入提交数据...
NeonConnector.tsx 正在载入提交数据...
NeonDisconnectButton.tsx 正在载入提交数据...
NeonIntegration.tsx 正在载入提交数据...
PortalMigrate.tsx 正在载入提交数据...
ProModeSelector.tsx 正在载入提交数据...
ProviderSettings.tsx 正在载入提交数据...
ReleaseChannelSelector.tsx 正在载入提交数据...
RuntimeModeSelector.tsx 正在载入提交数据...
SettingsList.tsx 正在载入提交数据...
SetupBanner.tsx 正在载入提交数据...
SupabaseConnector.tsx 正在载入提交数据...
SupabaseIntegration.tsx 正在载入提交数据...
TelemetryBanner.tsx 正在载入提交数据...
TelemetrySwitch.tsx 正在载入提交数据...
TemplateCard.tsx 正在载入提交数据...
ThinkingBudgetSelector.tsx 正在载入提交数据...
VercelConnector.tsx 正在载入提交数据...
VercelIntegration.tsx 正在载入提交数据...
app-sidebar.tsx 正在载入提交数据...