feat: prune cloud providers and console API, complete Neuron branding sweep
This commit is contained in:
@@ -713,14 +713,6 @@ it.instance("getSmallModel returns appropriate small model", () =>
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance("getSmallModel prefers Gemini for Google Vertex", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_VERTEX_PROJECT", "test-project")
|
||||
const model = yield* Provider.use.getSmallModel(ProviderV2.ID.googleVertex)
|
||||
expect(model).toBeDefined()
|
||||
expect(model?.id).toContain("gemini")
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance(
|
||||
"getSmallModel selects the latest model in the preferred family",
|
||||
@@ -1282,7 +1274,7 @@ it.instance(
|
||||
expect(providers[ProviderV2.ID.make("nvidia")].options.headers).toEqual({
|
||||
"HTTP-Referer": "https://opencode.ai/",
|
||||
"X-Title": "opencode",
|
||||
"X-BILLING-INVOKE-ORIGIN": "OpenCode",
|
||||
"X-BILLING-INVOKE-ORIGIN": "Neuron",
|
||||
})
|
||||
}),
|
||||
{ config: { provider: { nvidia: { options: { apiKey: "test-api-key" } } } } },
|
||||
@@ -1295,7 +1287,7 @@ it.instance(
|
||||
expect(providers[ProviderV2.ID.make("nvidia")].options.headers).toEqual({
|
||||
"HTTP-Referer": "https://opencode.ai/",
|
||||
"X-Title": "opencode",
|
||||
"X-BILLING-INVOKE-ORIGIN": "OpenCode",
|
||||
"X-BILLING-INVOKE-ORIGIN": "Neuron",
|
||||
})
|
||||
}),
|
||||
{ config: { provider: { nvidia: { options: { apiKey: "test-api-key", baseURL: "http://localhost:8000/v1" } } } } },
|
||||
@@ -1804,136 +1796,12 @@ it.instance(
|
||||
},
|
||||
)
|
||||
|
||||
it.instance(
|
||||
"Google Vertex: retains baseURL for custom proxy",
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_APPLICATION_CREDENTIALS", "test-creds")
|
||||
const providers = yield* list
|
||||
expect(providers[ProviderV2.ID.make("vertex-proxy")]).toBeDefined()
|
||||
expect(providers[ProviderV2.ID.make("vertex-proxy")].options.baseURL).toBe("https://my-proxy.com/v1")
|
||||
}),
|
||||
{
|
||||
config: {
|
||||
provider: {
|
||||
"vertex-proxy": {
|
||||
name: "Vertex Proxy",
|
||||
npm: "@ai-sdk/google-vertex",
|
||||
api: "https://my-proxy.com/v1",
|
||||
env: ["GOOGLE_APPLICATION_CREDENTIALS"],
|
||||
models: { "gemini-pro": { name: "Gemini Pro", tool_call: true } },
|
||||
options: {
|
||||
project: "test-project",
|
||||
location: "us-central1",
|
||||
baseURL: "https://my-proxy.com/v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
it.instance(
|
||||
"Google Vertex: supports OpenAI compatible models",
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_APPLICATION_CREDENTIALS", "test-creds")
|
||||
const providers = yield* list
|
||||
const model = providers[ProviderV2.ID.make("vertex-openai")].models["gpt-4"]
|
||||
expect(model).toBeDefined()
|
||||
expect(model.api.npm).toBe("@ai-sdk/openai-compatible")
|
||||
}),
|
||||
{
|
||||
config: {
|
||||
provider: {
|
||||
"vertex-openai": {
|
||||
name: "Vertex OpenAI",
|
||||
npm: "@ai-sdk/google-vertex",
|
||||
env: ["GOOGLE_APPLICATION_CREDENTIALS"],
|
||||
models: {
|
||||
"gpt-4": {
|
||||
name: "GPT-4",
|
||||
provider: { npm: "@ai-sdk/openai-compatible", api: "https://api.openai.com/v1" },
|
||||
},
|
||||
},
|
||||
options: { project: "test-project", location: "us-central1" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
it.instance("Google Vertex: uses REP endpoint for Claude continental multi-regions", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_CLOUD_PROJECT", "test-project")
|
||||
yield* set("VERTEX_LOCATION", "eu")
|
||||
const provider = yield* Provider.Service
|
||||
const model = yield* provider.getModel(
|
||||
ProviderV2.ID.make("google-vertex"),
|
||||
ModelV2.ID.make("claude-sonnet-4-6@default"),
|
||||
)
|
||||
const language = yield* provider.getLanguage(model)
|
||||
expect(languageBaseURL(language)).toBe(
|
||||
"https://aiplatform.eu.rep.googleapis.com/v1/projects/test-project/locations/eu/publishers/anthropic/models",
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance("Google Vertex Anthropic: uses REP endpoint for continental multi-regions", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_CLOUD_PROJECT", "test-project")
|
||||
yield* set("VERTEX_LOCATION", "us")
|
||||
const provider = yield* Provider.Service
|
||||
const model = yield* provider.getModel(
|
||||
ProviderV2.ID.make("google-vertex-anthropic"),
|
||||
ModelV2.ID.make("claude-sonnet-4-6@default"),
|
||||
)
|
||||
const language = yield* provider.getLanguage(model)
|
||||
expect(languageBaseURL(language)).toBe(
|
||||
"https://aiplatform.us.rep.googleapis.com/v1/projects/test-project/locations/us/publishers/anthropic/models",
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance("Google Vertex: keeps regional Claude endpoints unchanged", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_CLOUD_PROJECT", "test-project")
|
||||
yield* set("VERTEX_LOCATION", "europe-west1")
|
||||
const provider = yield* Provider.Service
|
||||
const model = yield* provider.getModel(
|
||||
ProviderV2.ID.make("google-vertex"),
|
||||
ModelV2.ID.make("claude-sonnet-4-6@default"),
|
||||
)
|
||||
const language = yield* provider.getLanguage(model)
|
||||
expect(languageBaseURL(language)).toBe(
|
||||
"https://europe-west1-aiplatform.googleapis.com/v1/projects/test-project/locations/europe-west1/publishers/anthropic/models",
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance("Google Vertex: uses REP endpoint for Gemini continental multi-regions", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_CLOUD_PROJECT", "test-project")
|
||||
yield* set("VERTEX_LOCATION", "eu")
|
||||
const provider = yield* Provider.Service
|
||||
const model = yield* provider.getModel(ProviderV2.ID.make("google-vertex"), ModelV2.ID.make("gemini-3.5-flash"))
|
||||
const language = yield* provider.getLanguage(model)
|
||||
expect(languageBaseURL(language)).toBe(
|
||||
"https://aiplatform.eu.rep.googleapis.com/v1beta1/projects/test-project/locations/eu/publishers/google",
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance("Google Vertex: keeps regional Gemini endpoints unchanged", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* set("GOOGLE_CLOUD_PROJECT", "test-project")
|
||||
yield* set("VERTEX_LOCATION", "europe-west1")
|
||||
const provider = yield* Provider.Service
|
||||
const model = yield* provider.getModel(ProviderV2.ID.make("google-vertex"), ModelV2.ID.make("gemini-3.5-flash"))
|
||||
const language = yield* provider.getLanguage(model)
|
||||
expect(languageBaseURL(language)).toBe(
|
||||
"https://europe-west1-aiplatform.googleapis.com/v1beta1/projects/test-project/locations/europe-west1/publishers/google",
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
it.instance("cloudflare-ai-gateway loads with env variables", () =>
|
||||
Effect.gen(function* () {
|
||||
|
||||
Reference in New Issue
Block a user