Repository navigation
feat: add IO Intelligence provider #1758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2aeafc2
e542095
514746b
71387bf
d293beb
fa2d1ac
6c25367
ad3d75d
27aebd3
e44e06a
23b0842
9949b13
9802e78
ffb2bcc
5946552
a7379bc
f525c0c
2ed2d75
eee097a
073ef6f
57170b8
7a4fbef
e121cad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { | ||
| dynamicProviders, | ||
| getModelId, | ||
| getProviderDefaultModelId, | ||
| ioIntelligenceDefaultModelId, | ||
| isSecretStateKey, | ||
| providerIdentifiers, | ||
| providerSettingsSchema, | ||
| } from "../index.js" | ||
|
|
||
| describe("IO Intelligence shared contract", () => { | ||
| it("registers the stable dynamic-provider identity and default model", () => { | ||
| expect(providerIdentifiers.ioIntelligence).toBe("io-intelligence") | ||
| expect(dynamicProviders).toContain(providerIdentifiers.ioIntelligence) | ||
| expect(getProviderDefaultModelId(providerIdentifiers.ioIntelligence)).toBe(ioIntelligenceDefaultModelId) | ||
| }) | ||
|
|
||
| it("classifies the API key as secret and resolves the configured model", () => { | ||
| expect(isSecretStateKey("ioIntelligenceApiKey")).toBe(true) | ||
| const settings = providerSettingsSchema.parse({ | ||
| apiProvider: providerIdentifiers.ioIntelligence, | ||
| ioIntelligenceModelId: "model", | ||
| }) | ||
| expect(getModelId(settings)).toBe("model") | ||
| }) | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { z } from "zod" | ||
|
|
||
| import { providerIdentifiers } from "../provider-identifiers.js" | ||
| import { baseProviderSettingsShape, createModelIdAccessor, createProviderDefinition } from "./common.js" | ||
|
|
||
| const IO_INTELLIGENCE_MODEL_ID_FIELD = "ioIntelligenceModelId" | ||
|
Check warning on line 6 in packages/types/src/provider-settings/io-intelligence.ts
|
||
|
|
||
| export const ioIntelligenceProviderDefinition = createProviderDefinition({ | ||
|
Check warning on line 8 in packages/types/src/provider-settings/io-intelligence.ts
|
||
| apiProvider: providerIdentifiers.ioIntelligence, | ||
| modelIdKey: IO_INTELLIGENCE_MODEL_ID_FIELD, | ||
| getModelId: createModelIdAccessor(IO_INTELLIGENCE_MODEL_ID_FIELD), | ||
| schema: { | ||
| ...baseProviderSettingsShape, | ||
| ioIntelligenceApiKey: z.string().optional(), | ||
| [IO_INTELLIGENCE_MODEL_ID_FIELD]: z.string().optional(), | ||
| }, | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import type { ModelInfo } from "../model.js" | ||
|
|
||
| export const IO_INTELLIGENCE_BASE_URL = "https://api.intelligence.io.solutions/api/v1" | ||
|
Check warning on line 3 in packages/types/src/providers/io-intelligence.ts
|
||
|
|
||
| export const ioIntelligenceDefaultModelId = "meta-llama/Llama-3.3-70B-Instruct" | ||
|
Check warning on line 5 in packages/types/src/providers/io-intelligence.ts
|
||
|
|
||
| export const ioIntelligenceDefaultModelInfo: ModelInfo = { | ||
|
Check warning on line 7 in packages/types/src/providers/io-intelligence.ts
|
||
| maxTokens: 8192, | ||
| contextWindow: 128_000, | ||
| supportsImages: false, | ||
|
Check warning on line 10 in packages/types/src/providers/io-intelligence.ts
|
||
| supportsPromptCache: false, | ||
|
Check warning on line 11 in packages/types/src/providers/io-intelligence.ts
|
||
| description: "IO Intelligence model. The full model catalog is resolved dynamically from the /models endpoint.", | ||
|
Check warning on line 12 in packages/types/src/providers/io-intelligence.ts
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this provider previously enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It was added in #6875 and removed in #11297 with the low-usage batch. This puts it back, so the id comes out of the retired list and settings saved before the removal get the provider again instead of the retired-provider message.