Skip to content

Commit 93942ef

Browse files
authored
Merge pull request #91 from samchon/feat/additionalProperties
Allow `additionalProperties` in Claude and Llama.
2 parents 50ea930 + 51d43d4 commit 93942ef

30 files changed

+398
-270
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "John Doe",
3+
"age": 42,
4+
"etc": {
5+
"hobby": "Soccer",
6+
"job": "Scientist"
7+
}
8+
}

examples/function-calling/arguments/claude.sale.input.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"title": "Surface Pro 9",
88
"format": "md",
99
"body": "The Surface Pro 9 is a versatile 2-in-1 device that combines the power of a laptop with the flexibility of a tablet. It features advanced technology, making it suitable for both professional and personal use.\n\n- \"Unleash Your Creativity Anywhere\": The Surface Pro 9 is designed for those who need power and portability, making it perfect for creative professionals and students alike.\n- \"The Ultimate 2-in-1 Experience\": With its detachable keyboard and touchscreen capabilities, the Surface Pro 9 adapts to your needs, whether you're working, studying, or relaxing.\n- \"Stay Connected with 5G\": Experience lightning-fast internet speeds and seamless connectivity, no matter where you are.\n- \"Power Meets Flexibility\": The Surface Pro 9 combines the performance of a laptop with the convenience of a tablet, making it the ideal device for multitasking.\n\nIn summary, the Surface Pro 9 stands out as a powerful and flexible device, perfect for users who require both performance and portability. With its advanced features and sleek design, it is an excellent choice for anyone looking to enhance their productivity and creativity. Whether for work or play, the Surface Pro 9 is ready to meet your needs.",
10+
"files": [],
1011
"thumbnails": [
1112
{
1213
"name": "microsoft-surface-pro-9-thumbnail-1",
@@ -23,8 +24,7 @@
2324
"extension": "jpeg",
2425
"url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg"
2526
}
26-
],
27-
"files": []
27+
]
2828
},
2929
"channels": [
3030
{
@@ -92,7 +92,7 @@
9292
],
9393
"stocks": [
9494
{
95-
"name": "Surface Pro 9 (i3/8GB/128GB)",
95+
"name": "Surface Pro 9 - i3/8GB/128GB",
9696
"price": {
9797
"nominal": 1000000,
9898
"real": 899000
@@ -114,7 +114,7 @@
114114
]
115115
},
116116
{
117-
"name": "Surface Pro 9 (i3/16GB/256GB)",
117+
"name": "Surface Pro 9 - i3/16GB/256GB",
118118
"price": {
119119
"nominal": 1200000,
120120
"real": 1099000
@@ -136,7 +136,7 @@
136136
]
137137
},
138138
{
139-
"name": "Surface Pro 9 (i3/16GB/512GB)",
139+
"name": "Surface Pro 9 - i3/16GB/512GB",
140140
"price": {
141141
"nominal": 1400000,
142142
"real": 1299000
@@ -158,7 +158,7 @@
158158
]
159159
},
160160
{
161-
"name": "Surface Pro 9 (i5/16GB/256GB)",
161+
"name": "Surface Pro 9 - i5/16GB/256GB",
162162
"price": {
163163
"nominal": 1500000,
164164
"real": 1399000
@@ -180,7 +180,7 @@
180180
]
181181
},
182182
{
183-
"name": "Surface Pro 9 (i5/32GB/512GB)",
183+
"name": "Surface Pro 9 - i5/32GB/512GB",
184184
"price": {
185185
"nominal": 1800000,
186186
"real": 1699000
@@ -202,7 +202,7 @@
202202
]
203203
},
204204
{
205-
"name": "Surface Pro 9 (i7/16GB/512GB)",
205+
"name": "Surface Pro 9 - i7/16GB/512GB",
206206
"price": {
207207
"nominal": 1800000,
208208
"real": 1699000
@@ -224,7 +224,7 @@
224224
]
225225
},
226226
{
227-
"name": "Surface Pro 9 (i7/32GB/512GB)",
227+
"name": "Surface Pro 9 - i7/32GB/512GB",
228228
"price": {
229229
"nominal": 2000000,
230230
"real": 1899000
@@ -284,11 +284,10 @@
284284
],
285285
"tags": [
286286
"Surface",
287-
"Surface Pro",
288-
"Surface Pro 9",
289287
"Microsoft",
290-
"Tablet",
291288
"2-in-1",
292-
"Laptop"
289+
"Laptop",
290+
"Tablet",
291+
"Windows"
293292
]
294293
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"age": 42,
3+
"etc": {
4+
"hobby": "Soccer",
5+
"job": "Scientist"
6+
},
7+
"name": "John Doe"
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"input": {
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"title": "The name of the person",
9+
"description": "The name of the person.",
10+
"type": "string"
11+
},
12+
"age": {
13+
"title": "The age of the person",
14+
"description": "The age of the person.",
15+
"type": "integer"
16+
},
17+
"etc": {
18+
"title": "Additional informations about the person",
19+
"description": "Construct a type with a set of properties K of type T",
20+
"type": "object",
21+
"properties": {},
22+
"required": [],
23+
"additionalProperties": {
24+
"type": "string"
25+
}
26+
}
27+
},
28+
"required": [
29+
"name",
30+
"age",
31+
"etc"
32+
]
33+
}
34+
},
35+
"required": [
36+
"input"
37+
],
38+
"$defs": {}
39+
}

examples/function-calling/schemas/claude.sale.schema.json

+11-23
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@
111111
"name",
112112
"extension",
113113
"url"
114-
],
115-
"additionalProperties": false
114+
]
116115
}
117116
},
118117
"thumbnails": {
@@ -152,8 +151,7 @@
152151
"name",
153152
"extension",
154153
"url"
155-
],
156-
"additionalProperties": false
154+
]
157155
}
158156
}
159157
},
@@ -163,8 +161,7 @@
163161
"body",
164162
"files",
165163
"thumbnails"
166-
],
167-
"additionalProperties": false
164+
]
168165
},
169166
"channels": {
170167
"title": "List of channels and categories",
@@ -191,8 +188,7 @@
191188
"required": [
192189
"code",
193190
"category_codes"
194-
],
195-
"additionalProperties": false
191+
]
196192
},
197193
"minItems": 1
198194
},
@@ -243,8 +239,7 @@
243239
},
244240
"required": [
245241
"name"
246-
],
247-
"additionalProperties": false
242+
]
248243
},
249244
"minItems": 1
250245
}
@@ -254,8 +249,7 @@
254249
"name",
255250
"variable",
256251
"candidates"
257-
],
258-
"additionalProperties": false
252+
]
259253
}
260254
},
261255
"stocks": {
@@ -292,8 +286,7 @@
292286
"required": [
293287
"nominal",
294288
"real"
295-
],
296-
"additionalProperties": false
289+
]
297290
},
298291
"quantity": {
299292
"title": "Initial inventory quantity",
@@ -321,8 +314,7 @@
321314
"required": [
322315
"option_index",
323316
"candidate_index"
324-
],
325-
"additionalProperties": false
317+
]
326318
}
327319
}
328320
},
@@ -331,8 +323,7 @@
331323
"price",
332324
"quantity",
333325
"choices"
334-
],
335-
"additionalProperties": false
326+
]
336327
},
337328
"minItems": 1
338329
},
@@ -358,8 +349,7 @@
358349
"name",
359350
"required",
360351
"primary"
361-
],
362-
"additionalProperties": false
352+
]
363353
},
364354
"minItems": 1
365355
},
@@ -381,13 +371,11 @@
381371
"channels",
382372
"units",
383373
"tags"
384-
],
385-
"additionalProperties": false
374+
]
386375
}
387376
},
388377
"required": [
389378
"input"
390379
],
391-
"additionalProperties": false,
392380
"$defs": {}
393381
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"input": {
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"title": "The name of the person",
9+
"description": "The name of the person.",
10+
"type": "string"
11+
},
12+
"age": {
13+
"title": "The age of the person",
14+
"description": "The age of the person.",
15+
"type": "integer"
16+
},
17+
"etc": {
18+
"title": "Additional informations about the person",
19+
"description": "Construct a type with a set of properties K of type T",
20+
"type": "object",
21+
"properties": {},
22+
"required": [],
23+
"additionalProperties": {
24+
"type": "string"
25+
}
26+
}
27+
},
28+
"required": [
29+
"name",
30+
"age",
31+
"etc"
32+
]
33+
}
34+
},
35+
"required": [
36+
"input"
37+
],
38+
"$defs": {}
39+
}

0 commit comments

Comments
 (0)