@jsonstudio/llms 0.6.199 → 0.6.215

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,191 +1,191 @@
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": "rename",
10
- "from": "response_format",
11
- "to": "metadata.generation.response_format"
12
- },
13
- {
14
- "action": "remove",
15
- "path": "metadata.clientModelId"
16
- },
17
- {
18
- "action": "shape_filter",
19
- "target": "request",
20
- "config": {
21
- "request": {
22
- "allowTopLevel": [
23
- "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
24
- "max_tokens", "tools", "tool_choice", "stop", "response_format"
25
- ],
26
- "messages": {
27
- "allowedRoles": ["system", "user", "assistant", "tool"],
28
- "assistantWithToolCallsContentNull": true,
29
- "toolContentStringify": false
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": "rename",
10
+ "from": "response_format",
11
+ "to": "metadata.generation.response_format"
30
12
  },
31
- "messagesRules": [],
32
- "tools": {
33
- "normalize": false,
34
- "forceToolChoiceAuto": true
13
+ {
14
+ "action": "remove",
15
+ "path": "metadata.clientModelId"
35
16
  },
36
- "assistantToolCalls": { "functionArgumentsType": "string" }
37
- },
38
- "response": {
39
- "allowTopLevel": [
40
- "id", "request_id", "created", "model",
41
- "choices", "usage", "video_result", "web_search", "content_filter",
42
- "required_action", "output", "output_text", "status"
43
- ],
44
- "choices": {
45
- "required": true,
46
- "message": {
47
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
48
- "roleDefault": "assistant",
49
- "contentNullWhenToolCalls": true,
50
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
51
- },
52
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
17
+ {
18
+ "action": "shape_filter",
19
+ "target": "request",
20
+ "config": {
21
+ "request": {
22
+ "allowTopLevel": [
23
+ "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
24
+ "max_tokens", "tools", "tool_choice", "stop", "response_format"
25
+ ],
26
+ "messages": {
27
+ "allowedRoles": ["system", "user", "assistant", "tool"],
28
+ "assistantWithToolCallsContentNull": true,
29
+ "toolContentStringify": false
30
+ },
31
+ "messagesRules": [],
32
+ "tools": {
33
+ "normalize": false,
34
+ "forceToolChoiceAuto": true
35
+ },
36
+ "assistantToolCalls": { "functionArgumentsType": "string" }
37
+ },
38
+ "response": {
39
+ "allowTopLevel": [
40
+ "id", "request_id", "created", "model",
41
+ "choices", "usage", "video_result", "web_search", "content_filter",
42
+ "required_action", "output", "output_text", "status"
43
+ ],
44
+ "choices": {
45
+ "required": true,
46
+ "message": {
47
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
48
+ "roleDefault": "assistant",
49
+ "contentNullWhenToolCalls": true,
50
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
51
+ },
52
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
53
+ },
54
+ "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
55
+ }
56
+ }
53
57
  },
54
- "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
55
- }
56
- }
57
- },
58
- {
59
- "action": "apply_rules",
60
- "config": {
61
- "tools": {
62
- "function": {
63
- "removeKeys": ["strict", "json_schema"]
64
- }
65
- },
66
- "messages": {
67
- "assistantToolCalls": {
68
- "function": {
69
- "removeKeys": ["strict"]
70
- }
71
- }
72
- },
73
- "topLevel": {
74
- "conditional": [
75
- { "when": { "tools": "empty" }, "remove": ["tool_choice"] }
76
- ]
77
- }
78
- }
79
- },
80
- {
81
- "action": "field_map",
82
- "direction": "incoming",
83
- "config": [
84
- { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
85
- { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
86
- { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
87
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
88
- { "sourcePath": "model", "targetPath": "model", "type": "string", "transform": "normalizeModelName" },
89
- {
90
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
91
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
92
- "type": "string"
93
- }
58
+ {
59
+ "action": "apply_rules",
60
+ "config": {
61
+ "tools": {
62
+ "function": {
63
+ "removeKeys": ["strict", "json_schema"]
64
+ }
65
+ },
66
+ "messages": {
67
+ "assistantToolCalls": {
68
+ "function": {
69
+ "removeKeys": ["strict"]
70
+ }
71
+ }
72
+ },
73
+ "topLevel": {
74
+ "conditional": [
75
+ { "when": { "tools": "empty" }, "remove": ["tool_choice"] }
76
+ ]
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "action": "field_map",
82
+ "direction": "incoming",
83
+ "config": [
84
+ { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
85
+ { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
86
+ { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
87
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
88
+ { "sourcePath": "model", "targetPath": "model", "type": "string", "transform": "normalizeModelName" },
89
+ {
90
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
91
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
92
+ "type": "string"
93
+ }
94
+ ]
95
+ },
96
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
97
+ {
98
+ "action": "auto_thinking",
99
+ "config": {
100
+ "modelPrefixes": ["glm-4.7", "glm-4.6", "glm-4.5", "glm-z1"],
101
+ "excludePrefixes": ["glm-4.6v"]
102
+ }
103
+ },
104
+ { "action": "snapshot", "phase": "compat-post" },
105
+ { "action": "dto_rewrap" }
94
106
  ]
95
- },
96
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
97
- {
98
- "action": "auto_thinking",
99
- "config": {
100
- "modelPrefixes": ["glm-4.7", "glm-4.6", "glm-4.5", "glm-z1"],
101
- "excludePrefixes": ["glm-4.6v"]
102
- }
103
- },
104
- { "action": "snapshot", "phase": "compat-post" },
105
- { "action": "dto_rewrap" }
106
- ]
107
- },
108
- "response": {
109
- "mappings": [
110
- { "action": "snapshot", "phase": "compat-pre" },
111
- { "action": "dto_unwrap" },
112
- {
113
- "action": "resp_blacklist",
114
- "config": {
115
- "paths": ["usage.prompt_tokens_details.cached_tokens"],
116
- "keepCritical": true
117
- }
118
- },
119
- {
120
- "action": "shape_filter",
121
- "target": "response",
122
- "config": {
123
- "request": {
124
- "allowTopLevel": [
125
- "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
126
- "max_tokens", "tools", "tool_choice", "stop", "response_format"
127
- ],
128
- "messages": {
129
- "allowedRoles": ["system", "user", "assistant", "tool"],
130
- "assistantWithToolCallsContentNull": true,
131
- "toolContentStringify": false
107
+ },
108
+ "response": {
109
+ "mappings": [
110
+ { "action": "snapshot", "phase": "compat-pre" },
111
+ { "action": "dto_unwrap" },
112
+ {
113
+ "action": "resp_blacklist",
114
+ "config": {
115
+ "paths": ["usage.prompt_tokens_details.cached_tokens"],
116
+ "keepCritical": true
117
+ }
132
118
  },
133
- "messagesRules": [],
134
- "tools": {
135
- "normalize": false,
136
- "forceToolChoiceAuto": true
119
+ {
120
+ "action": "shape_filter",
121
+ "target": "response",
122
+ "config": {
123
+ "request": {
124
+ "allowTopLevel": [
125
+ "model", "messages", "stream", "thinking", "do_sample", "temperature", "top_p",
126
+ "max_tokens", "tools", "tool_choice", "stop", "response_format"
127
+ ],
128
+ "messages": {
129
+ "allowedRoles": ["system", "user", "assistant", "tool"],
130
+ "assistantWithToolCallsContentNull": true,
131
+ "toolContentStringify": false
132
+ },
133
+ "messagesRules": [],
134
+ "tools": {
135
+ "normalize": false,
136
+ "forceToolChoiceAuto": true
137
+ },
138
+ "assistantToolCalls": { "functionArgumentsType": "string" }
139
+ },
140
+ "response": {
141
+ "allowTopLevel": [
142
+ "id", "request_id", "created", "model",
143
+ "choices", "usage", "video_result", "web_search", "content_filter",
144
+ "required_action", "output", "output_text", "status"
145
+ ],
146
+ "choices": {
147
+ "required": true,
148
+ "message": {
149
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
150
+ "roleDefault": "assistant",
151
+ "contentNullWhenToolCalls": true,
152
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
153
+ },
154
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
155
+ },
156
+ "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
157
+ }
158
+ }
137
159
  },
138
- "assistantToolCalls": { "functionArgumentsType": "string" }
139
- },
140
- "response": {
141
- "allowTopLevel": [
142
- "id", "request_id", "created", "model",
143
- "choices", "usage", "video_result", "web_search", "content_filter",
144
- "required_action", "output", "output_text", "status"
145
- ],
146
- "choices": {
147
- "required": true,
148
- "message": {
149
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
150
- "roleDefault": "assistant",
151
- "contentNullWhenToolCalls": true,
152
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
153
- },
154
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
160
+ {
161
+ "action": "field_map",
162
+ "direction": "outgoing",
163
+ "config": [
164
+ { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
165
+ { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
166
+ { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
167
+ { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
168
+ { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
169
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
170
+ {
171
+ "sourcePath": "choices[*].finish_reason",
172
+ "targetPath": "choices[*].finish_reason",
173
+ "type": "string",
174
+ "transform": "normalizeFinishReason"
175
+ },
176
+ {
177
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
178
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
179
+ "type": "string"
180
+ }
181
+ ]
155
182
  },
156
- "usage": { "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"] }
157
- }
158
- }
159
- },
160
- {
161
- "action": "field_map",
162
- "direction": "outgoing",
163
- "config": [
164
- { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
165
- { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
166
- { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
167
- { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
168
- { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
169
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
170
- {
171
- "sourcePath": "choices[*].finish_reason",
172
- "targetPath": "choices[*].finish_reason",
173
- "type": "string",
174
- "transform": "normalizeFinishReason"
175
- },
176
- {
177
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
178
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
179
- "type": "string"
180
- }
183
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
184
+ { "action": "response_normalize" },
185
+ { "action": "extract_glm_tool_markup" },
186
+ { "action": "response_validate" },
187
+ { "action": "snapshot", "phase": "compat-post" },
188
+ { "action": "dto_rewrap" }
181
189
  ]
182
- },
183
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
184
- { "action": "response_normalize" },
185
- { "action": "extract_glm_tool_markup" },
186
- { "action": "response_validate" },
187
- { "action": "snapshot", "phase": "compat-post" },
188
- { "action": "dto_rewrap" }
189
- ]
190
- }
190
+ }
191
191
  }