@jsonstudio/llms 0.6.626 → 0.6.631

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.
@@ -1,17 +1,17 @@
1
1
  {
2
- "id": "chat:gemini",
3
- "protocol": "gemini-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "claude_thinking_tool_schema" },
8
- {
9
- "action": "gemini_web_search_request"
10
- },
11
- { "action": "snapshot", "phase": "compat-post" }
12
- ]
13
- },
14
- "response": {
15
- "mappings": []
16
- }
2
+ "id": "chat:gemini",
3
+ "protocol": "gemini-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "claude_thinking_tool_schema" },
8
+ {
9
+ "action": "gemini_web_search_request"
10
+ },
11
+ { "action": "snapshot", "phase": "compat-post" }
12
+ ]
13
+ },
14
+ "response": {
15
+ "mappings": []
16
+ }
17
17
  }
@@ -1,204 +1,204 @@
1
1
  {
2
- "id": "chat:glm",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- {
9
- "action": "remove",
10
- "path": "parallel_tool_calls"
2
+ "id": "chat:glm",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ {
9
+ "action": "remove",
10
+ "path": "parallel_tool_calls"
11
+ },
12
+ {
13
+ "action": "glm_image_content"
14
+ },
15
+ {
16
+ "action": "glm_vision_prompt"
17
+ },
18
+ {
19
+ "action": "rename",
20
+ "from": "response_format",
21
+ "to": "metadata.generation.response_format"
22
+ },
23
+ {
24
+ "action": "remove",
25
+ "path": "metadata.clientModelId"
26
+ },
27
+ {
28
+ "action": "shape_filter",
29
+ "target": "request",
30
+ "config": {
31
+ "request": {
32
+ "allowTopLevel": [
33
+ "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
34
+ "max_tokens", "tools", "tool_choice", "stop", "response_format", "web_search"
35
+ ],
36
+ "messages": {
37
+ "allowedRoles": ["system", "user", "assistant", "tool"],
38
+ "assistantWithToolCallsContentNull": true,
39
+ "toolContentStringify": false
11
40
  },
12
- {
13
- "action": "glm_image_content"
41
+ "messagesRules": [],
42
+ "tools": {
43
+ "normalize": false,
44
+ "forceToolChoiceAuto": true
14
45
  },
15
- {
16
- "action": "glm_vision_prompt"
46
+ "assistantToolCalls": { "functionArgumentsType": "string" }
47
+ },
48
+ "response": {
49
+ "allowTopLevel": [
50
+ "id", "request_id", "created", "model",
51
+ "choices", "usage", "video_result", "web_search", "content_filter",
52
+ "required_action", "output", "output_text", "status"
53
+ ],
54
+ "choices": {
55
+ "required": true,
56
+ "message": {
57
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
58
+ "roleDefault": "assistant",
59
+ "contentNullWhenToolCalls": true,
60
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
61
+ },
62
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
17
63
  },
18
- {
19
- "action": "rename",
20
- "from": "response_format",
21
- "to": "metadata.generation.response_format"
22
- },
23
- {
24
- "action": "remove",
25
- "path": "metadata.clientModelId"
26
- },
27
- {
28
- "action": "shape_filter",
29
- "target": "request",
30
- "config": {
31
- "request": {
32
- "allowTopLevel": [
33
- "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
34
- "max_tokens", "tools", "tool_choice", "stop", "response_format", "web_search"
35
- ],
36
- "messages": {
37
- "allowedRoles": ["system", "user", "assistant", "tool"],
38
- "assistantWithToolCallsContentNull": true,
39
- "toolContentStringify": false
40
- },
41
- "messagesRules": [],
42
- "tools": {
43
- "normalize": false,
44
- "forceToolChoiceAuto": true
45
- },
46
- "assistantToolCalls": { "functionArgumentsType": "string" }
47
- },
48
- "response": {
49
- "allowTopLevel": [
50
- "id", "request_id", "created", "model",
51
- "choices", "usage", "video_result", "web_search", "content_filter",
52
- "required_action", "output", "output_text", "status"
53
- ],
54
- "choices": {
55
- "required": true,
56
- "message": {
57
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
58
- "roleDefault": "assistant",
59
- "contentNullWhenToolCalls": true,
60
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
61
- },
62
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
63
- },
64
- "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
65
- }
66
- }
67
- },
68
- {
69
- "action": "apply_rules",
70
- "config": {
71
- "tools": {
72
- "function": {
73
- "removeKeys": ["strict", "json_schema"]
74
- }
75
- },
76
- "messages": {
77
- "assistantToolCalls": {
78
- "function": {
79
- "removeKeys": ["strict"]
80
- }
81
- }
82
- },
83
- "topLevel": {
84
- "conditional": [
85
- { "when": { "tools": "empty" }, "remove": ["tool_choice"] }
86
- ]
87
- }
88
- }
89
- },
90
- {
91
- "action": "field_map",
92
- "direction": "incoming",
93
- "config": [
94
- { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
95
- { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
96
- { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
97
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
98
- { "sourcePath": "model", "targetPath": "model", "type": "string", "transform": "normalizeModelName" },
99
- {
100
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
101
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
102
- "type": "string"
103
- }
104
- ]
105
- },
106
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
107
- {
108
- "action": "glm_web_search_request"
109
- },
110
- {
111
- "action": "auto_thinking",
112
- "config": {
113
- "modelPrefixes": ["glm-4.7", "glm-4.6", "glm-4.5", "glm-z1"],
114
- "excludePrefixes": ["glm-4.6v"]
115
- }
116
- },
117
- { "action": "snapshot", "phase": "compat-post" },
118
- { "action": "dto_rewrap" }
64
+ "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
65
+ }
66
+ }
67
+ },
68
+ {
69
+ "action": "apply_rules",
70
+ "config": {
71
+ "tools": {
72
+ "function": {
73
+ "removeKeys": ["strict", "json_schema"]
74
+ }
75
+ },
76
+ "messages": {
77
+ "assistantToolCalls": {
78
+ "function": {
79
+ "removeKeys": ["strict"]
80
+ }
81
+ }
82
+ },
83
+ "topLevel": {
84
+ "conditional": [
85
+ { "when": { "tools": "empty" }, "remove": ["tool_choice"] }
86
+ ]
87
+ }
88
+ }
89
+ },
90
+ {
91
+ "action": "field_map",
92
+ "direction": "incoming",
93
+ "config": [
94
+ { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
95
+ { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
96
+ { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
97
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
98
+ { "sourcePath": "model", "targetPath": "model", "type": "string", "transform": "normalizeModelName" },
99
+ {
100
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
101
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
102
+ "type": "string"
103
+ }
119
104
  ]
120
- },
121
- "response": {
122
- "mappings": [
123
- { "action": "snapshot", "phase": "compat-pre" },
124
- { "action": "dto_unwrap" },
125
- {
126
- "action": "resp_blacklist",
127
- "config": {
128
- "paths": ["usage.prompt_tokens_details.cached_tokens"],
129
- "keepCritical": true
130
- }
105
+ },
106
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
107
+ {
108
+ "action": "glm_web_search_request"
109
+ },
110
+ {
111
+ "action": "auto_thinking",
112
+ "config": {
113
+ "modelPrefixes": ["glm-4.7", "glm-4.6", "glm-4.5", "glm-z1"],
114
+ "excludePrefixes": ["glm-4.6v"]
115
+ }
116
+ },
117
+ { "action": "snapshot", "phase": "compat-post" },
118
+ { "action": "dto_rewrap" }
119
+ ]
120
+ },
121
+ "response": {
122
+ "mappings": [
123
+ { "action": "snapshot", "phase": "compat-pre" },
124
+ { "action": "dto_unwrap" },
125
+ {
126
+ "action": "resp_blacklist",
127
+ "config": {
128
+ "paths": ["usage.prompt_tokens_details.cached_tokens"],
129
+ "keepCritical": true
130
+ }
131
+ },
132
+ {
133
+ "action": "shape_filter",
134
+ "target": "response",
135
+ "config": {
136
+ "request": {
137
+ "allowTopLevel": [
138
+ "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
139
+ "max_tokens", "tools", "tool_choice", "stop", "response_format"
140
+ ],
141
+ "messages": {
142
+ "allowedRoles": ["system", "user", "assistant", "tool"],
143
+ "assistantWithToolCallsContentNull": true,
144
+ "toolContentStringify": false
131
145
  },
132
- {
133
- "action": "shape_filter",
134
- "target": "response",
135
- "config": {
136
- "request": {
137
- "allowTopLevel": [
138
- "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
139
- "max_tokens", "tools", "tool_choice", "stop", "response_format"
140
- ],
141
- "messages": {
142
- "allowedRoles": ["system", "user", "assistant", "tool"],
143
- "assistantWithToolCallsContentNull": true,
144
- "toolContentStringify": false
145
- },
146
- "messagesRules": [],
147
- "tools": {
148
- "normalize": false,
149
- "forceToolChoiceAuto": true
150
- },
151
- "assistantToolCalls": { "functionArgumentsType": "string" }
152
- },
153
- "response": {
154
- "allowTopLevel": [
155
- "id", "request_id", "created", "model",
156
- "choices", "usage", "video_result", "web_search", "content_filter",
157
- "required_action", "output", "output_text", "status"
158
- ],
159
- "choices": {
160
- "required": true,
161
- "message": {
162
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
163
- "roleDefault": "assistant",
164
- "contentNullWhenToolCalls": true,
165
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
166
- },
167
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
168
- },
169
- "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
170
- }
171
- }
146
+ "messagesRules": [],
147
+ "tools": {
148
+ "normalize": false,
149
+ "forceToolChoiceAuto": true
172
150
  },
173
- {
174
- "action": "field_map",
175
- "direction": "outgoing",
176
- "config": [
177
- { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
178
- { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
179
- { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
180
- { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
181
- { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
182
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
183
- {
184
- "sourcePath": "choices[*].finish_reason",
185
- "targetPath": "choices[*].finish_reason",
186
- "type": "string",
187
- "transform": "normalizeFinishReason"
188
- },
189
- {
190
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
191
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
192
- "type": "string"
193
- }
194
- ]
151
+ "assistantToolCalls": { "functionArgumentsType": "string" }
152
+ },
153
+ "response": {
154
+ "allowTopLevel": [
155
+ "id", "request_id", "created", "model",
156
+ "choices", "usage", "video_result", "web_search", "content_filter",
157
+ "required_action", "output", "output_text", "status"
158
+ ],
159
+ "choices": {
160
+ "required": true,
161
+ "message": {
162
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
163
+ "roleDefault": "assistant",
164
+ "contentNullWhenToolCalls": true,
165
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
166
+ },
167
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
195
168
  },
196
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
197
- { "action": "response_normalize" },
198
- { "action": "extract_glm_tool_markup" },
199
- { "action": "response_validate" },
200
- { "action": "snapshot", "phase": "compat-post" },
201
- { "action": "dto_rewrap" }
169
+ "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
170
+ }
171
+ }
172
+ },
173
+ {
174
+ "action": "field_map",
175
+ "direction": "outgoing",
176
+ "config": [
177
+ { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
178
+ { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
179
+ { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
180
+ { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
181
+ { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
182
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
183
+ {
184
+ "sourcePath": "choices[*].finish_reason",
185
+ "targetPath": "choices[*].finish_reason",
186
+ "type": "string",
187
+ "transform": "normalizeFinishReason"
188
+ },
189
+ {
190
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
191
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
192
+ "type": "string"
193
+ }
202
194
  ]
203
- }
195
+ },
196
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
197
+ { "action": "response_normalize" },
198
+ { "action": "extract_glm_tool_markup" },
199
+ { "action": "response_validate" },
200
+ { "action": "snapshot", "phase": "compat-post" },
201
+ { "action": "dto_rewrap" }
202
+ ]
203
+ }
204
204
  }
@@ -1,208 +1,208 @@
1
1
  {
2
- "id": "chat:iflow",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- {
9
- "action": "remove",
10
- "path": "metadata.toolCallIdStyle"
2
+ "id": "chat:iflow",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ {
9
+ "action": "remove",
10
+ "path": "metadata.toolCallIdStyle"
11
+ },
12
+ {
13
+ "action": "remove",
14
+ "path": "metadata.clientModelId"
15
+ },
16
+ {
17
+ "action": "remove",
18
+ "path": "metadata.providerHint"
19
+ },
20
+ {
21
+ "action": "shape_filter",
22
+ "target": "request",
23
+ "config": {
24
+ "request": {
25
+ "allowTopLevel": [
26
+ "model",
27
+ "messages",
28
+ "stream",
29
+ "thinking",
30
+ "do_sample",
31
+ "temperature",
32
+ "top_p",
33
+ "max_tokens",
34
+ "tools",
35
+ "tool_choice",
36
+ "stop",
37
+ "response_format",
38
+ "web_search"
39
+ ],
40
+ "messages": {
41
+ "allowedRoles": ["system", "user", "assistant", "tool"],
42
+ "assistantWithToolCallsContentNull": true,
43
+ "toolContentStringify": false
11
44
  },
12
- {
13
- "action": "remove",
14
- "path": "metadata.clientModelId"
45
+ "messagesRules": [],
46
+ "tools": {
47
+ "normalize": false,
48
+ "forceToolChoiceAuto": true
15
49
  },
16
- {
17
- "action": "remove",
18
- "path": "metadata.providerHint"
50
+ "assistantToolCalls": { "functionArgumentsType": "string" }
51
+ },
52
+ "response": {
53
+ "allowTopLevel": [
54
+ "id",
55
+ "request_id",
56
+ "created",
57
+ "model",
58
+ "choices",
59
+ "usage",
60
+ "video_result",
61
+ "web_search",
62
+ "content_filter",
63
+ "required_action",
64
+ "output",
65
+ "output_text",
66
+ "status"
67
+ ],
68
+ "choices": {
69
+ "required": true,
70
+ "message": {
71
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
72
+ "roleDefault": "assistant",
73
+ "contentNullWhenToolCalls": true,
74
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
75
+ },
76
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
19
77
  },
20
- {
21
- "action": "shape_filter",
22
- "target": "request",
23
- "config": {
24
- "request": {
25
- "allowTopLevel": [
26
- "model",
27
- "messages",
28
- "stream",
29
- "thinking",
30
- "do_sample",
31
- "temperature",
32
- "top_p",
33
- "max_tokens",
34
- "tools",
35
- "tool_choice",
36
- "stop",
37
- "response_format",
38
- "web_search"
39
- ],
40
- "messages": {
41
- "allowedRoles": ["system", "user", "assistant", "tool"],
42
- "assistantWithToolCallsContentNull": true,
43
- "toolContentStringify": false
44
- },
45
- "messagesRules": [],
46
- "tools": {
47
- "normalize": false,
48
- "forceToolChoiceAuto": true
49
- },
50
- "assistantToolCalls": { "functionArgumentsType": "string" }
51
- },
52
- "response": {
53
- "allowTopLevel": [
54
- "id",
55
- "request_id",
56
- "created",
57
- "model",
58
- "choices",
59
- "usage",
60
- "video_result",
61
- "web_search",
62
- "content_filter",
63
- "required_action",
64
- "output",
65
- "output_text",
66
- "status"
67
- ],
68
- "choices": {
69
- "required": true,
70
- "message": {
71
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
72
- "roleDefault": "assistant",
73
- "contentNullWhenToolCalls": true,
74
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
75
- },
76
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
77
- },
78
- "usage": {
79
- "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
80
- }
81
- }
82
- }
83
- },
84
- {
85
- "action": "field_map",
86
- "direction": "incoming",
87
- "config": [
88
- { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
89
- { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
90
- { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
91
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
92
- {
93
- "sourcePath": "model",
94
- "targetPath": "model",
95
- "type": "string",
96
- "transform": "normalizeModelName"
97
- },
98
- {
99
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
100
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
101
- "type": "string"
102
- }
103
- ]
104
- },
105
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
106
- {
107
- "action": "iflow_web_search_request"
108
- },
109
- { "action": "snapshot", "phase": "compat-post" },
110
- { "action": "dto_rewrap" }
78
+ "usage": {
79
+ "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
80
+ }
81
+ }
82
+ }
83
+ },
84
+ {
85
+ "action": "field_map",
86
+ "direction": "incoming",
87
+ "config": [
88
+ { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
89
+ { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
90
+ { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
91
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
92
+ {
93
+ "sourcePath": "model",
94
+ "targetPath": "model",
95
+ "type": "string",
96
+ "transform": "normalizeModelName"
97
+ },
98
+ {
99
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
100
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
101
+ "type": "string"
102
+ }
111
103
  ]
112
- },
113
- "response": {
114
- "mappings": [
115
- { "action": "snapshot", "phase": "compat-pre" },
116
- { "action": "dto_unwrap" },
117
- {
118
- "action": "shape_filter",
119
- "target": "response",
120
- "config": {
121
- "request": {
122
- "allowTopLevel": [
123
- "model",
124
- "messages",
125
- "stream",
126
- "thinking",
127
- "do_sample",
128
- "temperature",
129
- "top_p",
130
- "max_tokens",
131
- "tools",
132
- "tool_choice",
133
- "stop",
134
- "response_format"
135
- ],
136
- "messages": {
137
- "allowedRoles": ["system", "user", "assistant", "tool"],
138
- "assistantWithToolCallsContentNull": true,
139
- "toolContentStringify": false
140
- },
141
- "messagesRules": [],
142
- "tools": {
143
- "normalize": false,
144
- "forceToolChoiceAuto": true
145
- },
146
- "assistantToolCalls": { "functionArgumentsType": "string" }
147
- },
148
- "response": {
149
- "allowTopLevel": [
150
- "id",
151
- "request_id",
152
- "created",
153
- "model",
154
- "choices",
155
- "usage",
156
- "video_result",
157
- "web_search",
158
- "content_filter",
159
- "required_action",
160
- "output",
161
- "output_text",
162
- "status"
163
- ],
164
- "choices": {
165
- "required": true,
166
- "message": {
167
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
168
- "roleDefault": "assistant",
169
- "contentNullWhenToolCalls": true,
170
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
171
- },
172
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
173
- },
174
- "usage": {
175
- "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
176
- }
177
- }
178
- }
104
+ },
105
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
106
+ {
107
+ "action": "iflow_web_search_request"
108
+ },
109
+ { "action": "snapshot", "phase": "compat-post" },
110
+ { "action": "dto_rewrap" }
111
+ ]
112
+ },
113
+ "response": {
114
+ "mappings": [
115
+ { "action": "snapshot", "phase": "compat-pre" },
116
+ { "action": "dto_unwrap" },
117
+ {
118
+ "action": "shape_filter",
119
+ "target": "response",
120
+ "config": {
121
+ "request": {
122
+ "allowTopLevel": [
123
+ "model",
124
+ "messages",
125
+ "stream",
126
+ "thinking",
127
+ "do_sample",
128
+ "temperature",
129
+ "top_p",
130
+ "max_tokens",
131
+ "tools",
132
+ "tool_choice",
133
+ "stop",
134
+ "response_format"
135
+ ],
136
+ "messages": {
137
+ "allowedRoles": ["system", "user", "assistant", "tool"],
138
+ "assistantWithToolCallsContentNull": true,
139
+ "toolContentStringify": false
140
+ },
141
+ "messagesRules": [],
142
+ "tools": {
143
+ "normalize": false,
144
+ "forceToolChoiceAuto": true
179
145
  },
180
- {
181
- "action": "field_map",
182
- "direction": "outgoing",
183
- "config": [
184
- { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
185
- { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
186
- { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
187
- { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
188
- { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
189
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
190
- {
191
- "sourcePath": "choices[*].finish_reason",
192
- "targetPath": "choices[*].finish_reason",
193
- "type": "string",
194
- "transform": "normalizeFinishReason"
195
- },
196
- {
197
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
198
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
199
- "type": "string"
200
- }
201
- ]
146
+ "assistantToolCalls": { "functionArgumentsType": "string" }
147
+ },
148
+ "response": {
149
+ "allowTopLevel": [
150
+ "id",
151
+ "request_id",
152
+ "created",
153
+ "model",
154
+ "choices",
155
+ "usage",
156
+ "video_result",
157
+ "web_search",
158
+ "content_filter",
159
+ "required_action",
160
+ "output",
161
+ "output_text",
162
+ "status"
163
+ ],
164
+ "choices": {
165
+ "required": true,
166
+ "message": {
167
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
168
+ "roleDefault": "assistant",
169
+ "contentNullWhenToolCalls": true,
170
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
171
+ },
172
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
202
173
  },
203
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
204
- { "action": "snapshot", "phase": "compat-post" },
205
- { "action": "dto_rewrap" }
174
+ "usage": {
175
+ "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
176
+ }
177
+ }
178
+ }
179
+ },
180
+ {
181
+ "action": "field_map",
182
+ "direction": "outgoing",
183
+ "config": [
184
+ { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
185
+ { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
186
+ { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
187
+ { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
188
+ { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
189
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
190
+ {
191
+ "sourcePath": "choices[*].finish_reason",
192
+ "targetPath": "choices[*].finish_reason",
193
+ "type": "string",
194
+ "transform": "normalizeFinishReason"
195
+ },
196
+ {
197
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
198
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
199
+ "type": "string"
200
+ }
206
201
  ]
207
- }
202
+ },
203
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
204
+ { "action": "snapshot", "phase": "compat-post" },
205
+ { "action": "dto_rewrap" }
206
+ ]
207
+ }
208
208
  }
@@ -1,45 +1,45 @@
1
1
  {
2
- "id": "chat:lmstudio",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- {
9
- "action": "normalize_tool_choice",
10
- "path": "tool_choice",
11
- "objectReplacement": "required"
12
- },
13
- { "action": "snapshot", "phase": "compat-post" },
14
- { "action": "dto_rewrap" }
15
- ]
16
- },
17
- "response": {
18
- "mappings": [
19
- { "action": "snapshot", "phase": "compat-pre" },
20
- { "action": "dto_unwrap" },
21
- {
22
- "action": "set_default",
23
- "path": "object",
24
- "value": "chat.completion"
25
- },
26
- {
27
- "action": "set_default",
28
- "path": "id",
29
- "valueSource": "chat_completion_id"
30
- },
31
- {
32
- "action": "set_default",
33
- "path": "created",
34
- "valueSource": "timestamp_seconds"
35
- },
36
- {
37
- "action": "set_default",
38
- "path": "model",
39
- "value": "unknown"
40
- },
41
- { "action": "snapshot", "phase": "compat-post" },
42
- { "action": "dto_rewrap" }
43
- ]
44
- }
2
+ "id": "chat:lmstudio",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ {
9
+ "action": "normalize_tool_choice",
10
+ "path": "tool_choice",
11
+ "objectReplacement": "required"
12
+ },
13
+ { "action": "snapshot", "phase": "compat-post" },
14
+ { "action": "dto_rewrap" }
15
+ ]
16
+ },
17
+ "response": {
18
+ "mappings": [
19
+ { "action": "snapshot", "phase": "compat-pre" },
20
+ { "action": "dto_unwrap" },
21
+ {
22
+ "action": "set_default",
23
+ "path": "object",
24
+ "value": "chat.completion"
25
+ },
26
+ {
27
+ "action": "set_default",
28
+ "path": "id",
29
+ "valueSource": "chat_completion_id"
30
+ },
31
+ {
32
+ "action": "set_default",
33
+ "path": "created",
34
+ "valueSource": "timestamp_seconds"
35
+ },
36
+ {
37
+ "action": "set_default",
38
+ "path": "model",
39
+ "value": "unknown"
40
+ },
41
+ { "action": "snapshot", "phase": "compat-post" },
42
+ { "action": "dto_rewrap" }
43
+ ]
44
+ }
45
45
  }
@@ -1,22 +1,22 @@
1
1
  {
2
- "id": "chat:qwen",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- { "action": "qwen_request_transform" },
9
- { "action": "snapshot", "phase": "compat-post" },
10
- { "action": "dto_rewrap" }
11
- ]
12
- },
13
- "response": {
14
- "mappings": [
15
- { "action": "snapshot", "phase": "compat-pre" },
16
- { "action": "dto_unwrap" },
17
- { "action": "qwen_response_transform" },
18
- { "action": "snapshot", "phase": "compat-post" },
19
- { "action": "dto_rewrap" }
20
- ]
21
- }
2
+ "id": "chat:qwen",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ { "action": "qwen_request_transform" },
9
+ { "action": "snapshot", "phase": "compat-post" },
10
+ { "action": "dto_rewrap" }
11
+ ]
12
+ },
13
+ "response": {
14
+ "mappings": [
15
+ { "action": "snapshot", "phase": "compat-pre" },
16
+ { "action": "dto_unwrap" },
17
+ { "action": "qwen_response_transform" },
18
+ { "action": "snapshot", "phase": "compat-post" },
19
+ { "action": "dto_rewrap" }
20
+ ]
21
+ }
22
22
  }
@@ -1,45 +1,45 @@
1
1
  {
2
- "id": "responses:c4m",
3
- "protocol": "openai-responses",
4
- "request": {
5
- "mappings": [
6
- {
7
- "action": "remove",
8
- "path": "max_tokens"
9
- },
10
- {
11
- "action": "remove",
12
- "path": "maxTokens"
13
- },
14
- {
15
- "action": "remove",
16
- "path": "max_output_tokens"
17
- },
18
- {
19
- "action": "remove",
20
- "path": "maxOutputTokens"
21
- },
22
- {
23
- "action": "inject_instruction",
24
- "sourcePath": "instructions",
25
- "targetPath": "input",
26
- "role": "system",
27
- "contentType": "input_text",
28
- "stripHtml": true,
29
- "maxLengthEnv": [
30
- "ROUTECODEX_C4M_INSTRUCTIONS_MAX",
31
- "RCC_C4M_INSTRUCTIONS_MAX",
32
- "ROUTECODEX_COMPAT_INSTRUCTIONS_MAX"
33
- ]
34
- }
2
+ "id": "responses:c4m",
3
+ "protocol": "openai-responses",
4
+ "request": {
5
+ "mappings": [
6
+ {
7
+ "action": "remove",
8
+ "path": "max_tokens"
9
+ },
10
+ {
11
+ "action": "remove",
12
+ "path": "maxTokens"
13
+ },
14
+ {
15
+ "action": "remove",
16
+ "path": "max_output_tokens"
17
+ },
18
+ {
19
+ "action": "remove",
20
+ "path": "maxOutputTokens"
21
+ },
22
+ {
23
+ "action": "inject_instruction",
24
+ "sourcePath": "instructions",
25
+ "targetPath": "input",
26
+ "role": "system",
27
+ "contentType": "input_text",
28
+ "stripHtml": true,
29
+ "maxLengthEnv": [
30
+ "ROUTECODEX_C4M_INSTRUCTIONS_MAX",
31
+ "RCC_C4M_INSTRUCTIONS_MAX",
32
+ "ROUTECODEX_COMPAT_INSTRUCTIONS_MAX"
35
33
  ]
36
- },
37
- "response": {
38
- "filters": [
39
- {
40
- "action": "rate_limit_text",
41
- "needle": "The Codex-For.ME service is available, but you have reached the request limit"
42
- }
43
- ]
44
- }
34
+ }
35
+ ]
36
+ },
37
+ "response": {
38
+ "filters": [
39
+ {
40
+ "action": "rate_limit_text",
41
+ "needle": "The Codex-For.ME service is available, but you have reached the request limit"
42
+ }
43
+ ]
44
+ }
45
45
  }
@@ -1,11 +1,12 @@
1
1
  {
2
- "id": "responses:output2choices-test",
3
- "protocol": "openai-responses",
4
- "response": {
5
- "mappings": [
6
- {
7
- "action": "convert_responses_output_to_choices"
8
- }
9
- ]
10
- }
2
+ "id": "responses:output2choices-test",
3
+ "protocol": "openai-responses",
4
+ "response": {
5
+ "mappings": [
6
+ {
7
+ "action": "convert_responses_output_to_choices"
8
+ }
9
+ ]
10
+ }
11
11
  }
12
+
@@ -13,11 +13,11 @@ function cloneParameters(value) {
13
13
  const cloned = {};
14
14
  for (const [key, entry] of Object.entries(value)) {
15
15
  // Gemini function_declarations.parameters only support a subset of JSON Schema.
16
- // Drop meta/unsupported fields that cause INVALID_ARGUMENT, such as $schema/exclusiveMinimum.
16
+ // Drop meta/unsupported fields that cause INVALID_ARGUMENT, such as $schema/exclusiveMinimum/propertyNames.
17
17
  if (typeof key === 'string') {
18
18
  if (key.startsWith('$'))
19
19
  continue;
20
- if (key === 'exclusiveMinimum' || key === 'exclusiveMaximum')
20
+ if (key === 'exclusiveMinimum' || key === 'exclusiveMaximum' || key === 'propertyNames')
21
21
  continue;
22
22
  }
23
23
  cloned[key] = cloneParameters(entry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonstudio/llms",
3
- "version": "0.6.626",
3
+ "version": "0.6.631",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",