llm-strings 1.5.0 → 1.5.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/parse.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as HostAlias } from './provider-core-B1GMszQP.cjs';
1
+ import { a as HostAlias } from './provider-core-CjpJ4qyF.cjs';
2
2
 
3
3
  interface LlmConnectionConfig {
4
4
  /** The original connection string */
package/dist/parse.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as HostAlias } from './provider-core-B1GMszQP.js';
1
+ import { a as HostAlias } from './provider-core-CjpJ4qyF.js';
2
2
 
3
3
  interface LlmConnectionConfig {
4
4
  /** The original connection string */
package/dist/parse.js CHANGED
@@ -1,9 +1 @@
1
- import {
2
- build,
3
- parse
4
- } from "./chunk-6HQOCOQI.js";
5
- import "./chunk-PCJDQTOV.js";
6
- export {
7
- build,
8
- parse
9
- };
1
+ import{build as o,parse as r}from"./chunk-M5ENVTNI.js";import"./chunk-LIYUWJME.js";export{o as build,r as parse};
@@ -25,14 +25,7 @@ declare function detectProvider(host: string): Provider | undefined;
25
25
  * Canonical names use snake_case and follow OpenAI conventions where possible.
26
26
  */
27
27
  declare const ALIASES: Record<string, string>;
28
- /**
29
- * Canonical param name → provider-specific API param name.
30
- * Only includes params the provider actually supports.
31
- */
32
- declare const PROVIDER_PARAMS: Record<Provider, Record<string, string>>;
33
- /**
34
- * Validation specs per provider, keyed by provider-specific param name.
35
- */
28
+ /** Validation spec for a single provider parameter. */
36
29
  interface ParamSpec {
37
30
  type: "number" | "string" | "boolean";
38
31
  min?: number;
@@ -41,7 +34,39 @@ interface ParamSpec {
41
34
  default?: string | number | boolean;
42
35
  description?: string;
43
36
  }
37
+ /**
38
+ * All per-provider configuration in one place.
39
+ * To add a new provider: add it to the Provider type, HOST_ALIASES,
40
+ * detectProvider, and add an entry to PROVIDER_DEFINITIONS below.
41
+ */
42
+ interface ProviderDefinition {
43
+ /** Canonical param name → provider-specific API param name. */
44
+ params: Record<string, string>;
45
+ /** Provider-specific param name → validation spec. */
46
+ specs: Record<string, ParamSpec>;
47
+ /** Cache value accepted by this provider (e.g. "ephemeral"). Absent = automatic or unsupported. */
48
+ cacheValue?: string;
49
+ /** Valid cache TTL strings. Absent = no TTL selection. */
50
+ cacheTtls?: string[];
51
+ }
52
+ declare const PROVIDER_DEFINITIONS: Record<Provider, ProviderDefinition>;
53
+ /** Canonical param name → provider-specific API param name. */
54
+ declare const PROVIDER_PARAMS: Record<Provider, Record<string, string>>;
55
+ /** Validation specs per provider, keyed by provider-specific param name. */
44
56
  declare const PARAM_SPECS: Record<Provider, Record<string, ParamSpec>>;
57
+ /**
58
+ * Cache value normalization per provider.
59
+ * Omitted providers auto-cache (OpenAI) or don't support the param at all.
60
+ */
61
+ declare const CACHE_VALUES: Partial<Record<Provider, string>>;
62
+ /** Valid cache TTL values per provider. Omitted providers don't support TTL selection. */
63
+ declare const CACHE_TTLS: Partial<Record<Provider, string[]>>;
64
+ /**
65
+ * Extra reasoning model family prefixes beyond what the patterns below detect.
66
+ * The o-series (o1, o3, …) and gpt-[5-9] series are auto-detected by pattern.
67
+ * Add a new entry here only for future series with different naming conventions.
68
+ */
69
+ declare const REASONING_MODEL_PREFIXES: readonly string[];
45
70
  /** OpenAI reasoning models don't support standard sampling params. */
46
71
  declare function isReasoningModel(model: string): boolean;
47
72
  /** Providers that can route to OpenAI models (and need reasoning-model checks). */
@@ -63,9 +88,5 @@ type BedrockModelFamily = "anthropic" | "meta" | "amazon" | "mistral" | "cohere"
63
88
  declare function detectBedrockModelFamily(model: string): BedrockModelFamily | undefined;
64
89
  /** Whether a Bedrock model supports prompt caching (Claude and Nova only). */
65
90
  declare function bedrockSupportsCaching(model: string): boolean;
66
- /** Cache value normalization per provider. */
67
- declare const CACHE_VALUES: Record<Provider, string | undefined>;
68
- /** Valid cache TTL values per provider. */
69
- declare const CACHE_TTLS: Record<Provider, string[] | undefined>;
70
91
 
71
- export { ALIASES as A, type BedrockModelFamily as B, CACHE_TTLS as C, HOST_ALIASES as H, type Provider as P, REASONING_MODEL_UNSUPPORTED as R, type HostAlias as a, type HostResolution as b, CACHE_VALUES as c, PARAM_SPECS as d, PROVIDER_PARAMS as e, type ParamSpec as f, bedrockSupportsCaching as g, canHostOpenAIModels as h, detectBedrockModelFamily as i, detectGatewaySubProvider as j, detectProvider as k, isGatewayProvider as l, isReasoningModel as m, modelMatchesFamily as n, providerFromHostAlias as p, resolveHostAlias as r };
92
+ export { ALIASES as A, type BedrockModelFamily as B, CACHE_TTLS as C, HOST_ALIASES as H, type Provider as P, REASONING_MODEL_PREFIXES as R, type HostAlias as a, type HostResolution as b, CACHE_VALUES as c, PARAM_SPECS as d, PROVIDER_DEFINITIONS as e, PROVIDER_PARAMS as f, type ParamSpec as g, type ProviderDefinition as h, REASONING_MODEL_UNSUPPORTED as i, bedrockSupportsCaching as j, canHostOpenAIModels as k, detectBedrockModelFamily as l, detectGatewaySubProvider as m, detectProvider as n, isGatewayProvider as o, isReasoningModel as p, modelMatchesFamily as q, resolveHostAlias as r, providerFromHostAlias as s };
@@ -25,14 +25,7 @@ declare function detectProvider(host: string): Provider | undefined;
25
25
  * Canonical names use snake_case and follow OpenAI conventions where possible.
26
26
  */
27
27
  declare const ALIASES: Record<string, string>;
28
- /**
29
- * Canonical param name → provider-specific API param name.
30
- * Only includes params the provider actually supports.
31
- */
32
- declare const PROVIDER_PARAMS: Record<Provider, Record<string, string>>;
33
- /**
34
- * Validation specs per provider, keyed by provider-specific param name.
35
- */
28
+ /** Validation spec for a single provider parameter. */
36
29
  interface ParamSpec {
37
30
  type: "number" | "string" | "boolean";
38
31
  min?: number;
@@ -41,7 +34,39 @@ interface ParamSpec {
41
34
  default?: string | number | boolean;
42
35
  description?: string;
43
36
  }
37
+ /**
38
+ * All per-provider configuration in one place.
39
+ * To add a new provider: add it to the Provider type, HOST_ALIASES,
40
+ * detectProvider, and add an entry to PROVIDER_DEFINITIONS below.
41
+ */
42
+ interface ProviderDefinition {
43
+ /** Canonical param name → provider-specific API param name. */
44
+ params: Record<string, string>;
45
+ /** Provider-specific param name → validation spec. */
46
+ specs: Record<string, ParamSpec>;
47
+ /** Cache value accepted by this provider (e.g. "ephemeral"). Absent = automatic or unsupported. */
48
+ cacheValue?: string;
49
+ /** Valid cache TTL strings. Absent = no TTL selection. */
50
+ cacheTtls?: string[];
51
+ }
52
+ declare const PROVIDER_DEFINITIONS: Record<Provider, ProviderDefinition>;
53
+ /** Canonical param name → provider-specific API param name. */
54
+ declare const PROVIDER_PARAMS: Record<Provider, Record<string, string>>;
55
+ /** Validation specs per provider, keyed by provider-specific param name. */
44
56
  declare const PARAM_SPECS: Record<Provider, Record<string, ParamSpec>>;
57
+ /**
58
+ * Cache value normalization per provider.
59
+ * Omitted providers auto-cache (OpenAI) or don't support the param at all.
60
+ */
61
+ declare const CACHE_VALUES: Partial<Record<Provider, string>>;
62
+ /** Valid cache TTL values per provider. Omitted providers don't support TTL selection. */
63
+ declare const CACHE_TTLS: Partial<Record<Provider, string[]>>;
64
+ /**
65
+ * Extra reasoning model family prefixes beyond what the patterns below detect.
66
+ * The o-series (o1, o3, …) and gpt-[5-9] series are auto-detected by pattern.
67
+ * Add a new entry here only for future series with different naming conventions.
68
+ */
69
+ declare const REASONING_MODEL_PREFIXES: readonly string[];
45
70
  /** OpenAI reasoning models don't support standard sampling params. */
46
71
  declare function isReasoningModel(model: string): boolean;
47
72
  /** Providers that can route to OpenAI models (and need reasoning-model checks). */
@@ -63,9 +88,5 @@ type BedrockModelFamily = "anthropic" | "meta" | "amazon" | "mistral" | "cohere"
63
88
  declare function detectBedrockModelFamily(model: string): BedrockModelFamily | undefined;
64
89
  /** Whether a Bedrock model supports prompt caching (Claude and Nova only). */
65
90
  declare function bedrockSupportsCaching(model: string): boolean;
66
- /** Cache value normalization per provider. */
67
- declare const CACHE_VALUES: Record<Provider, string | undefined>;
68
- /** Valid cache TTL values per provider. */
69
- declare const CACHE_TTLS: Record<Provider, string[] | undefined>;
70
91
 
71
- export { ALIASES as A, type BedrockModelFamily as B, CACHE_TTLS as C, HOST_ALIASES as H, type Provider as P, REASONING_MODEL_UNSUPPORTED as R, type HostAlias as a, type HostResolution as b, CACHE_VALUES as c, PARAM_SPECS as d, PROVIDER_PARAMS as e, type ParamSpec as f, bedrockSupportsCaching as g, canHostOpenAIModels as h, detectBedrockModelFamily as i, detectGatewaySubProvider as j, detectProvider as k, isGatewayProvider as l, isReasoningModel as m, modelMatchesFamily as n, providerFromHostAlias as p, resolveHostAlias as r };
92
+ export { ALIASES as A, type BedrockModelFamily as B, CACHE_TTLS as C, HOST_ALIASES as H, type Provider as P, REASONING_MODEL_PREFIXES as R, type HostAlias as a, type HostResolution as b, CACHE_VALUES as c, PARAM_SPECS as d, PROVIDER_DEFINITIONS as e, PROVIDER_PARAMS as f, type ParamSpec as g, type ProviderDefinition as h, REASONING_MODEL_UNSUPPORTED as i, bedrockSupportsCaching as j, canHostOpenAIModels as k, detectBedrockModelFamily as l, detectGatewaySubProvider as m, detectProvider as n, isGatewayProvider as o, isReasoningModel as p, modelMatchesFamily as q, resolveHostAlias as r, providerFromHostAlias as s };