mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
feat(server): gemini embedding 2 support (#14956)
#### PR Dependency Tree * **PR #14956** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Improved Gemini Vertex provider configuration validation logic for enhanced reliability. * Refined Google Vertex publisher base URL construction handling. * **Tests** * Added test coverage for Gemini Embedding 2 model resolution. * Added test coverage for Gemini Vertex provider Google Cloud integration. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/toeverything/AFFiNE/pull/14956) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
type PromptMessage,
|
||||
type StreamObject,
|
||||
} from '../../plugins/copilot/providers/types';
|
||||
import { getVertexGoogleBaseUrl } from '../../plugins/copilot/providers/utils';
|
||||
import {
|
||||
buildPromptStructuredResponseFromFields,
|
||||
buildStructuredResponseContract,
|
||||
@@ -1823,6 +1824,17 @@ test('GeminiVertexProvider should prefetch bearer token for native config', asyn
|
||||
t.snapshot(config);
|
||||
});
|
||||
|
||||
test('GeminiVertexProvider should build project scoped Vertex base URL', t => {
|
||||
t.is(
|
||||
getVertexGoogleBaseUrl({
|
||||
project: 'p1',
|
||||
location: 'us-central1',
|
||||
googleAuthOptions: {},
|
||||
}),
|
||||
'https://us-central1-aiplatform.googleapis.com/v1/projects/p1/locations/us-central1/publishers/google'
|
||||
);
|
||||
});
|
||||
|
||||
test('GeminiVertexProvider should materialize remote attachments before native text path', async t => {
|
||||
const cases = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user