@ever-works/vercel-ai-gateway-plugin 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ import { BaseAiProvider } from '@ever-works/plugin/abstract';
2
+ import { ConfigurationMode, JsonSchema, PluginContext, ChatCompletionOptions, ChatCompletionResponse, ChatCompletionChunk, EmbeddingOptions, EmbeddingResponse, PluginSettings, AiModel, AiModelCapabilities, PluginHealthCheck, PluginManifest } from '@ever-works/plugin';
3
+ import { AiOperationsConfig } from '@ever-works/plugin/ai';
4
+
5
+ /**
6
+ * Vercel AI Gateway provider plugin
7
+ *
8
+ * Provides AI capabilities through the Vercel AI Gateway, which provides
9
+ * access to multiple AI model providers (OpenAI, Anthropic, Google, etc.)
10
+ * through a single OpenAI-compatible API endpoint.
11
+ *
12
+ * Uses 'hybrid' configuration mode - admin can set a shared API key via
13
+ * environment variable, and users can optionally override with their own.
14
+ */
15
+ declare class VercelAiGatewayPlugin extends BaseAiProvider {
16
+ readonly id = "vercel-ai-gateway";
17
+ readonly name = "Vercel AI Gateway";
18
+ readonly version = "1.0.0";
19
+ readonly providerType = "vercel-ai-gateway";
20
+ readonly providerName = "Vercel AI Gateway";
21
+ readonly configurationMode: ConfigurationMode;
22
+ readonly settingsSchema: JsonSchema;
23
+ onLoad(context: PluginContext): Promise<void>;
24
+ onUnload(): Promise<void>;
25
+ protected getDefaultModelId(): string;
26
+ createChatCompletion(options: ChatCompletionOptions): Promise<ChatCompletionResponse>;
27
+ createStreamingChatCompletion(options: ChatCompletionOptions): AsyncIterable<ChatCompletionChunk>;
28
+ createEmbedding(options: EmbeddingOptions): Promise<EmbeddingResponse>;
29
+ listModels(settings?: PluginSettings): Promise<readonly AiModel[]>;
30
+ isAvailable(settings?: PluginSettings): Promise<boolean>;
31
+ getCapabilities(): AiModelCapabilities;
32
+ healthCheck(): Promise<PluginHealthCheck>;
33
+ getManifest(): PluginManifest;
34
+ /**
35
+ * Resolve configuration from plugin settings (user > admin > plugin defaults).
36
+ * Vercel AI Gateway overrides the base implementation to use stricter type checks.
37
+ */
38
+ protected resolveConfig(settings?: PluginSettings): Partial<AiOperationsConfig>;
39
+ }
40
+
41
+ export { VercelAiGatewayPlugin, VercelAiGatewayPlugin as default };
@@ -0,0 +1,41 @@
1
+ import { BaseAiProvider } from '@ever-works/plugin/abstract';
2
+ import { ConfigurationMode, JsonSchema, PluginContext, ChatCompletionOptions, ChatCompletionResponse, ChatCompletionChunk, EmbeddingOptions, EmbeddingResponse, PluginSettings, AiModel, AiModelCapabilities, PluginHealthCheck, PluginManifest } from '@ever-works/plugin';
3
+ import { AiOperationsConfig } from '@ever-works/plugin/ai';
4
+
5
+ /**
6
+ * Vercel AI Gateway provider plugin
7
+ *
8
+ * Provides AI capabilities through the Vercel AI Gateway, which provides
9
+ * access to multiple AI model providers (OpenAI, Anthropic, Google, etc.)
10
+ * through a single OpenAI-compatible API endpoint.
11
+ *
12
+ * Uses 'hybrid' configuration mode - admin can set a shared API key via
13
+ * environment variable, and users can optionally override with their own.
14
+ */
15
+ declare class VercelAiGatewayPlugin extends BaseAiProvider {
16
+ readonly id = "vercel-ai-gateway";
17
+ readonly name = "Vercel AI Gateway";
18
+ readonly version = "1.0.0";
19
+ readonly providerType = "vercel-ai-gateway";
20
+ readonly providerName = "Vercel AI Gateway";
21
+ readonly configurationMode: ConfigurationMode;
22
+ readonly settingsSchema: JsonSchema;
23
+ onLoad(context: PluginContext): Promise<void>;
24
+ onUnload(): Promise<void>;
25
+ protected getDefaultModelId(): string;
26
+ createChatCompletion(options: ChatCompletionOptions): Promise<ChatCompletionResponse>;
27
+ createStreamingChatCompletion(options: ChatCompletionOptions): AsyncIterable<ChatCompletionChunk>;
28
+ createEmbedding(options: EmbeddingOptions): Promise<EmbeddingResponse>;
29
+ listModels(settings?: PluginSettings): Promise<readonly AiModel[]>;
30
+ isAvailable(settings?: PluginSettings): Promise<boolean>;
31
+ getCapabilities(): AiModelCapabilities;
32
+ healthCheck(): Promise<PluginHealthCheck>;
33
+ getManifest(): PluginManifest;
34
+ /**
35
+ * Resolve configuration from plugin settings (user > admin > plugin defaults).
36
+ * Vercel AI Gateway overrides the base implementation to use stricter type checks.
37
+ */
38
+ protected resolveConfig(settings?: PluginSettings): Partial<AiOperationsConfig>;
39
+ }
40
+
41
+ export { VercelAiGatewayPlugin, VercelAiGatewayPlugin as default };