@jsonstudio/llms 0.6.34 → 0.6.74
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/conversion/codecs/gemini-openai-codec.js +1 -2
- package/dist/conversion/codecs/responses-openai-codec.js +16 -1
- package/dist/conversion/compat/profiles/chat-glm.json +17 -0
- package/dist/conversion/compat/profiles/chat-iflow.json +36 -0
- package/dist/conversion/compat/profiles/chat-lmstudio.json +37 -0
- package/dist/conversion/compat/profiles/chat-qwen.json +18 -0
- package/dist/conversion/compat/profiles/responses-c4m.json +45 -0
- package/dist/conversion/config/compat-profiles.json +38 -0
- package/dist/conversion/config/sample-config.json +314 -0
- package/dist/conversion/config/version-switch.json +150 -0
- package/dist/conversion/hub/pipeline/compat/compat-engine.d.ts +4 -0
- package/dist/conversion/hub/pipeline/compat/compat-engine.js +667 -0
- package/dist/conversion/hub/pipeline/compat/compat-profile-store.d.ts +2 -0
- package/dist/conversion/hub/pipeline/compat/compat-profile-store.js +76 -0
- package/dist/conversion/hub/pipeline/compat/compat-types.d.ts +62 -0
- package/dist/conversion/hub/pipeline/compat/compat-types.js +1 -0
- package/dist/conversion/hub/pipeline/hub-pipeline.d.ts +1 -0
- package/dist/conversion/hub/pipeline/hub-pipeline.js +76 -28
- package/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.js +0 -13
- package/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.d.ts +14 -0
- package/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.js +23 -0
- package/dist/conversion/hub/response/provider-response.js +18 -0
- package/dist/conversion/hub/response/response-mappers.d.ts +1 -1
- package/dist/conversion/hub/response/response-mappers.js +2 -12
- package/dist/conversion/responses/responses-openai-bridge.d.ts +1 -0
- package/dist/conversion/responses/responses-openai-bridge.js +71 -0
- package/dist/conversion/shared/responses-output-builder.js +22 -43
- package/dist/conversion/shared/responses-response-utils.js +1 -47
- package/dist/conversion/shared/text-markup-normalizer.js +2 -2
- package/dist/conversion/shared/tool-canonicalizer.js +16 -118
- package/dist/conversion/shared/tool-filter-pipeline.js +63 -21
- package/dist/conversion/shared/tool-mapping.js +52 -32
- package/dist/filters/config/openai-openai.fieldmap.json +18 -0
- package/dist/filters/special/request-tools-normalize.js +20 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/router/virtual-router/bootstrap.js +18 -33
- package/dist/router/virtual-router/classifier.js +51 -77
- package/dist/router/virtual-router/features.js +338 -111
- package/dist/router/virtual-router/types.d.ts +2 -4
- package/dist/router/virtual-router/types.js +2 -2
- package/dist/sse/sse-to-json/builders/response-builder.js +1 -0
- package/dist/tools/tool-registry.js +4 -3
- package/package.json +3 -3
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"defaultVersion": "v2",
|
|
3
|
+
"envVarName": "LLMSWITCH_CONVERTER_VERSION",
|
|
4
|
+
"allowRuntimeSwitch": true,
|
|
5
|
+
"versionPriority": {
|
|
6
|
+
"v2": 1,
|
|
7
|
+
"v3": 2,
|
|
8
|
+
"auto": 0
|
|
9
|
+
},
|
|
10
|
+
"versionSettings": {
|
|
11
|
+
"v2": {
|
|
12
|
+
"description": "Legacy conversion-core implementation",
|
|
13
|
+
"stability": "stable",
|
|
14
|
+
"features": [
|
|
15
|
+
"proven_stability",
|
|
16
|
+
"comprehensive_coverage",
|
|
17
|
+
"extensive_testing"
|
|
18
|
+
],
|
|
19
|
+
"performance": "baseline",
|
|
20
|
+
"recommendedFor": [
|
|
21
|
+
"production",
|
|
22
|
+
"legacy_compatibility",
|
|
23
|
+
"maximum_stability"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"v3": {
|
|
27
|
+
"description": "New node-based pipeline architecture",
|
|
28
|
+
"stability": "beta",
|
|
29
|
+
"features": [
|
|
30
|
+
"intelligent_passthrough",
|
|
31
|
+
"node_based_processing",
|
|
32
|
+
"automatic_optimization",
|
|
33
|
+
"zero_config"
|
|
34
|
+
],
|
|
35
|
+
"performance": "optimized",
|
|
36
|
+
"recommendedFor": [
|
|
37
|
+
"development",
|
|
38
|
+
"performance_critical",
|
|
39
|
+
"new_features"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"auto": {
|
|
43
|
+
"description": "Automatically select best version based on request",
|
|
44
|
+
"stability": "dynamic",
|
|
45
|
+
"features": [
|
|
46
|
+
"smart_selection",
|
|
47
|
+
"performance_optimization",
|
|
48
|
+
"adaptive_behavior"
|
|
49
|
+
],
|
|
50
|
+
"performance": "variable",
|
|
51
|
+
"recommendedFor": [
|
|
52
|
+
"testing",
|
|
53
|
+
"benchmarking",
|
|
54
|
+
"a_b_testing"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"switchingRules": {
|
|
59
|
+
"autoSelection": {
|
|
60
|
+
"simpleRequests": {
|
|
61
|
+
"conditions": {
|
|
62
|
+
"messageCount": "<= 5",
|
|
63
|
+
"toolCount": 0,
|
|
64
|
+
"streaming": false
|
|
65
|
+
},
|
|
66
|
+
"preferredVersion": "v3",
|
|
67
|
+
"reason": "Simple requests benefit from v3 passthrough optimization"
|
|
68
|
+
},
|
|
69
|
+
"complexRequests": {
|
|
70
|
+
"conditions": {
|
|
71
|
+
"messageCount": "> 20",
|
|
72
|
+
"toolCount": "> 10",
|
|
73
|
+
"hasStreaming": true
|
|
74
|
+
},
|
|
75
|
+
"preferredVersion": "v2",
|
|
76
|
+
"reason": "Complex requests benefit from v2 stability"
|
|
77
|
+
},
|
|
78
|
+
"toolHeavyRequests": {
|
|
79
|
+
"conditions": {
|
|
80
|
+
"toolCount": "> 5",
|
|
81
|
+
"hasComplexTools": true
|
|
82
|
+
},
|
|
83
|
+
"preferredVersion": "v3",
|
|
84
|
+
"reason": "V3 has better tool processing architecture"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"fallbackRules": {
|
|
88
|
+
"v3FallbackToV2": {
|
|
89
|
+
"conditions": [
|
|
90
|
+
"conversion_error",
|
|
91
|
+
"timeout",
|
|
92
|
+
"unsupported_endpoint"
|
|
93
|
+
],
|
|
94
|
+
"retryCount": 3
|
|
95
|
+
},
|
|
96
|
+
"v2FallbackToV3": {
|
|
97
|
+
"conditions": [
|
|
98
|
+
"performance_degradation",
|
|
99
|
+
"memory_pressure"
|
|
100
|
+
],
|
|
101
|
+
"retryCount": 1
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"monitoring": {
|
|
106
|
+
"enabled": true,
|
|
107
|
+
"metrics": [
|
|
108
|
+
"conversion_success_rate",
|
|
109
|
+
"average_latency",
|
|
110
|
+
"passthrough_rate",
|
|
111
|
+
"error_rate_by_version",
|
|
112
|
+
"performance_comparison"
|
|
113
|
+
],
|
|
114
|
+
"alertThresholds": {
|
|
115
|
+
"errorRate": 0.05,
|
|
116
|
+
"latencyIncrease": 2.0,
|
|
117
|
+
"successRateDrop": 0.1
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"hooks": {
|
|
121
|
+
"beforeSwitch": {
|
|
122
|
+
"logLevel": "info",
|
|
123
|
+
"metrics": true
|
|
124
|
+
},
|
|
125
|
+
"afterSwitch": {
|
|
126
|
+
"logLevel": "info",
|
|
127
|
+
"metrics": true,
|
|
128
|
+
"validate": true
|
|
129
|
+
},
|
|
130
|
+
"onError": {
|
|
131
|
+
"logLevel": "error",
|
|
132
|
+
"metrics": true,
|
|
133
|
+
"escalate": true
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"testing": {
|
|
137
|
+
"enabled": false,
|
|
138
|
+
"canaryDeployment": {
|
|
139
|
+
"percentage": 0.1,
|
|
140
|
+
"version": "v3"
|
|
141
|
+
},
|
|
142
|
+
"abTesting": {
|
|
143
|
+
"enabled": false,
|
|
144
|
+
"split": {
|
|
145
|
+
"v2": 0.5,
|
|
146
|
+
"v3": 0.5
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { JsonObject } from '../../types/json.js';
|
|
2
|
+
import type { CompatApplicationResult } from './compat-types.js';
|
|
3
|
+
export declare function applyRequestCompat(profileId: string | undefined, payload: JsonObject): CompatApplicationResult;
|
|
4
|
+
export declare function applyResponseCompat(profileId: string | undefined, payload: JsonObject): CompatApplicationResult;
|