llm-strings 1.0.0 → 1.0.1
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.
- package/dist/index.d.cts +4 -64
- package/dist/index.d.ts +4 -64
- package/dist/providers.cjs +561 -0
- package/dist/providers.cjs.map +1 -0
- package/dist/providers.d.cts +72 -0
- package/dist/providers.d.ts +72 -0
- package/dist/providers.js +522 -0
- package/dist/providers.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Provider } from './providers.cjs';
|
|
2
|
+
export { ALIASES, BedrockModelFamily, CANONICAL_PARAM_SPECS, CanonicalParamSpec, MODELS, PARAM_SPECS, PROVIDER_META, PROVIDER_PARAMS, ParamSpec, ProviderMeta, REASONING_MODEL_UNSUPPORTED, canHostOpenAIModels, detectBedrockModelFamily, detectProvider, isReasoningModel } from './providers.cjs';
|
|
3
|
+
|
|
1
4
|
interface LlmConnectionConfig {
|
|
2
5
|
/** The original connection string */
|
|
3
6
|
raw: string;
|
|
@@ -29,69 +32,6 @@ declare function parse(connectionString: string): LlmConnectionConfig;
|
|
|
29
32
|
*/
|
|
30
33
|
declare function build(config: Omit<LlmConnectionConfig, "raw">): string;
|
|
31
34
|
|
|
32
|
-
type Provider = "openai" | "anthropic" | "google" | "mistral" | "cohere" | "bedrock" | "openrouter" | "vercel";
|
|
33
|
-
declare function detectProvider(host: string): Provider | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Shorthand aliases → canonical param name.
|
|
36
|
-
* Canonical names use snake_case and follow OpenAI conventions where possible.
|
|
37
|
-
*/
|
|
38
|
-
declare const ALIASES: Record<string, string>;
|
|
39
|
-
/**
|
|
40
|
-
* Canonical param name → provider-specific API param name.
|
|
41
|
-
* Only includes params the provider actually supports.
|
|
42
|
-
*/
|
|
43
|
-
declare const PROVIDER_PARAMS: Record<Provider, Record<string, string>>;
|
|
44
|
-
/**
|
|
45
|
-
* Validation specs per provider, keyed by provider-specific param name.
|
|
46
|
-
*/
|
|
47
|
-
interface ParamSpec {
|
|
48
|
-
type: "number" | "string" | "boolean";
|
|
49
|
-
min?: number;
|
|
50
|
-
max?: number;
|
|
51
|
-
values?: string[];
|
|
52
|
-
}
|
|
53
|
-
declare const PARAM_SPECS: Record<Provider, Record<string, ParamSpec>>;
|
|
54
|
-
/** OpenAI reasoning models don't support standard sampling params. */
|
|
55
|
-
declare function isReasoningModel(model: string): boolean;
|
|
56
|
-
/** Providers that can route to OpenAI models (and need reasoning-model checks). */
|
|
57
|
-
declare function canHostOpenAIModels(provider: Provider): boolean;
|
|
58
|
-
declare const REASONING_MODEL_UNSUPPORTED: Set<string>;
|
|
59
|
-
/**
|
|
60
|
-
* Bedrock model IDs are prefixed with the vendor name.
|
|
61
|
-
* e.g. "anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
62
|
-
*/
|
|
63
|
-
type BedrockModelFamily = "anthropic" | "meta" | "amazon" | "mistral" | "cohere" | "ai21";
|
|
64
|
-
declare function detectBedrockModelFamily(model: string): BedrockModelFamily | undefined;
|
|
65
|
-
interface ProviderMeta {
|
|
66
|
-
/** Provider identifier — matches the Provider union type. */
|
|
67
|
-
id: Provider;
|
|
68
|
-
/** Human-readable display name. */
|
|
69
|
-
name: string;
|
|
70
|
-
/** Default / canonical API hostname. */
|
|
71
|
-
host: string;
|
|
72
|
-
/** Brand color as a CSS hex value. */
|
|
73
|
-
color: string;
|
|
74
|
-
}
|
|
75
|
-
declare const PROVIDER_META: ProviderMeta[];
|
|
76
|
-
/**
|
|
77
|
-
* Suggested / common model IDs per provider, ordered by recency.
|
|
78
|
-
* Not exhaustive — providers add models frequently.
|
|
79
|
-
*/
|
|
80
|
-
declare const MODELS: Record<Provider, string[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Canonical parameter spec — keyed by canonical (snake_case) param names
|
|
83
|
-
* with defaults and descriptions for UI consumption.
|
|
84
|
-
*/
|
|
85
|
-
interface CanonicalParamSpec {
|
|
86
|
-
type: "number" | "string" | "boolean" | "enum";
|
|
87
|
-
min?: number;
|
|
88
|
-
max?: number;
|
|
89
|
-
values?: string[];
|
|
90
|
-
default?: string | number | boolean;
|
|
91
|
-
description?: string;
|
|
92
|
-
}
|
|
93
|
-
declare const CANONICAL_PARAM_SPECS: Record<Provider, Record<string, CanonicalParamSpec>>;
|
|
94
|
-
|
|
95
35
|
interface NormalizeChange {
|
|
96
36
|
from: string;
|
|
97
37
|
to: string;
|
|
@@ -137,4 +77,4 @@ interface ValidateOptions {
|
|
|
137
77
|
*/
|
|
138
78
|
declare function validate(connectionString: string, options?: ValidateOptions): ValidationIssue[];
|
|
139
79
|
|
|
140
|
-
export {
|
|
80
|
+
export { type LlmConnectionConfig, type NormalizeChange, type NormalizeOptions, type NormalizeResult, Provider, type ValidateOptions, type ValidationIssue, build, normalize, parse, validate };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Provider } from './providers.js';
|
|
2
|
+
export { ALIASES, BedrockModelFamily, CANONICAL_PARAM_SPECS, CanonicalParamSpec, MODELS, PARAM_SPECS, PROVIDER_META, PROVIDER_PARAMS, ParamSpec, ProviderMeta, REASONING_MODEL_UNSUPPORTED, canHostOpenAIModels, detectBedrockModelFamily, detectProvider, isReasoningModel } from './providers.js';
|
|
3
|
+
|
|
1
4
|
interface LlmConnectionConfig {
|
|
2
5
|
/** The original connection string */
|
|
3
6
|
raw: string;
|
|
@@ -29,69 +32,6 @@ declare function parse(connectionString: string): LlmConnectionConfig;
|
|
|
29
32
|
*/
|
|
30
33
|
declare function build(config: Omit<LlmConnectionConfig, "raw">): string;
|
|
31
34
|
|
|
32
|
-
type Provider = "openai" | "anthropic" | "google" | "mistral" | "cohere" | "bedrock" | "openrouter" | "vercel";
|
|
33
|
-
declare function detectProvider(host: string): Provider | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Shorthand aliases → canonical param name.
|
|
36
|
-
* Canonical names use snake_case and follow OpenAI conventions where possible.
|
|
37
|
-
*/
|
|
38
|
-
declare const ALIASES: Record<string, string>;
|
|
39
|
-
/**
|
|
40
|
-
* Canonical param name → provider-specific API param name.
|
|
41
|
-
* Only includes params the provider actually supports.
|
|
42
|
-
*/
|
|
43
|
-
declare const PROVIDER_PARAMS: Record<Provider, Record<string, string>>;
|
|
44
|
-
/**
|
|
45
|
-
* Validation specs per provider, keyed by provider-specific param name.
|
|
46
|
-
*/
|
|
47
|
-
interface ParamSpec {
|
|
48
|
-
type: "number" | "string" | "boolean";
|
|
49
|
-
min?: number;
|
|
50
|
-
max?: number;
|
|
51
|
-
values?: string[];
|
|
52
|
-
}
|
|
53
|
-
declare const PARAM_SPECS: Record<Provider, Record<string, ParamSpec>>;
|
|
54
|
-
/** OpenAI reasoning models don't support standard sampling params. */
|
|
55
|
-
declare function isReasoningModel(model: string): boolean;
|
|
56
|
-
/** Providers that can route to OpenAI models (and need reasoning-model checks). */
|
|
57
|
-
declare function canHostOpenAIModels(provider: Provider): boolean;
|
|
58
|
-
declare const REASONING_MODEL_UNSUPPORTED: Set<string>;
|
|
59
|
-
/**
|
|
60
|
-
* Bedrock model IDs are prefixed with the vendor name.
|
|
61
|
-
* e.g. "anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
62
|
-
*/
|
|
63
|
-
type BedrockModelFamily = "anthropic" | "meta" | "amazon" | "mistral" | "cohere" | "ai21";
|
|
64
|
-
declare function detectBedrockModelFamily(model: string): BedrockModelFamily | undefined;
|
|
65
|
-
interface ProviderMeta {
|
|
66
|
-
/** Provider identifier — matches the Provider union type. */
|
|
67
|
-
id: Provider;
|
|
68
|
-
/** Human-readable display name. */
|
|
69
|
-
name: string;
|
|
70
|
-
/** Default / canonical API hostname. */
|
|
71
|
-
host: string;
|
|
72
|
-
/** Brand color as a CSS hex value. */
|
|
73
|
-
color: string;
|
|
74
|
-
}
|
|
75
|
-
declare const PROVIDER_META: ProviderMeta[];
|
|
76
|
-
/**
|
|
77
|
-
* Suggested / common model IDs per provider, ordered by recency.
|
|
78
|
-
* Not exhaustive — providers add models frequently.
|
|
79
|
-
*/
|
|
80
|
-
declare const MODELS: Record<Provider, string[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Canonical parameter spec — keyed by canonical (snake_case) param names
|
|
83
|
-
* with defaults and descriptions for UI consumption.
|
|
84
|
-
*/
|
|
85
|
-
interface CanonicalParamSpec {
|
|
86
|
-
type: "number" | "string" | "boolean" | "enum";
|
|
87
|
-
min?: number;
|
|
88
|
-
max?: number;
|
|
89
|
-
values?: string[];
|
|
90
|
-
default?: string | number | boolean;
|
|
91
|
-
description?: string;
|
|
92
|
-
}
|
|
93
|
-
declare const CANONICAL_PARAM_SPECS: Record<Provider, Record<string, CanonicalParamSpec>>;
|
|
94
|
-
|
|
95
35
|
interface NormalizeChange {
|
|
96
36
|
from: string;
|
|
97
37
|
to: string;
|
|
@@ -137,4 +77,4 @@ interface ValidateOptions {
|
|
|
137
77
|
*/
|
|
138
78
|
declare function validate(connectionString: string, options?: ValidateOptions): ValidationIssue[];
|
|
139
79
|
|
|
140
|
-
export {
|
|
80
|
+
export { type LlmConnectionConfig, type NormalizeChange, type NormalizeOptions, type NormalizeResult, Provider, type ValidateOptions, type ValidationIssue, build, normalize, parse, validate };
|