From c12856d6c61b2589dfa1543381faf90978ea20a8 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Mon, 25 Nov 2024 01:24:19 +0900 Subject: [PATCH] Enhance function calling test programs. --- ...e.json => chatgpt.apple-iphone.input.json} | 170 +-- ...n => chatgpt.apple-macbook-pro.input.json} | 120 +- ...on => chatgpt.apple-vision-pro.input.json} | 17 +- ...t-cashmere-oversized-half-coat.input.json} | 31 +- ...=> chatgpt.herman-miller-chair.input.json} | 32 +- ...ca-m6.json => chatgpt.leica-m6.input.json} | 28 +- ...hatgpt.microsoft-surface-pro-9.input.json} | 67 +- .../chatgpt.sale.input.apple-macbook-pro.json | 1074 ----------------- .../arguments/chatgpt.sale.input.json | 43 +- ...chatgpt.samsung-galaxy-watch-7.input.json} | 86 +- ...gpt.stanley-tumbler-collection.input.json} | 36 +- ...ne.json => claude.apple-iphone.input.json} | 39 +- .../claude.apple-macbook-pro.input.json | 215 ++++ ...son => claude.apple-vision-pro.input.json} | 33 +- ...t-cashmere-oversized-half-coat.input.json} | 36 +- .../arguments/claude.example.input.json | 4 + ... => claude.herman-miller-chair.input.json} | 14 +- ...ica-m6.json => claude.leica-m6.input.json} | 28 +- ...claude.microsoft-surface-pro-9.input.json} | 106 +- .../arguments/claude.recursive.input.json | 147 +++ .../arguments/claude.sale.input.json | 61 +- ... claude.samsung-galaxy-watch-7.input.json} | 35 +- ...ude.stanley-tumbler-collection.input.json} | 34 +- .../arguments/claude.tags.input.json | 7 + .../arguments/gemini.apple-iphone.input.json | 1068 ++++++++++++++++ ...on => gemini.apple-macbook-pro.input.json} | 746 ++++++------ .../gemini.apple-vision-pro.input.json | 103 ++ ...t-cashmere-oversized-half-coat.input.json} | 256 ++-- ... => gemini.herman-miller-chair.input.json} | 219 ++-- ...ica-m6.json => gemini.leica-m6.input.json} | 51 +- ...gemini.microsoft-surface-pro-9.input.json} | 300 ++--- .../gemini.sale.input.apple-iphone.json | 287 ----- .../gemini.sale.input.apple-vision-pro.json | 103 -- .../arguments/gemini.sale.input.json | 312 ++--- ... gemini.samsung-galaxy-watch-7.input.json} | 198 +-- ...ini.stanley-tumbler-collection.input.json} | 192 +-- .../schemas/chatgpt.sale.schema.json | 14 +- .../schemas/chatgpt.tags.schema.json | 22 +- .../schemas/claude.example.schema.json | 32 + .../schemas/claude.recursive.schema.json | 47 + .../schemas/claude.sale.schema.json | 646 +++++----- .../schemas/claude.tags.schema.json | 46 + .../schemas/gemini.sale.schema.json | 38 +- .../schemas/gemini.tags.schema.json | 33 + package.json | 2 +- src/HttpLlm.ts | 2 +- src/OpenApi.ts | 2 +- src/converters/OpenApiV3Converter.ts | 2 +- src/converters/OpenApiV3_1Converter.ts | 4 +- src/converters/SwaggerV2Converter.ts | 2 +- src/structures/ILlmSchema.ts | 4 + test/examples/chatgpt-function-calling.ts | 113 +- test/examples/claude-function-calling.ts | 108 +- test/examples/gemini-function-calling.ts | 134 +- .../test_chatgpt_function_calling_example.ts | 54 + ...test_chatgpt_function_calling_recursive.ts | 96 ++ .../test_chatgpt_function_calling_sale.ts | 34 + .../test_chatgpt_function_calling_tags.ts | 53 + .../test_claude_function_calling_example.ts | 54 + .../test_claude_function_calling_recursive.ts | 96 ++ .../test_claude_function_calling_sale.ts | 31 + .../test_claude_function_calling_tags.ts | 56 + ...st_llm_function_calling_chatgpt_example.ts | 89 -- ..._llm_function_calling_chatgpt_recursive.ts | 130 -- .../test_llm_function_calling_chatgpt_sale.ts | 104 -- .../test_llm_function_calling_chatgpt_tags.ts | 89 -- ...test_llm_function_calling_chatgpt_tuple.ts | 83 -- .../test_llm_function_calling_claude_sale.ts | 98 -- ...est_llm_function_calling_gemini_example.ts | 110 -- .../test_llm_function_calling_gemini_sale.ts | 122 -- .../test_gemini_function_calling_example.ts | 53 + .../test_gemini_function_calling_sale.ts | 33 + test/structures/ILlmTextPrompt.ts | 4 + test/structures/IShoppingSaleUnitOption.ts | 15 +- test/utils/ChatGptFunctionCaller.ts | 76 ++ test/utils/ClaudeFunctionCaller.ts | 71 ++ test/utils/GeminiFunctionCaller.ts | 86 ++ test/utils/ShoppingSalePrompt.ts | 56 + test/utils/StopWatch.ts | 38 + 79 files changed, 4646 insertions(+), 4634 deletions(-) rename examples/function-calling/arguments/{chatgpt.sale.input.apple-iphone.json => chatgpt.apple-iphone.input.json} (86%) rename examples/function-calling/arguments/{claude.sale.input.apple-macbook-pro.json => chatgpt.apple-macbook-pro.input.json} (87%) rename examples/function-calling/arguments/{claude.sale.input.apple-vision-pro.json => chatgpt.apple-vision-pro.input.json} (52%) rename examples/function-calling/arguments/{chatgpt.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json => chatgpt.drawfit-women-soft-cashmere-oversized-half-coat.input.json} (93%) rename examples/function-calling/arguments/{chatgpt.sale.input.herman-miller-chair.json => chatgpt.herman-miller-chair.input.json} (90%) rename examples/function-calling/arguments/{chatgpt.sale.input.leica-m6.json => chatgpt.leica-m6.input.json} (90%) rename examples/function-calling/arguments/{claude.sale.input.microsoft-surface-pro-9.json => chatgpt.microsoft-surface-pro-9.input.json} (93%) delete mode 100644 examples/function-calling/arguments/chatgpt.sale.input.apple-macbook-pro.json rename examples/function-calling/arguments/{chatgpt.sale.input.samsung-galaxy-watch-7.json => chatgpt.samsung-galaxy-watch-7.input.json} (81%) rename examples/function-calling/arguments/{chatgpt.sale.input.stanley-tumbler-collection.json => chatgpt.stanley-tumbler-collection.input.json} (59%) rename examples/function-calling/arguments/{claude.sale.input.apple-iphone.json => claude.apple-iphone.input.json} (99%) create mode 100644 examples/function-calling/arguments/claude.apple-macbook-pro.input.json rename examples/function-calling/arguments/{chatgpt.sale.input.apple-vision-pro.json => claude.apple-vision-pro.input.json} (65%) rename examples/function-calling/arguments/{claude.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json => claude.drawfit-women-soft-cashmere-oversized-half-coat.input.json} (99%) create mode 100644 examples/function-calling/arguments/claude.example.input.json rename examples/function-calling/arguments/{claude.sale.input.herman-miller-chair.json => claude.herman-miller-chair.input.json} (98%) rename examples/function-calling/arguments/{claude.sale.input.leica-m6.json => claude.leica-m6.input.json} (93%) rename examples/function-calling/arguments/{chatgpt.sale.input.microsoft-surface-pro-9.json => claude.microsoft-surface-pro-9.input.json} (91%) create mode 100644 examples/function-calling/arguments/claude.recursive.input.json rename examples/function-calling/arguments/{claude.sale.input.samsung-galaxy-watch-7.json => claude.samsung-galaxy-watch-7.input.json} (97%) rename examples/function-calling/arguments/{claude.sale.input.stanley-tumbler-collection.json => claude.stanley-tumbler-collection.input.json} (98%) create mode 100644 examples/function-calling/arguments/claude.tags.input.json create mode 100644 examples/function-calling/arguments/gemini.apple-iphone.input.json rename examples/function-calling/arguments/{gemini.sale.input.apple-macbook-pro.json => gemini.apple-macbook-pro.input.json} (83%) create mode 100644 examples/function-calling/arguments/gemini.apple-vision-pro.input.json rename examples/function-calling/arguments/{gemini.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json => gemini.drawfit-women-soft-cashmere-oversized-half-coat.input.json} (82%) rename examples/function-calling/arguments/{gemini.sale.input.herman-miller-chair.json => gemini.herman-miller-chair.input.json} (81%) rename examples/function-calling/arguments/{gemini.sale.input.leica-m6.json => gemini.leica-m6.input.json} (51%) rename examples/function-calling/arguments/{gemini.sale.input.microsoft-surface-pro-9.json => gemini.microsoft-surface-pro-9.input.json} (82%) delete mode 100644 examples/function-calling/arguments/gemini.sale.input.apple-iphone.json delete mode 100644 examples/function-calling/arguments/gemini.sale.input.apple-vision-pro.json rename examples/function-calling/arguments/{gemini.sale.input.samsung-galaxy-watch-7.json => gemini.samsung-galaxy-watch-7.input.json} (81%) rename examples/function-calling/arguments/{gemini.sale.input.stanley-tumbler-collection.json => gemini.stanley-tumbler-collection.input.json} (54%) create mode 100644 examples/function-calling/schemas/claude.example.schema.json create mode 100644 examples/function-calling/schemas/claude.recursive.schema.json create mode 100644 examples/function-calling/schemas/claude.tags.schema.json create mode 100644 examples/function-calling/schemas/gemini.tags.schema.json create mode 100644 test/features/llm/chatgpt/test_chatgpt_function_calling_example.ts create mode 100644 test/features/llm/chatgpt/test_chatgpt_function_calling_recursive.ts create mode 100644 test/features/llm/chatgpt/test_chatgpt_function_calling_sale.ts create mode 100644 test/features/llm/chatgpt/test_chatgpt_function_calling_tags.ts create mode 100644 test/features/llm/claude/test_claude_function_calling_example.ts create mode 100644 test/features/llm/claude/test_claude_function_calling_recursive.ts create mode 100644 test/features/llm/claude/test_claude_function_calling_sale.ts create mode 100644 test/features/llm/claude/test_claude_function_calling_tags.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_chatgpt_example.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_chatgpt_recursive.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_chatgpt_sale.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_chatgpt_tags.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_chatgpt_tuple.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_claude_sale.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_gemini_example.ts delete mode 100644 test/features/llm/function-calling/test_llm_function_calling_gemini_sale.ts create mode 100644 test/features/llm/gemini/test_gemini_function_calling_example.ts create mode 100644 test/features/llm/gemini/test_gemini_function_calling_sale.ts create mode 100644 test/structures/ILlmTextPrompt.ts create mode 100644 test/utils/ChatGptFunctionCaller.ts create mode 100644 test/utils/ClaudeFunctionCaller.ts create mode 100644 test/utils/GeminiFunctionCaller.ts create mode 100644 test/utils/ShoppingSalePrompt.ts create mode 100644 test/utils/StopWatch.ts diff --git a/examples/function-calling/arguments/chatgpt.sale.input.apple-iphone.json b/examples/function-calling/arguments/chatgpt.apple-iphone.input.json similarity index 86% rename from examples/function-calling/arguments/chatgpt.sale.input.apple-iphone.json rename to examples/function-calling/arguments/chatgpt.apple-iphone.input.json index 6995e97..f1cdd84 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.apple-iphone.json +++ b/examples/function-calling/arguments/chatgpt.apple-iphone.input.json @@ -10,7 +10,7 @@ "files": [], "thumbnails": [ { - "name": "apple-iphone-thumbnail", + "name": "mbp14-spaceblack-gallery1-202410", "extension": "jpeg", "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617" } @@ -90,12 +90,12 @@ ], "stocks": [ { - "name": "MacBook Pro - Sliver, 16GB, 512GB, English", + "name": "Sliver / 16GB / 512GB / English", "price": { "nominal": 2000000, "real": 1800000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -116,12 +116,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 16GB, 512GB, Korean", + "name": "Sliver / 16GB / 512GB / Korean", "price": { "nominal": 2000000, "real": 1800000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -142,12 +142,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 16GB, 1TB, English", + "name": "Sliver / 16GB / 1TB / English", "price": { "nominal": 2300000, "real": 2070000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -168,12 +168,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 16GB, 1TB, Korean", + "name": "Sliver / 16GB / 1TB / Korean", "price": { "nominal": 2300000, "real": 2070000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -194,12 +194,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 16GB, 2TB, English", + "name": "Sliver / 16GB / 2TB / English", "price": { "nominal": 2900000, "real": 2610000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -220,12 +220,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 16GB, 2TB, Korean", + "name": "Sliver / 16GB / 2TB / Korean", "price": { "nominal": 2900000, "real": 2610000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -246,12 +246,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 32GB, 512GB, English", + "name": "Sliver / 32GB / 512GB / English", "price": { "nominal": 2600000, "real": 2340000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -272,12 +272,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 32GB, 512GB, Korean", + "name": "Sliver / 32GB / 512GB / Korean", "price": { "nominal": 2600000, "real": 2340000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -298,12 +298,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 32GB, 1TB, English", + "name": "Sliver / 32GB / 1TB / English", "price": { "nominal": 2900000, "real": 2610000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -324,12 +324,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 32GB, 1TB, Korean", + "name": "Sliver / 32GB / 1TB / Korean", "price": { "nominal": 2900000, "real": 2610000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -350,12 +350,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 32GB, 2TB, English", + "name": "Sliver / 32GB / 2TB / English", "price": { "nominal": 3500000, "real": 3150000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -376,12 +376,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 32GB, 2TB, Korean", + "name": "Sliver / 32GB / 2TB / Korean", "price": { "nominal": 3500000, "real": 3150000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -402,12 +402,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 64GB, 512GB, English", + "name": "Sliver / 64GB / 512GB / English", "price": { "nominal": 3200000, "real": 2880000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -428,12 +428,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 64GB, 512GB, Korean", + "name": "Sliver / 64GB / 512GB / Korean", "price": { "nominal": 3200000, "real": 2880000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -454,12 +454,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 64GB, 1TB, English", + "name": "Sliver / 64GB / 1TB / English", "price": { "nominal": 3500000, "real": 3150000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -480,12 +480,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 64GB, 1TB, Korean", + "name": "Sliver / 64GB / 1TB / Korean", "price": { "nominal": 3500000, "real": 3150000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -506,12 +506,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 64GB, 2TB, English", + "name": "Sliver / 64GB / 2TB / English", "price": { "nominal": 4100000, "real": 3690000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -532,12 +532,12 @@ ] }, { - "name": "MacBook Pro - Sliver, 64GB, 2TB, Korean", + "name": "Sliver / 64GB / 2TB / Korean", "price": { "nominal": 4100000, "real": 3690000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -558,12 +558,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 16GB, 512GB, English", + "name": "Space Gray / 16GB / 512GB / English", "price": { "nominal": 2050000, "real": 1845000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -584,12 +584,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 16GB, 512GB, Korean", + "name": "Space Gray / 16GB / 512GB / Korean", "price": { "nominal": 2050000, "real": 1845000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -610,12 +610,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 16GB, 1TB, English", + "name": "Space Gray / 16GB / 1TB / English", "price": { "nominal": 2350000, "real": 2115000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -636,12 +636,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 16GB, 1TB, Korean", + "name": "Space Gray / 16GB / 1TB / Korean", "price": { "nominal": 2350000, "real": 2115000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -662,12 +662,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 16GB, 2TB, English", + "name": "Space Gray / 16GB / 2TB / English", "price": { "nominal": 2950000, "real": 2655000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -688,12 +688,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 16GB, 2TB, Korean", + "name": "Space Gray / 16GB / 2TB / Korean", "price": { "nominal": 2950000, "real": 2655000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -714,12 +714,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 32GB, 512GB, English", + "name": "Space Gray / 32GB / 512GB / English", "price": { "nominal": 2650000, "real": 2385000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -740,12 +740,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 32GB, 512GB, Korean", + "name": "Space Gray / 32GB / 512GB / Korean", "price": { "nominal": 2650000, "real": 2385000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -766,12 +766,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 32GB, 1TB, English", + "name": "Space Gray / 32GB / 1TB / English", "price": { "nominal": 2950000, "real": 2655000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -792,12 +792,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 32GB, 1TB, Korean", + "name": "Space Gray / 32GB / 1TB / Korean", "price": { "nominal": 2950000, "real": 2655000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -818,12 +818,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 32GB, 2TB, English", + "name": "Space Gray / 32GB / 2TB / English", "price": { "nominal": 3550000, "real": 3195000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -844,12 +844,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 32GB, 2TB, Korean", + "name": "Space Gray / 32GB / 2TB / Korean", "price": { "nominal": 3550000, "real": 3195000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -870,12 +870,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 64GB, 512GB, English", + "name": "Space Gray / 64GB / 512GB / English", "price": { "nominal": 3250000, "real": 2925000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -896,12 +896,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 64GB, 512GB, Korean", + "name": "Space Gray / 64GB / 512GB / Korean", "price": { "nominal": 3250000, "real": 2925000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -922,12 +922,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 64GB, 1TB, English", + "name": "Space Gray / 64GB / 1TB / English", "price": { "nominal": 3550000, "real": 3195000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -948,12 +948,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 64GB, 1TB, Korean", + "name": "Space Gray / 64GB / 1TB / Korean", "price": { "nominal": 3550000, "real": 3195000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -974,12 +974,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 64GB, 2TB, English", + "name": "Space Gray / 64GB / 2TB / English", "price": { "nominal": 4150000, "real": 3735000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -1000,12 +1000,12 @@ ] }, { - "name": "MacBook Pro - Space Gray, 64GB, 2TB, Korean", + "name": "Space Gray / 64GB / 2TB / Korean", "price": { "nominal": 4150000, "real": 3735000 }, - "quantity": 500, + "quantity": 100, "choices": [ { "option_index": 0, @@ -1026,9 +1026,9 @@ ] } ], - "name": "MacBook M3 Pro 14inch Entity", - "required": true, - "primary": true + "name": "MacBook Pro Entity", + "primary": true, + "required": true }, { "options": [], @@ -1044,8 +1044,8 @@ } ], "name": "Warranty Program", - "required": false, - "primary": false + "primary": false, + "required": false }, { "options": [], @@ -1061,15 +1061,15 @@ } ], "name": "Magnetic Keyboard", - "required": false, - "primary": false + "primary": false, + "required": false } ], "tags": [ - "macbook", - "apple", - "laptop", - "electronics", - "professional" + "MacBook", + "Apple", + "Laptop", + "Electronics", + "MacBook Pro" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.apple-macbook-pro.json b/examples/function-calling/arguments/chatgpt.apple-macbook-pro.input.json similarity index 87% rename from examples/function-calling/arguments/claude.sale.input.apple-macbook-pro.json rename to examples/function-calling/arguments/chatgpt.apple-macbook-pro.input.json index 925f4d3..d3fe83d 100644 --- a/examples/function-calling/arguments/claude.sale.input.apple-macbook-pro.json +++ b/examples/function-calling/arguments/chatgpt.apple-macbook-pro.input.json @@ -6,37 +6,27 @@ "content": { "title": "Apple MacBook Pro", "format": "md", - "body": "MacBook Pro\n\n**The Ultimate Tool for Professionals**\n\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\n\n- **Remarkable Performance**\n \n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\n \n- **Outstanding Display**\n \n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\n \n- **All-Day Battery Life**\n \n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\n \n- **Sleek Yet Powerful Design**\n \n A precision aluminum body that's lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\n \n- **Smart Connectivity**\n \n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\n\nWith MacBook Pro, your potential knows no bounds. **It's time to rediscover what you're capable of.**", - "files": [], - "thumbnails": [ + "body": "MacBook Pro\n\n**The Ultimate Tool for Professionals**\n\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\n\n- **Remarkable Performance**\n \n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\n \n- **Outstanding Display**\n \n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\n \n- **All-Day Battery Life**\n \n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\n \n- **Sleek Yet Powerful Design**\n \n A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\n \n- **Smart Connectivity**\n \n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\n\nWith MacBook Pro, your potential knows no bounds. **It’s time to rediscover what you’re capable of.**", + "files": [ { "name": "apple-macbook-pro-thumbnail", "extension": "png", "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617" } - ] + ], + "thumbnails": [] }, "channels": [ { "code": "samchon", "category_codes": [ - "electronics", "laptops", "macbooks" ] } ], - "tags": [ - "macbook", - "laptop", - "apple", - "macbook pro" - ], "units": [ { - "name": "MacBook M3 Pro 14inch Entity", - "primary": true, - "required": true, "options": [ { "type": "select", @@ -99,7 +89,7 @@ ], "stocks": [ { - "name": "Silver/16GB/512GB/English", + "name": "Silver / 16GB / 512GB / English", "price": { "nominal": 2000000, "real": 1800000 @@ -125,7 +115,7 @@ ] }, { - "name": "Silver/16GB/512GB/Korean", + "name": "Silver / 16GB / 512GB / Korean", "price": { "nominal": 2000000, "real": 1800000 @@ -151,7 +141,7 @@ ] }, { - "name": "Silver/16GB/1TB/English", + "name": "Silver / 16GB / 1TB / English", "price": { "nominal": 2300000, "real": 2070000 @@ -177,7 +167,7 @@ ] }, { - "name": "Silver/16GB/1TB/Korean", + "name": "Silver / 16GB / 1TB / Korean", "price": { "nominal": 2300000, "real": 2070000 @@ -203,7 +193,7 @@ ] }, { - "name": "Silver/16GB/2TB/English", + "name": "Silver / 16GB / 2TB / English", "price": { "nominal": 2900000, "real": 2610000 @@ -229,7 +219,7 @@ ] }, { - "name": "Silver/16GB/2TB/Korean", + "name": "Silver / 16GB / 2TB / Korean", "price": { "nominal": 2900000, "real": 2610000 @@ -255,7 +245,7 @@ ] }, { - "name": "Silver/32GB/512GB/English", + "name": "Silver / 32GB / 512GB / English", "price": { "nominal": 2600000, "real": 2340000 @@ -281,7 +271,7 @@ ] }, { - "name": "Silver/32GB/512GB/Korean", + "name": "Silver / 32GB / 512GB / Korean", "price": { "nominal": 2600000, "real": 2340000 @@ -307,7 +297,7 @@ ] }, { - "name": "Silver/32GB/1TB/English", + "name": "Silver / 32GB / 1TB / English", "price": { "nominal": 2900000, "real": 2610000 @@ -333,7 +323,7 @@ ] }, { - "name": "Silver/32GB/1TB/Korean", + "name": "Silver / 32GB / 1TB / Korean", "price": { "nominal": 2900000, "real": 2610000 @@ -359,7 +349,7 @@ ] }, { - "name": "Silver/32GB/2TB/English", + "name": "Silver / 32GB / 2TB / English", "price": { "nominal": 3500000, "real": 3150000 @@ -385,7 +375,7 @@ ] }, { - "name": "Silver/32GB/2TB/Korean", + "name": "Silver / 32GB / 2TB / Korean", "price": { "nominal": 3500000, "real": 3150000 @@ -411,7 +401,7 @@ ] }, { - "name": "Silver/64GB/512GB/English", + "name": "Silver / 64GB / 512GB / English", "price": { "nominal": 3200000, "real": 2880000 @@ -437,7 +427,7 @@ ] }, { - "name": "Silver/64GB/512GB/Korean", + "name": "Silver / 64GB / 512GB / Korean", "price": { "nominal": 3200000, "real": 2880000 @@ -463,7 +453,7 @@ ] }, { - "name": "Silver/64GB/1TB/English", + "name": "Silver / 64GB / 1TB / English", "price": { "nominal": 3500000, "real": 3150000 @@ -489,7 +479,7 @@ ] }, { - "name": "Silver/64GB/1TB/Korean", + "name": "Silver / 64GB / 1TB / Korean", "price": { "nominal": 3500000, "real": 3150000 @@ -515,7 +505,7 @@ ] }, { - "name": "Silver/64GB/2TB/English", + "name": "Silver / 64GB / 2TB / English", "price": { "nominal": 4100000, "real": 3690000 @@ -541,7 +531,7 @@ ] }, { - "name": "Silver/64GB/2TB/Korean", + "name": "Silver / 64GB / 2TB / Korean", "price": { "nominal": 4100000, "real": 3690000 @@ -567,7 +557,7 @@ ] }, { - "name": "Space Gray/16GB/512GB/English", + "name": "Space Gray / 16GB / 512GB / English", "price": { "nominal": 2050000, "real": 1845000 @@ -593,7 +583,7 @@ ] }, { - "name": "Space Gray/16GB/512GB/Korean", + "name": "Space Gray / 16GB / 512GB / Korean", "price": { "nominal": 2050000, "real": 1845000 @@ -619,7 +609,7 @@ ] }, { - "name": "Space Gray/16GB/1TB/English", + "name": "Space Gray / 16GB / 1TB / English", "price": { "nominal": 2350000, "real": 2115000 @@ -645,7 +635,7 @@ ] }, { - "name": "Space Gray/16GB/1TB/Korean", + "name": "Space Gray / 16GB / 1TB / Korean", "price": { "nominal": 2350000, "real": 2115000 @@ -671,7 +661,7 @@ ] }, { - "name": "Space Gray/16GB/2TB/English", + "name": "Space Gray / 16GB / 2TB / English", "price": { "nominal": 2950000, "real": 2655000 @@ -697,7 +687,7 @@ ] }, { - "name": "Space Gray/16GB/2TB/Korean", + "name": "Space Gray / 16GB / 2TB / Korean", "price": { "nominal": 2950000, "real": 2655000 @@ -723,7 +713,7 @@ ] }, { - "name": "Space Gray/32GB/512GB/English", + "name": "Space Gray / 32GB / 512GB / English", "price": { "nominal": 2650000, "real": 2385000 @@ -749,7 +739,7 @@ ] }, { - "name": "Space Gray/32GB/512GB/Korean", + "name": "Space Gray / 32GB / 512GB / Korean", "price": { "nominal": 2650000, "real": 2385000 @@ -775,7 +765,7 @@ ] }, { - "name": "Space Gray/32GB/1TB/English", + "name": "Space Gray / 32GB / 1TB / English", "price": { "nominal": 2950000, "real": 2655000 @@ -801,7 +791,7 @@ ] }, { - "name": "Space Gray/32GB/1TB/Korean", + "name": "Space Gray / 32GB / 1TB / Korean", "price": { "nominal": 2950000, "real": 2655000 @@ -827,7 +817,7 @@ ] }, { - "name": "Space Gray/32GB/2TB/English", + "name": "Space Gray / 32GB / 2TB / English", "price": { "nominal": 3550000, "real": 3195000 @@ -853,7 +843,7 @@ ] }, { - "name": "Space Gray/32GB/2TB/Korean", + "name": "Space Gray / 32GB / 2TB / Korean", "price": { "nominal": 3550000, "real": 3195000 @@ -879,7 +869,7 @@ ] }, { - "name": "Space Gray/64GB/512GB/English", + "name": "Space Gray / 64GB / 512GB / English", "price": { "nominal": 3250000, "real": 2925000 @@ -905,7 +895,7 @@ ] }, { - "name": "Space Gray/64GB/512GB/Korean", + "name": "Space Gray / 64GB / 512GB / Korean", "price": { "nominal": 3250000, "real": 2925000 @@ -931,7 +921,7 @@ ] }, { - "name": "Space Gray/64GB/1TB/English", + "name": "Space Gray / 64GB / 1TB / English", "price": { "nominal": 3550000, "real": 3195000 @@ -957,7 +947,7 @@ ] }, { - "name": "Space Gray/64GB/1TB/Korean", + "name": "Space Gray / 64GB / 1TB / Korean", "price": { "nominal": 3550000, "real": 3195000 @@ -983,7 +973,7 @@ ] }, { - "name": "Space Gray/64GB/2TB/English", + "name": "Space Gray / 64GB / 2TB / English", "price": { "nominal": 4150000, "real": 3735000 @@ -1009,7 +999,7 @@ ] }, { - "name": "Space Gray/64GB/2TB/Korean", + "name": "Space Gray / 64GB / 2TB / Korean", "price": { "nominal": 4150000, "real": 3735000 @@ -1034,12 +1024,12 @@ } ] } - ] + ], + "name": "MacBook M3 Pro 14inch Entity", + "primary": true, + "required": true }, { - "name": "Warranty Program", - "primary": false, - "required": false, "options": [], "stocks": [ { @@ -1051,16 +1041,16 @@ "quantity": 10000, "choices": [] } - ] + ], + "name": "Warranty Program", + "primary": false, + "required": false }, { - "name": "Magnetic Keyboard", - "primary": false, - "required": false, "options": [], "stocks": [ { - "name": "Standard Magnetic Keyboard", + "name": "Basic Magnetic Keyboard", "price": { "nominal": 200000, "real": 169000 @@ -1068,7 +1058,17 @@ "quantity": 8000, "choices": [] } - ] + ], + "name": "Magnetic Keyboard", + "primary": false, + "required": false } + ], + "tags": [ + "MacBook", + "Apple", + "Pro", + "Laptop", + "Electronics" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.apple-vision-pro.json b/examples/function-calling/arguments/chatgpt.apple-vision-pro.input.json similarity index 52% rename from examples/function-calling/arguments/claude.sale.input.apple-vision-pro.json rename to examples/function-calling/arguments/chatgpt.apple-vision-pro.input.json index 26857e0..a9d1bb4 100644 --- a/examples/function-calling/arguments/claude.sale.input.apple-vision-pro.json +++ b/examples/function-calling/arguments/chatgpt.apple-vision-pro.input.json @@ -6,7 +6,7 @@ "content": { "title": "Apple Vision Air", "format": "md", - "body": "The Apple Vision Air is a groundbreaking addition to Apple's lineup of innovative devices, designed to enhance your digital experience through augmented reality. With its sleek design and advanced technology, the Vision Air aims to redefine how users interact with their surroundings, providing a seamless blend of the physical and digital worlds.\n\n![apple-vision-pro-thumbnail.png](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s)\n\nThe Apple Vision Air features a lightweight and comfortable design, making it perfect for extended use. Equipped with high-resolution displays and cutting-edge optics, it offers stunning visuals that immerse users in their augmented reality experiences. The device is powered by the latest Apple silicon, ensuring smooth performance and efficient battery life.\n\nThe Apple Vision Air is more than just a device; it's a gateway to a new reality. Whether for work, play, or exploration, it represents the future of immersive technology.\n\n### Key Features\n\nAugmented Reality Capabilities: Experience a new dimension of interaction with AR applications that enhance everyday tasks and entertainment.\n\nHigh-Resolution Display: Enjoy vibrant and crisp visuals, making every detail come to life.\nIntuitive Controls: Navigate effortlessly with gesture controls and voice commands, designed for user convenience.\n\nSeamless Integration: Connect with other Apple devices for a unified ecosystem that enhances productivity and creativity.\n\nDurability and Comfort: Built with premium materials, the Vision Air ensures longevity and comfort during prolonged use.", + "body": "### Preface\nThe Apple Vision Air is a groundbreaking addition to Apple's lineup of innovative devices, designed to enhance your digital experience through augmented reality. With its sleek design and advanced technology, the Vision Air aims to redefine how users interact with their surroundings, providing a seamless blend of the physical and digital worlds.\n\n### Content\nThe Apple Vision Air features a lightweight and comfortable design, making it perfect for extended use. Equipped with high-resolution displays and cutting-edge optics, it offers stunning visuals that immerse users in their augmented reality experiences. The device is powered by the latest Apple silicon, ensuring smooth performance and efficient battery life.\n\nThe Apple Vision Air is more than just a device; it’s a gateway to a new reality. Whether for work, play, or exploration, it represents the future of immersive technology.\n\n### Key Features\n\n- Augmented Reality Capabilities: Experience a new dimension of interaction with AR applications that enhance everyday tasks and entertainment.\n\n- High-Resolution Display: Enjoy vibrant and crisp visuals, making every detail come to life.\n\n- Intuitive Controls: Navigate effortlessly with gesture controls and voice commands, designed for user convenience.\n\n- Seamless Integration: Connect with other Apple devices for a unified ecosystem that enhances productivity and creativity.\n\n- Durability and Comfort: Built with premium materials, the Vision Air ensures longevity and comfort during prolonged use.", "files": [], "thumbnails": [ { @@ -20,16 +20,12 @@ { "code": "samchon", "category_codes": [ - "electronics", "smart_glasses" ] } ], "units": [ { - "name": "Apple Vision Air", - "primary": true, - "required": true, "options": [ { "type": "select", @@ -91,14 +87,17 @@ } ] } - ] + ], + "name": "Apple Vision Air", + "primary": true, + "required": true } ], "tags": [ "Apple", - "Vision Air", - "AR", + "Vision", + "Air", "Augmented Reality", - "Smart Glasses" + "Technology" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json b/examples/function-calling/arguments/chatgpt.drawfit-women-soft-cashmere-oversized-half-coat.input.json similarity index 93% rename from examples/function-calling/arguments/chatgpt.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json rename to examples/function-calling/arguments/chatgpt.drawfit-women-soft-cashmere-oversized-half-coat.input.json index 6b7d35b..815624e 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json +++ b/examples/function-calling/arguments/chatgpt.drawfit-women-soft-cashmere-oversized-half-coat.input.json @@ -30,7 +30,6 @@ { "code": "samchon", "category_codes": [ - "accessories", "clothes" ] } @@ -73,7 +72,7 @@ ], "stocks": [ { - "name": "XS-GREY", + "name": "XS - GREY", "price": { "nominal": 220000, "real": 198000 @@ -91,7 +90,7 @@ ] }, { - "name": "XS-NAVY", + "name": "XS - NAVY", "price": { "nominal": 220000, "real": 198000 @@ -109,7 +108,7 @@ ] }, { - "name": "XS-BUTTER", + "name": "XS - BUTTER", "price": { "nominal": 220000, "real": 198000 @@ -127,7 +126,7 @@ ] }, { - "name": "S-GREY", + "name": "S - GREY", "price": { "nominal": 240000, "real": 198000 @@ -145,7 +144,7 @@ ] }, { - "name": "S-NAVY", + "name": "S - NAVY", "price": { "nominal": 240000, "real": 198000 @@ -163,7 +162,7 @@ ] }, { - "name": "S-BUTTER", + "name": "S - BUTTER", "price": { "nominal": 240000, "real": 198000 @@ -181,7 +180,7 @@ ] }, { - "name": "M-GREY", + "name": "M - GREY", "price": { "nominal": 260000, "real": 198000 @@ -199,7 +198,7 @@ ] }, { - "name": "M-NAVY", + "name": "M - NAVY", "price": { "nominal": 260000, "real": 198000 @@ -217,7 +216,7 @@ ] }, { - "name": "M-BUTTER", + "name": "M - BUTTER", "price": { "nominal": 260000, "real": 198000 @@ -236,15 +235,9 @@ } ], "name": "Drawfit Women Soft Cashmere Oversized Half Coat", - "required": true, - "primary": true + "primary": true, + "required": true } ], - "tags": [ - "Drawfit", - "Women", - "Soft Cashmere", - "Oversized Half Coat", - "Winter" - ] + "tags": [] } \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.herman-miller-chair.json b/examples/function-calling/arguments/chatgpt.herman-miller-chair.input.json similarity index 90% rename from examples/function-calling/arguments/chatgpt.sale.input.herman-miller-chair.json rename to examples/function-calling/arguments/chatgpt.herman-miller-chair.input.json index 13ef722..bf3372d 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.herman-miller-chair.json +++ b/examples/function-calling/arguments/chatgpt.herman-miller-chair.input.json @@ -59,7 +59,7 @@ ], "stocks": [ { - "name": "Herman Miller Chair - Aeron, Black", + "name": "Herman Miller Chair - Aeron Black", "price": { "nominal": 1200000, "real": 1099000 @@ -77,7 +77,7 @@ ] }, { - "name": "Herman Miller Chair - Aeron, Gray", + "name": "Herman Miller Chair - Aeron Gray", "price": { "nominal": 1200000, "real": 1099000 @@ -95,7 +95,7 @@ ] }, { - "name": "Herman Miller Chair - Aeron, White", + "name": "Herman Miller Chair - Aeron White", "price": { "nominal": 1200000, "real": 1099000 @@ -113,7 +113,7 @@ ] }, { - "name": "Herman Miller Chair - Embody, Black", + "name": "Herman Miller Chair - Embody Black", "price": { "nominal": 1800000, "real": 1599000 @@ -131,7 +131,7 @@ ] }, { - "name": "Herman Miller Chair - Embody, Gray", + "name": "Herman Miller Chair - Embody Gray", "price": { "nominal": 1800000, "real": 1599000 @@ -149,7 +149,7 @@ ] }, { - "name": "Herman Miller Chair - Embody, White", + "name": "Herman Miller Chair - Embody White", "price": { "nominal": 1800000, "real": 1599000 @@ -168,8 +168,8 @@ } ], "name": "Herman Miller Chair", - "required": true, - "primary": true + "primary": true, + "required": true }, { "options": [], @@ -185,8 +185,8 @@ } ], "name": "Warranty Program", - "required": false, - "primary": false + "primary": false, + "required": false }, { "options": [], @@ -202,14 +202,16 @@ } ], "name": "Replacement Cushion", - "required": false, - "primary": false + "primary": false, + "required": false } ], "tags": [ "Herman Miller", - "Ergonomic Chair", - "Office Furniture", - "Comfortable Seating" + "Chair", + "Ergonomic", + "Office", + "Home", + "Furniture" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.leica-m6.json b/examples/function-calling/arguments/chatgpt.leica-m6.input.json similarity index 90% rename from examples/function-calling/arguments/chatgpt.sale.input.leica-m6.json rename to examples/function-calling/arguments/chatgpt.leica-m6.input.json index fb7f9a0..ff40727 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.leica-m6.json +++ b/examples/function-calling/arguments/chatgpt.leica-m6.input.json @@ -6,7 +6,7 @@ "content": { "title": "Leica M6 (2022 Reissue): The Return of a Legend", "format": "md", - "body": "The Leica M6, a beloved classic in the world of film photography, is back! The 2022 reissue brings modern enhancements while staying true to the original’s timeless charm. Designed for enthusiasts and professionals, the new M6 is a tribute to the past, with a touch of the future.\n\n- **\"Rediscover the Classic\":** The Leica M6 reissue retains the original design, offering the same iconic look and feel that photographers fell in love with decades ago.\n- **\"Enhanced for the Modern Era\":** Now featuring improved durability, a brighter viewfinder, and the latest advancements in metering, the M6 reissue ensures a seamless shooting experience.\n- **\"Craftsmanship Meets Tradition\":** Made in Germany, the M6 embodies Leica's dedication to quality and precision, delivering a tool that feels as good as it performs.\n- **\"For the Love of Film\":** The M6 is perfect for those who cherish the art of analog photography, providing an unmatched tactile and creative experience.\n\nIn summary, the 2022 Leica M6 reissue is a perfect blend of heritage and innovation. It’s a must-have for collectors, analog enthusiasts, and anyone seeking the pure joy of shooting on film with a legendary camera.", + "body": "The Leica M6, a beloved classic in the world of film photography, is back! The 2022 reissue brings modern enhancements while staying true to the original’s timeless charm. Designed for enthusiasts and professionals, the new M6 is a tribute to the past, with a touch of the future.\n\n- **\"Rediscover the Classic\":** The Leica M6 reissue retains the original design, offering the same iconic look and feel that photographers fell in love with decades ago.\n- **\"Enhanced for the Modern Era\":** Now featuring improved durability, a brighter viewfinder, and the latest advancements in metering, the M6 reissue ensures a seamless shooting experience.\n- **\"Craftsmanship Meets Tradition\":** Made in Germany, the M6 embodies Leica's dedication to quality and precision, delivering a tool that feels as good as it performs.\n- **\"For the Love of Film\":** The M6 is perfect for those who cherish the art of analog photography, providing an unmatched tactile and creative experience.\n\nIn summary, the 2022 Leica M6 reissue is a perfect blend of heritage and innovation. It’s a must-have for collectors, analog enthusiasts, and anyone seeking the pure joy of shooting on film with a legendary camera.\n", "files": [], "thumbnails": [ { @@ -48,7 +48,7 @@ ], "stocks": [ { - "name": "Leica M6 Body (Black Paint Finish)", + "name": "Leica M6 Body - Black Paint Finish", "price": { "nominal": 7200000, "real": 6899000 @@ -62,7 +62,7 @@ ] }, { - "name": "Leica M6 Body (Silver Chrome Finish)", + "name": "Leica M6 Body - Silver Chrome Finish", "price": { "nominal": 7200000, "real": 6899000 @@ -77,8 +77,8 @@ } ], "name": "Leica M6 Body (2022 Reissue)", - "required": true, - "primary": true + "primary": true, + "required": true }, { "options": [], @@ -94,18 +94,18 @@ } ], "name": "50mm Summilux Lens", - "required": false, - "primary": false + "primary": false, + "required": false } ], "tags": [ - "Leica M6", - "Film Camera", + "Leica", + "Camera", + "M6", + "2022", + "Film", "Photography", - "Analog", - "Camera Reissue", - "Classic Design", - "Collector's Item", - "Camera Lens" + "Lens", + "Summilux" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.microsoft-surface-pro-9.json b/examples/function-calling/arguments/chatgpt.microsoft-surface-pro-9.input.json similarity index 93% rename from examples/function-calling/arguments/claude.sale.input.microsoft-surface-pro-9.json rename to examples/function-calling/arguments/chatgpt.microsoft-surface-pro-9.input.json index 9b2c814..41a0517 100644 --- a/examples/function-calling/arguments/claude.sale.input.microsoft-surface-pro-9.json +++ b/examples/function-calling/arguments/chatgpt.microsoft-surface-pro-9.input.json @@ -30,16 +30,12 @@ { "code": "samchon", "category_codes": [ - "laptops/2_in_1_laptops", - "tablets/windows_tablets" + "2in1_laptops" ] } ], "units": [ { - "name": "Surface Pro 9 Entity", - "primary": true, - "required": true, "options": [ { "type": "select", @@ -92,12 +88,12 @@ ], "stocks": [ { - "name": "i3/8GB/128GB", - "quantity": 1000, + "name": "Surface Pro 9 - i3 8/128", "price": { "nominal": 1000000, "real": 899000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -114,12 +110,12 @@ ] }, { - "name": "i3/16GB/256GB", - "quantity": 1000, + "name": "Surface Pro 9 - i3 16/256", "price": { "nominal": 1200000, "real": 1099000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -136,12 +132,12 @@ ] }, { - "name": "i3/16GB/512GB", - "quantity": 1000, + "name": "Surface Pro 9 - i3 16/512", "price": { "nominal": 1400000, "real": 1299000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -158,12 +154,12 @@ ] }, { - "name": "i5/16GB/256GB", - "quantity": 1000, + "name": "Surface Pro 9 - i5 16/256", "price": { "nominal": 1500000, "real": 1399000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -180,12 +176,12 @@ ] }, { - "name": "i5/32GB/512GB", - "quantity": 1000, + "name": "Surface Pro 9 - i5 32/512", "price": { "nominal": 1800000, "real": 1699000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -202,12 +198,12 @@ ] }, { - "name": "i7/16GB/512GB", - "quantity": 1000, + "name": "Surface Pro 9 - i7 16/512", "price": { "nominal": 1800000, "real": 1699000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -224,12 +220,12 @@ ] }, { - "name": "i7/32GB/512GB", - "quantity": 1000, + "name": "Surface Pro 9 - i7 32/512", "price": { "nominal": 2000000, "real": 1899000 }, + "quantity": 1000, "choices": [ { "option_index": 0, @@ -245,48 +241,51 @@ } ] } - ] + ], + "name": "Surface Pro 9 Entity", + "primary": true, + "required": true }, { - "name": "Warranty Program", - "primary": false, - "required": false, "options": [], "stocks": [ { "name": "Warranty Program", - "quantity": 10000, "price": { "nominal": 100000, "real": 89000 }, + "quantity": 10000, "choices": [] } - ] + ], + "name": "Warranty Program", + "primary": false, + "required": false }, { - "name": "Magnetic Keyboard", - "primary": false, - "required": false, "options": [], "stocks": [ { "name": "Magnetic Keyboard", - "quantity": 8000, "price": { "nominal": 200000, "real": 169000 }, + "quantity": 8000, "choices": [] } - ] + ], + "name": "Magnetic Keyboard", + "primary": false, + "required": false } ], "tags": [ - "Surface Pro", + "Surface", + "Pro 9", "2-in-1", - "laptop", - "tablet", - "Microsoft" + "Laptop", + "Tablet" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.apple-macbook-pro.json b/examples/function-calling/arguments/chatgpt.sale.input.apple-macbook-pro.json deleted file mode 100644 index 8848e50..0000000 --- a/examples/function-calling/arguments/chatgpt.sale.input.apple-macbook-pro.json +++ /dev/null @@ -1,1074 +0,0 @@ -{ - "section_code": "general", - "status": null, - "opened_at": null, - "closed_at": null, - "content": { - "title": "Apple MacBook Pro", - "format": "md", - "body": "MacBook Pro\n\n**The Ultimate Tool for Professionals**\n\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\n\n- **Remarkable Performance**\n \n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\n \n- **Outstanding Display**\n \n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\n \n- **All-Day Battery Life**\n \n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\n \n- **Sleek Yet Powerful Design**\n \n A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\n \n- **Smart Connectivity**\n \n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\n \nWith MacBook Pro, your potential knows no bounds. **It’s time to rediscover what you’re capable of.**\n", - "files": [ - { - "name": "apple-macbook-pro-thumbnail", - "extension": "png", - "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617" - } - ], - "thumbnails": [ - { - "name": "apple-macbook-pro-thumbnail", - "extension": "png", - "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617" - } - ] - }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "electronics", - "macbooks" - ] - } - ], - "units": [ - { - "options": [ - { - "type": "select", - "name": "Color", - "variable": true, - "candidates": [ - { - "name": "Silver" - }, - { - "name": "Space Gray" - } - ] - }, - { - "type": "select", - "name": "RAM", - "variable": true, - "candidates": [ - { - "name": "16GB" - }, - { - "name": "32GB" - }, - { - "name": "64GB" - } - ] - }, - { - "type": "select", - "name": "SSD", - "variable": true, - "candidates": [ - { - "name": "512GB" - }, - { - "name": "1TB" - }, - { - "name": "2TB" - } - ] - }, - { - "type": "select", - "name": "Keyboard Language", - "variable": true, - "candidates": [ - { - "name": "English" - }, - { - "name": "Korean" - } - ] - } - ], - "stocks": [ - { - "name": "MacBook Pro (Silver, 16GB, 512GB, English)", - "price": { - "nominal": 2000000, - "real": 1800000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 16GB, 512GB, Korean)", - "price": { - "nominal": 2000000, - "real": 1800000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 16GB, 1TB, English)", - "price": { - "nominal": 2300000, - "real": 2070000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 16GB, 1TB, Korean)", - "price": { - "nominal": 2300000, - "real": 2070000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 16GB, 2TB, English)", - "price": { - "nominal": 2900000, - "real": 2610000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 16GB, 2TB, Korean)", - "price": { - "nominal": 2900000, - "real": 2610000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 32GB, 512GB, English)", - "price": { - "nominal": 2600000, - "real": 2340000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 32GB, 512GB, Korean)", - "price": { - "nominal": 2600000, - "real": 2340000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 32GB, 1TB, English)", - "price": { - "nominal": 2900000, - "real": 2610000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 32GB, 1TB, Korean)", - "price": { - "nominal": 2900000, - "real": 2610000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 32GB, 2TB, English)", - "price": { - "nominal": 3500000, - "real": 3150000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 32GB, 2TB, Korean)", - "price": { - "nominal": 3500000, - "real": 3150000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 64GB, 512GB, English)", - "price": { - "nominal": 3200000, - "real": 2880000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 64GB, 512GB, Korean)", - "price": { - "nominal": 3200000, - "real": 2880000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 64GB, 1TB, English)", - "price": { - "nominal": 3500000, - "real": 3150000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 64GB, 1TB, Korean)", - "price": { - "nominal": 3500000, - "real": 3150000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Silver, 64GB, 2TB, English)", - "price": { - "nominal": 4100000, - "real": 3690000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Silver, 64GB, 2TB, Korean)", - "price": { - "nominal": 4100000, - "real": 3690000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 16GB, 512GB, English)", - "price": { - "nominal": 2050000, - "real": 1845000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 16GB, 512GB, Korean)", - "price": { - "nominal": 2050000, - "real": 1845000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 16GB, 1TB, English)", - "price": { - "nominal": 2350000, - "real": 2115000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 16GB, 1TB, Korean)", - "price": { - "nominal": 2350000, - "real": 2115000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 16GB, 2TB, English)", - "price": { - "nominal": 2950000, - "real": 2655000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 16GB, 2TB, Korean)", - "price": { - "nominal": 2950000, - "real": 2655000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 32GB, 512GB, English)", - "price": { - "nominal": 2650000, - "real": 2385000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 32GB, 512GB, Korean)", - "price": { - "nominal": 2650000, - "real": 2385000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 32GB, 1TB, English)", - "price": { - "nominal": 2950000, - "real": 2655000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 32GB, 1TB, Korean)", - "price": { - "nominal": 2950000, - "real": 2655000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 32GB, 2TB, English)", - "price": { - "nominal": 3550000, - "real": 3195000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 32GB, 2TB, Korean)", - "price": { - "nominal": 3550000, - "real": 3195000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 1 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 64GB, 512GB, English)", - "price": { - "nominal": 3250000, - "real": 2925000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 64GB, 512GB, Korean)", - "price": { - "nominal": 3250000, - "real": 2925000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 0 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 64GB, 1TB, English)", - "price": { - "nominal": 3550000, - "real": 3195000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 64GB, 1TB, Korean)", - "price": { - "nominal": 3550000, - "real": 3195000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 64GB, 2TB, English)", - "price": { - "nominal": 4150000, - "real": 3735000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "name": "MacBook Pro (Space Gray, 64GB, 2TB, Korean)", - "price": { - "nominal": 4150000, - "real": 3735000 - }, - "quantity": 10000, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - } - ], - "name": "MacBook M3 Pro 14inch Entity", - "required": true, - "primary": false - }, - { - "options": [], - "stocks": [ - { - "name": "Warranty Program", - "price": { - "nominal": 100000, - "real": 89000 - }, - "quantity": 10000, - "choices": [] - } - ], - "name": "Warranty Program", - "required": false, - "primary": false - }, - { - "options": [], - "stocks": [ - { - "name": "Magnetic Keyboard", - "price": { - "nominal": 200000, - "real": 169000 - }, - "quantity": 8000, - "choices": [] - } - ], - "name": "Magnetic Keyboard", - "required": false, - "primary": false - } - ], - "tags": [] -} \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.json b/examples/function-calling/arguments/chatgpt.sale.input.json index b80b752..74006e8 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.json +++ b/examples/function-calling/arguments/chatgpt.sale.input.json @@ -30,7 +30,7 @@ { "code": "samchon", "category_codes": [ - "2_in_1_laptops" + "2in1_laptops" ] } ], @@ -88,7 +88,7 @@ ], "stocks": [ { - "name": "Surface Pro 9 (i3, 8GB, 128GB)", + "name": "Surface Pro 9 - i3/8GB/128GB", "price": { "nominal": 1000000, "real": 899000 @@ -110,7 +110,7 @@ ] }, { - "name": "Surface Pro 9 (i3, 16GB, 256GB)", + "name": "Surface Pro 9 - i3/16GB/256GB", "price": { "nominal": 1200000, "real": 1099000 @@ -132,7 +132,7 @@ ] }, { - "name": "Surface Pro 9 (i3, 16GB, 512GB)", + "name": "Surface Pro 9 - i3/16GB/512GB", "price": { "nominal": 1400000, "real": 1299000 @@ -154,7 +154,7 @@ ] }, { - "name": "Surface Pro 9 (i5, 16GB, 256GB)", + "name": "Surface Pro 9 - i5/16GB/256GB", "price": { "nominal": 1500000, "real": 1399000 @@ -176,7 +176,7 @@ ] }, { - "name": "Surface Pro 9 (i5, 32GB, 512GB)", + "name": "Surface Pro 9 - i5/32GB/512GB", "price": { "nominal": 1800000, "real": 1699000 @@ -198,7 +198,7 @@ ] }, { - "name": "Surface Pro 9 (i7, 16GB, 512GB)", + "name": "Surface Pro 9 - i7/16GB/512GB", "price": { "nominal": 1800000, "real": 1699000 @@ -220,7 +220,7 @@ ] }, { - "name": "Surface Pro 9 (i7, 32GB, 512GB)", + "name": "Surface Pro 9 - i7/32GB/512GB", "price": { "nominal": 2000000, "real": 1899000 @@ -243,14 +243,14 @@ } ], "name": "Surface Pro 9 Entity", - "required": true, - "primary": true + "primary": true, + "required": true }, { "options": [], "stocks": [ { - "name": "Surface Pro 9 Warranty", + "name": "Warranty Program", "price": { "nominal": 100000, "real": 89000 @@ -260,14 +260,14 @@ } ], "name": "Warranty Program", - "required": false, - "primary": false + "primary": false, + "required": false }, { "options": [], "stocks": [ { - "name": "Surface Pro 9 Keyboard", + "name": "Magnetic Keyboard", "price": { "nominal": 200000, "real": 169000 @@ -277,18 +277,15 @@ } ], "name": "Magnetic Keyboard", - "required": false, - "primary": false + "primary": false, + "required": false } ], "tags": [ - "Surface Pro 9", - "2-in-1", - "tablet", - "laptop", + "Surface Pro", + "2-in-1 Laptop", + "Tablet", "Microsoft", - "5G", - "detachable keyboard", - "touchscreen" + "Windows" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.samsung-galaxy-watch-7.json b/examples/function-calling/arguments/chatgpt.samsung-galaxy-watch-7.input.json similarity index 81% rename from examples/function-calling/arguments/chatgpt.sale.input.samsung-galaxy-watch-7.json rename to examples/function-calling/arguments/chatgpt.samsung-galaxy-watch-7.input.json index adfc288..7d37a79 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.samsung-galaxy-watch-7.json +++ b/examples/function-calling/arguments/chatgpt.samsung-galaxy-watch-7.input.json @@ -6,7 +6,7 @@ "content": { "title": "Galaxy Watch 7", "format": "md", - "body": "The Galaxy Watch 7 is a premium smartwatch designed with innovative aesthetics and high-quality materials, making it a perfect fit for both daily life and work. ([samsung.com](https://www.samsung.com/sec/watches/galaxy-watch/galaxy-watch7/))\n\n“Upgrade Your Style”: The Galaxy Watch 7 adds a sophisticated touch to your wrist with its floating glass design and a variety of color options.\n“Personalized Sleep Coaching”: Its sleep tracking feature analyzes your sleep patterns and provides personalized sleep coaching.\n\n“Enhanced Workout Tracking”: Supports a wide range of workout modes and provides detailed data such as heart rate and calorie burn.\n\n“Powerful Performance”: Equipped with the latest processor and long battery life, it offers stable performance for everything from daily use to high-intensity workouts.\n\nIn summary, the Galaxy Watch 7 is a premium smartwatch combining style, functionality, and durability, making it the perfect choice to enhance your health and lifestyle.", + "body": "The Galaxy Watch 7 is a premium smartwatch designed with innovative aesthetics and high-quality materials, making it a perfect fit for both daily life and work. ([samsung.com](https://www.samsung.com/sec/watches/galaxy-watch/galaxy-watch7/))\n\n“Upgrade Your Style”: The Galaxy Watch 7 adds a sophisticated touch to your wrist with its floating glass design and a variety of color options. “Personalized Sleep Coaching”: Its sleep tracking feature analyzes your sleep patterns and provides personalized sleep coaching.\n \n“Enhanced Workout Tracking”: Supports a wide range of workout modes and provides detailed data such as heart rate and calorie burn.\n\n“Powerful Performance”: Equipped with the latest processor and long battery life, it offers stable performance for everything from daily use to high-intensity workouts.\n\nIn summary, the Galaxy Watch 7 is a premium smartwatch combining style, functionality, and durability, making it the perfect choice to enhance your health and lifestyle.", "files": [], "thumbnails": [ { @@ -25,40 +25,6 @@ } ], "units": [ - { - "options": [], - "stocks": [ - { - "name": "Warranty Program", - "price": { - "nominal": 100000, - "real": 89000 - }, - "quantity": 10000, - "choices": [] - } - ], - "name": "Warranty Program", - "required": false, - "primary": false - }, - { - "options": [], - "stocks": [ - { - "name": "Replacement Strap", - "price": { - "nominal": 50000, - "real": 39000 - }, - "quantity": 5000, - "choices": [] - } - ], - "name": "Replacement Strap", - "required": false, - "primary": false - }, { "options": [ { @@ -93,7 +59,7 @@ ], "stocks": [ { - "name": "Galaxy Watch 7 - Standard / Green", + "name": "Galaxy Watch 7 - Standard Green", "price": { "nominal": 400000, "real": 359000 @@ -111,7 +77,7 @@ ] }, { - "name": "Galaxy Watch 7 - Standard / Silver", + "name": "Galaxy Watch 7 - Standard Silver", "price": { "nominal": 400000, "real": 359000 @@ -129,7 +95,7 @@ ] }, { - "name": "Galaxy Watch 7 - Standard / Cream", + "name": "Galaxy Watch 7 - Standard Cream", "price": { "nominal": 400000, "real": 359000 @@ -147,7 +113,7 @@ ] }, { - "name": "Galaxy Watch 7 - Ultra / Green", + "name": "Galaxy Watch 7 - Ultra Green", "price": { "nominal": 600000, "real": 549000 @@ -165,7 +131,7 @@ ] }, { - "name": "Galaxy Watch 7 - Ultra / Silver", + "name": "Galaxy Watch 7 - Ultra Silver", "price": { "nominal": 600000, "real": 549000 @@ -183,7 +149,7 @@ ] }, { - "name": "Galaxy Watch 7 - Ultra / Cream", + "name": "Galaxy Watch 7 - Ultra Cream", "price": { "nominal": 600000, "real": 549000 @@ -202,8 +168,42 @@ } ], "name": "Galaxy Watch 7", - "required": true, - "primary": true + "primary": true, + "required": true + }, + { + "options": [], + "stocks": [ + { + "name": "Warranty Program", + "price": { + "nominal": 100000, + "real": 89000 + }, + "quantity": 10000, + "choices": [] + } + ], + "name": "Warranty Program", + "primary": false, + "required": false + }, + { + "options": [], + "stocks": [ + { + "name": "Replacement Strap", + "price": { + "nominal": 50000, + "real": 39000 + }, + "quantity": 5000, + "choices": [] + } + ], + "name": "Replacement Strap", + "primary": false, + "required": false } ], "tags": [] diff --git a/examples/function-calling/arguments/chatgpt.sale.input.stanley-tumbler-collection.json b/examples/function-calling/arguments/chatgpt.stanley-tumbler-collection.input.json similarity index 59% rename from examples/function-calling/arguments/chatgpt.sale.input.stanley-tumbler-collection.json rename to examples/function-calling/arguments/chatgpt.stanley-tumbler-collection.input.json index 3b314ae..d92c737 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.stanley-tumbler-collection.json +++ b/examples/function-calling/arguments/chatgpt.stanley-tumbler-collection.input.json @@ -6,7 +6,7 @@ "content": { "title": "Stanley Tumbler Collection", "format": "md", - "body": "The Stanley Tumbler Collection offers a range of versatile, durable, and stylish tumblers to suit every lifestyle. With customizable options and eco-friendly designs, these tumblers are the ideal choice for anyone looking to elevate their drinkware experience. Don’t miss this opportunity to grab your Stanley Tumbler today!\n\n### Product Description\n\n> The Stanley Tumbler Collection is the perfect companion for staying hydrated, whether you're at work, on the go, or exploring the great outdoors. Designed with functionality and durability in mind, these tumblers are built to keep your drinks at the perfect temperature all day long.\n> \n> - **\"Built for Adventure\"**: The Stanley Tumbler features rugged construction, making it ideal for outdoor enthusiasts and urban adventurers alike.\n> - **\"Temperature Control at Its Best\"**: With double-wall vacuum insulation, the Stanley Tumbler keeps drinks hot for up to 7 hours or cold for up to 11 hours.\n> - **\"Leakproof and Spillproof\"**: Designed for ease of use, these tumblers are 100% leakproof, ensuring your drink stays exactly where it belongs.\n> - **\"Eco-Friendly and Sustainable\"**: Made with 18/8 stainless steel, Stanley Tumblers are BPA-free and built to last, reducing waste from disposable cups.\n> \n> In summary, the Stanley Tumbler Collection combines durability, functionality, and style. Whether you're sipping coffee during your morning commute or staying hydrated during a hike, Stanley Tumblers are designed to meet your needs. Choose Stanley and enjoy unmatched quality and performance.\n", + "body": "### Product Description\n\n> The Stanley Tumbler Collection is the perfect companion for staying hydrated, whether you're at work, on the go, or exploring the great outdoors. Designed with functionality and durability in mind, these tumblers are built to keep your drinks at the perfect temperature all day long.\n> \n> - **\"Built for Adventure\"**: The Stanley Tumbler features rugged construction, making it ideal for outdoor enthusiasts and urban adventurers alike.\n> - **\"Temperature Control at Its Best\"**: With double-wall vacuum insulation, the Stanley Tumbler keeps drinks hot for up to 7 hours or cold for up to 11 hours.\n> - **\"Leakproof and Spillproof\"**: Designed for ease of use, these tumblers are 100% leakproof, ensuring your drink stays exactly where it belongs.\n> - **\"Eco-Friendly and Sustainable\"**: Made with 18/8 stainless steel, Stanley Tumblers are BPA-free and built to last, reducing waste from disposable cups.\n> \n> In summary, the Stanley Tumbler Collection combines durability, functionality, and style. Whether you're sipping coffee during your morning commute or staying hydrated during a hike, Stanley Tumblers are designed to meet your needs. Choose Stanley and enjoy unmatched quality and performance.\n", "files": [], "thumbnails": [ { @@ -20,8 +20,8 @@ { "code": "samchon", "category_codes": [ - "accessories", - "others" + "other", + "accessories" ] } ], @@ -46,7 +46,7 @@ }, { "type": "select", - "name": "Color", + "name": "Color Options", "variable": true, "candidates": [ { @@ -63,7 +63,7 @@ ], "stocks": [ { - "name": "Classic Tumbler - 16 oz Matte Black", + "name": "Classic Tumbler (16 oz, Matte Black)", "price": { "nominal": 40000, "real": 35000 @@ -81,7 +81,7 @@ ] }, { - "name": "Classic Tumbler - 20 oz Hammertone Green", + "name": "Classic Tumbler (20 oz, Hammertone Green)", "price": { "nominal": 50000, "real": 44000 @@ -99,7 +99,7 @@ ] }, { - "name": "Classic Tumbler - 24 oz Polar White", + "name": "Classic Tumbler (24 oz, Polar White)", "price": { "nominal": 60000, "real": 54000 @@ -118,8 +118,8 @@ } ], "name": "Classic Tumbler", - "required": true, - "primary": true + "primary": true, + "required": true }, { "options": [], @@ -135,8 +135,8 @@ } ], "name": "Adventure Quencher Tumbler", - "required": false, - "primary": false + "primary": false, + "required": false }, { "options": [], @@ -152,14 +152,16 @@ } ], "name": "Accessories Set", - "required": false, - "primary": false + "primary": false, + "required": false } ], "tags": [ - "Stanley", - "Tumbler", - "Drinkware", - "Eco-Friendly" + "tumbler", + "stanley", + "hydration", + "drinkware", + "outdoor", + "eco-friendly" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.apple-iphone.json b/examples/function-calling/arguments/claude.apple-iphone.input.json similarity index 99% rename from examples/function-calling/arguments/claude.sale.input.apple-iphone.json rename to examples/function-calling/arguments/claude.apple-iphone.input.json index 875ef57..caf171d 100644 --- a/examples/function-calling/arguments/claude.sale.input.apple-iphone.json +++ b/examples/function-calling/arguments/claude.apple-iphone.input.json @@ -3,6 +3,16 @@ "status": null, "opened_at": null, "closed_at": null, + "channels": [ + { + "code": "samchon", + "category_codes": [ + "electronics", + "laptops", + "macbooks" + ] + } + ], "content": { "title": "Apple MacBook Pro", "format": "md", @@ -10,27 +20,23 @@ "files": [], "thumbnails": [ { - "name": "macbook-pro", + "name": "macbook-pro-thumbnail", "extension": "jpeg", "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617" } ] }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "electronics", - "laptops", - "macbooks" - ] - } + "tags": [ + "macbook", + "apple", + "laptop", + "pro" ], "units": [ { "name": "MacBook M3 Pro 14inch Entity", - "primary": true, "required": true, + "primary": true, "options": [ { "type": "select", @@ -1032,8 +1038,8 @@ }, { "name": "Warranty Program", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -1049,8 +1055,8 @@ }, { "name": "Magnetic Keyboard", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -1064,12 +1070,5 @@ } ] } - ], - "tags": [ - "apple", - "macbook", - "laptop", - "macbook pro", - "m3" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.apple-macbook-pro.input.json b/examples/function-calling/arguments/claude.apple-macbook-pro.input.json new file mode 100644 index 0000000..d5a310f --- /dev/null +++ b/examples/function-calling/arguments/claude.apple-macbook-pro.input.json @@ -0,0 +1,215 @@ +{ + "section_code": "general", + "status": null, + "opened_at": null, + "closed_at": null, + "channels": [ + { + "code": "samchon", + "category_codes": [ + "macbooks" + ] + } + ], + "content": { + "title": "Apple MacBook Pro", + "format": "md", + "body": "MacBook Pro\n\n**The Ultimate Tool for Professionals**\n\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\n\n- **Remarkable Performance**\n \n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\n \n- **Outstanding Display**\n \n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\n \n- **All-Day Battery Life**\n \n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\n \n- **Sleek Yet Powerful Design**\n \n A precision aluminum body that's lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\n \n- **Smart Connectivity**\n \n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\n\nWith MacBook Pro, your potential knows no bounds. **It's time to rediscover what you're capable of.**", + "files": [], + "thumbnails": [ + { + "name": "apple-macbook-pro-thumbnail", + "extension": "jpeg", + "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617" + } + ] + }, + "tags": [ + "MacBook Pro", + "Apple", + "Laptop", + "Professional", + "M3 Pro" + ], + "units": [ + { + "name": "MacBook M3 Pro 14inch Entity", + "required": true, + "primary": true, + "options": [ + { + "type": "select", + "name": "Color", + "variable": true, + "candidates": [ + { + "name": "Silver" + }, + { + "name": "Space Gray" + } + ] + }, + { + "type": "select", + "name": "RAM", + "variable": true, + "candidates": [ + { + "name": "16GB" + }, + { + "name": "32GB" + }, + { + "name": "64GB" + } + ] + }, + { + "type": "select", + "name": "SSD", + "variable": true, + "candidates": [ + { + "name": "512GB" + }, + { + "name": "1TB" + }, + { + "name": "2TB" + } + ] + }, + { + "type": "select", + "name": "Keyboard Language", + "variable": true, + "candidates": [ + { + "name": "English" + }, + { + "name": "Korean" + } + ] + } + ], + "stocks": [ + { + "name": "Silver / 16GB / 512GB / English", + "price": { + "nominal": 2000000, + "real": 1800000 + }, + "quantity": 10000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ] + }, + { + "name": "Silver / 16GB / 512GB / Korean", + "price": { + "nominal": 2000000, + "real": 1800000 + }, + "quantity": 10000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ] + }, + { + "name": "Silver / 16GB / 1TB / English", + "price": { + "nominal": 2300000, + "real": 2070000 + }, + "quantity": 10000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ] + } + ] + }, + { + "name": "Warranty Program", + "required": false, + "primary": false, + "options": [], + "stocks": [ + { + "name": "Warranty Program", + "price": { + "nominal": 100000, + "real": 89000 + }, + "quantity": 10000, + "choices": [] + } + ] + }, + { + "name": "Magnetic Keyboard", + "required": false, + "primary": false, + "options": [], + "stocks": [ + { + "name": "Magnetic Keyboard", + "price": { + "nominal": 200000, + "real": 169000 + }, + "quantity": 8000, + "choices": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.apple-vision-pro.json b/examples/function-calling/arguments/claude.apple-vision-pro.input.json similarity index 65% rename from examples/function-calling/arguments/chatgpt.sale.input.apple-vision-pro.json rename to examples/function-calling/arguments/claude.apple-vision-pro.input.json index c10bf5e..591936c 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.apple-vision-pro.json +++ b/examples/function-calling/arguments/claude.apple-vision-pro.input.json @@ -6,14 +6,8 @@ "content": { "title": "Apple Vision Air", "format": "md", - "body": "### Preface\n\nThe Apple Vision Air is a groundbreaking addition to Apple's lineup of innovative devices, designed to enhance your digital experience through augmented reality. With its sleek design and advanced technology, the Vision Air aims to redefine how users interact with their surroundings, providing a seamless blend of the physical and digital worlds.\n\n### Content\n\n![apple-vision-pro-thumbnail.png](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s)\n\nThe Apple Vision Air features a lightweight and comfortable design, making it perfect for extended use. Equipped with high-resolution displays and cutting-edge optics, it offers stunning visuals that immerse users in their augmented reality experiences. The device is powered by the latest Apple silicon, ensuring smooth performance and efficient battery life.\n\nThe Apple Vision Air is more than just a device; it’s a gateway to a new reality. Whether for work, play, or exploration, it represents the future of immersive technology.\n\n### Key Features\n\n- Augmented Reality Capabilities: Experience a new dimension of interaction with AR applications that enhance everyday tasks and entertainment.\n\n- High-Resolution Display: Enjoy vibrant and crisp visuals, making every detail come to life.\n\n- Intuitive Controls: Navigate effortlessly with gesture controls and voice commands, designed for user convenience.\n\n- Seamless Integration: Connect with other Apple devices for a unified ecosystem that enhances productivity and creativity.\n\n- Durability and Comfort: Built with premium materials, the Vision Air ensures longevity and comfort during prolonged use.\n\n### SKU\n\n- **AVA-2023-001 | 256GB | ₩2,990,000**\n\n- **AVA-2023-002 | 512GB | ₩3,490,000**\n\n- **AVA-2023-003 | 1TB | ₩3,990,000**", - "files": [ - { - "name": "apple-vision-pro-thumbnail", - "extension": "png", - "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s" - } - ], + "body": "### Preface\n\nThe Apple Vision Air is a groundbreaking addition to Apple's lineup of innovative devices, designed to enhance your digital experience through augmented reality. With its sleek design and advanced technology, the Vision Air aims to redefine how users interact with their surroundings, providing a seamless blend of the physical and digital worlds.\n\n### Content\n\n![apple-vision-pro-thumbnail.png](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s)\n\nThe Apple Vision Air features a lightweight and comfortable design, making it perfect for extended use. Equipped with high-resolution displays and cutting-edge optics, it offers stunning visuals that immerse users in their augmented reality experiences. The device is powered by the latest Apple silicon, ensuring smooth performance and efficient battery life.\n\nThe Apple Vision Air is more than just a device; it's a gateway to a new reality. Whether for work, play, or exploration, it represents the future of immersive technology.\n\n### Key Features\n\nAugmented Reality Capabilities: Experience a new dimension of interaction with AR applications that enhance everyday tasks and entertainment.\n\nHigh-Resolution Display: Enjoy vibrant and crisp visuals, making every detail come to life.\nIntuitive Controls: Navigate effortlessly with gesture controls and voice commands, designed for user convenience.\n\nSeamless Integration: Connect with other Apple devices for a unified ecosystem that enhances productivity and creativity.\n\nDurability and Comfort: Built with premium materials, the Vision Air ensures longevity and comfort during prolonged use.", + "files": [], "thumbnails": [ { "name": "apple-vision-pro-thumbnail", @@ -33,10 +27,13 @@ ], "units": [ { + "name": "Apple Vision Air", + "primary": true, + "required": true, "options": [ { "type": "select", - "name": "Storage Capacity", + "name": "Storage", "variable": true, "candidates": [ { @@ -53,7 +50,7 @@ ], "stocks": [ { - "name": "Apple Vision Air - 256GB", + "name": "Apple Vision Air 256GB", "price": { "nominal": 2990000, "real": 2990000 @@ -67,7 +64,7 @@ ] }, { - "name": "Apple Vision Air - 512GB", + "name": "Apple Vision Air 512GB", "price": { "nominal": 3490000, "real": 3490000 @@ -81,7 +78,7 @@ ] }, { - "name": "Apple Vision Air - 1TB", + "name": "Apple Vision Air 1TB", "price": { "nominal": 3990000, "real": 3990000 @@ -94,17 +91,15 @@ } ] } - ], - "name": "Apple Vision Air", - "required": true, - "primary": true + ] } ], "tags": [ "Apple", "Vision Air", - "augmented reality", - "smart glasses", - "technology" + "AR", + "Smart Glasses", + "Augmented Reality", + "Wearable" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json b/examples/function-calling/arguments/claude.drawfit-women-soft-cashmere-oversized-half-coat.input.json similarity index 99% rename from examples/function-calling/arguments/claude.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json rename to examples/function-calling/arguments/claude.drawfit-women-soft-cashmere-oversized-half-coat.input.json index e42842c..23e0e21 100644 --- a/examples/function-calling/arguments/claude.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json +++ b/examples/function-calling/arguments/claude.drawfit-women-soft-cashmere-oversized-half-coat.input.json @@ -3,9 +3,25 @@ "status": null, "opened_at": null, "closed_at": null, + "tags": [ + "women", + "coat", + "cashmere", + "winter", + "outerwear" + ], + "channels": [ + { + "code": "samchon", + "category_codes": [ + "clothes", + "clothing" + ] + } + ], "content": { "title": "Drawfit Women Soft Cashmere Oversized Half Coat", - "format": "txt", + "format": "md", "body": "The Drawfit Women Soft Cashmere Oversized Half Coat is an essential winter item, crafted from a soft cashmere blend that provides warmth and comfort. Its stylish oversized design makes it perfect for pairing with various outfits.\n\n- \"Comfortable Fit\": Made from soft materials, it can be worn comfortably without irritating the skin.\n- \"Stylish Oversized Design\": The relaxed fit allows for easy layering, suitable for both casual daily looks and formal occasions.\n- Luxurious Design\": With classic colors and minimal details, it easily matches with any outfit.\n- \"Warmth and Elegance\": A perfect choice to stay warm in winter while maintaining a stylish appearance.\n\nIn summary, the Drawfit Women Soft Cashmere Oversized Half Coat is a must-have winter item that combines style and functionality. With its luxurious design and excellent comfort, it's the perfect choice for any occasion.", "thumbnails": [ { @@ -26,27 +42,11 @@ ], "files": [] }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "clothes", - "accessories/clothing" - ] - } - ], - "tags": [ - "coat", - "women", - "cashmere", - "winter", - "outerwear" - ], "units": [ { "name": "Drawfit Women Soft Cashmere Oversized Half Coat", - "primary": true, "required": true, + "primary": true, "options": [ { "type": "select", diff --git a/examples/function-calling/arguments/claude.example.input.json b/examples/function-calling/arguments/claude.example.input.json new file mode 100644 index 0000000..ba32f6e --- /dev/null +++ b/examples/function-calling/arguments/claude.example.input.json @@ -0,0 +1,4 @@ +{ + "name": "John Doe", + "age": 42 +} \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.herman-miller-chair.json b/examples/function-calling/arguments/claude.herman-miller-chair.input.json similarity index 98% rename from examples/function-calling/arguments/claude.sale.input.herman-miller-chair.json rename to examples/function-calling/arguments/claude.herman-miller-chair.input.json index 94e9aed..ff8b1c8 100644 --- a/examples/function-calling/arguments/claude.sale.input.herman-miller-chair.json +++ b/examples/function-calling/arguments/claude.herman-miller-chair.input.json @@ -7,14 +7,14 @@ "title": "Herman Miller Chair", "format": "txt", "body": "The Herman Miller chair is an iconic ergonomic seating solution designed to provide unparalleled comfort and support. With its innovative design and high-quality materials, it is perfect for both home and office use.\n\n\"Elevate Your Workspace\": The Herman Miller chair enhances your productivity with its ergonomic features, ensuring you stay comfortable during long hours of work.\n\"Timeless Design\": Combining aesthetics with functionality, this chair fits seamlessly into any environment, adding a touch of elegance to your space.\n\"Adjustable Comfort\": With customizable settings, the Herman Miller chair adapts to your body, promoting better posture and reducing fatigue.\n\"Built to Last\": Made from durable materials, this chair is designed for longevity, making it a worthwhile investment for anyone seeking quality seating.\nIn summary, the Herman Miller chair stands out as a premium choice for users who value comfort, style, and durability. Whether for work or leisure, this chair is ready to enhance your experience and support your well-being.", - "files": [], "thumbnails": [ { - "name": "herman-miller-chair", + "name": "herman-miller-chair-thumbnail", "extension": "png", "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRaJWHEnwGGg-8rHni_2hN8HKUSkEBdU3X4w&s" } - ] + ], + "files": [] }, "channels": [ { @@ -27,8 +27,8 @@ "units": [ { "name": "Herman Miller Chair", - "primary": true, "required": true, + "primary": true, "options": [ { "type": "select", @@ -173,8 +173,8 @@ }, { "name": "Warranty Program", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -190,8 +190,8 @@ }, { "name": "Replacement Cushion", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -207,8 +207,8 @@ } ], "tags": [ - "furniture", "chair", + "furniture", "office", "herman miller", "ergonomic" diff --git a/examples/function-calling/arguments/claude.sale.input.leica-m6.json b/examples/function-calling/arguments/claude.leica-m6.input.json similarity index 93% rename from examples/function-calling/arguments/claude.sale.input.leica-m6.json rename to examples/function-calling/arguments/claude.leica-m6.input.json index 33ca356..48f5bc6 100644 --- a/examples/function-calling/arguments/claude.sale.input.leica-m6.json +++ b/examples/function-calling/arguments/claude.leica-m6.input.json @@ -7,7 +7,6 @@ "title": "Leica M6 (2022 Reissue): The Return of a Legend", "format": "md", "body": "The Leica M6, a beloved classic in the world of film photography, is back! The 2022 reissue brings modern enhancements while staying true to the original's timeless charm. Designed for enthusiasts and professionals, the new M6 is a tribute to the past, with a touch of the future.\n\n- **\"Rediscover the Classic\":** The Leica M6 reissue retains the original design, offering the same iconic look and feel that photographers fell in love with decades ago.\n- **\"Enhanced for the Modern Era\":** Now featuring improved durability, a brighter viewfinder, and the latest advancements in metering, the M6 reissue ensures a seamless shooting experience.\n- **\"Craftsmanship Meets Tradition\":** Made in Germany, the M6 embodies Leica's dedication to quality and precision, delivering a tool that feels as good as it performs.\n- **\"For the Love of Film\":** The M6 is perfect for those who cherish the art of analog photography, providing an unmatched tactile and creative experience.\n\nIn summary, the 2022 Leica M6 reissue is a perfect blend of heritage and innovation. It's a must-have for collectors, analog enthusiasts, and anyone seeking the pure joy of shooting on film with a legendary camera.", - "files": [], "thumbnails": [ { "name": "leica-m6-thumbnail-1", @@ -19,22 +18,29 @@ "extension": "webp", "url": "https://leica-camera.com/sites/default/files/styles/r_media_fullscreen/public/2022-09/leica_m6_packaging_ambient_3840x2160.jpg.webp?itok=lig4kkiB" } - ] + ], + "files": [] }, "channels": [ { "code": "samchon", "category_codes": [ - "electronics", "cameras" ] } ], + "tags": [ + "camera", + "leica", + "film camera", + "m6", + "analog camera" + ], "units": [ { "name": "Leica M6 Body (2022 Reissue)", - "primary": true, "required": true, + "primary": true, "options": [ { "type": "select", @@ -52,7 +58,7 @@ ], "stocks": [ { - "name": "Leica M6 Body - Black Paint", + "name": "Leica M6 Body (2022 Reissue) - Black Paint", "price": { "nominal": 7200000, "real": 6899000 @@ -66,7 +72,7 @@ ] }, { - "name": "Leica M6 Body - Silver Chrome", + "name": "Leica M6 Body (2022 Reissue) - Silver Chrome", "price": { "nominal": 7200000, "real": 6899000 @@ -83,8 +89,8 @@ }, { "name": "50mm Summilux Lens", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -98,13 +104,5 @@ } ] } - ], - "tags": [ - "Leica", - "M6", - "Camera", - "Film Camera", - "Photography", - "2022 Reissue" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.microsoft-surface-pro-9.json b/examples/function-calling/arguments/claude.microsoft-surface-pro-9.input.json similarity index 91% rename from examples/function-calling/arguments/chatgpt.sale.input.microsoft-surface-pro-9.json rename to examples/function-calling/arguments/claude.microsoft-surface-pro-9.input.json index 5694b2b..79c475c 100644 --- a/examples/function-calling/arguments/chatgpt.sale.input.microsoft-surface-pro-9.json +++ b/examples/function-calling/arguments/claude.microsoft-surface-pro-9.input.json @@ -7,7 +7,6 @@ "title": "Surface Pro 9", "format": "md", "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.", - "files": [], "thumbnails": [ { "name": "microsoft-surface-pro-9-thumbnail-1", @@ -24,53 +23,23 @@ "extension": "jpeg", "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg" } - ] + ], + "files": [] }, "channels": [ { "code": "samchon", "category_codes": [ - "laptops", - "2_in_1_laptops" + "2in1_laptops", + "windows_tablets" ] } ], "units": [ { - "options": [], - "stocks": [ - { - "name": "Warranty Program", - "price": { - "nominal": 100000, - "real": 89000 - }, - "quantity": 10000, - "choices": [] - } - ], - "name": "Warranty Program", - "required": false, - "primary": false - }, - { - "options": [], - "stocks": [ - { - "name": "Magnetic Keyboard", - "price": { - "nominal": 200000, - "real": 169000 - }, - "quantity": 8000, - "choices": [] - } - ], - "name": "Magnetic Keyboard", - "required": false, - "primary": false - }, - { + "name": "Surface Pro 9 Entity", + "required": true, + "primary": true, "options": [ { "type": "select", @@ -123,7 +92,7 @@ ], "stocks": [ { - "name": "Surface Pro 9 - i3, 8 GB, 128 GB", + "name": "Surface Pro 9 (i3/8GB/128GB)", "price": { "nominal": 1000000, "real": 899000 @@ -145,7 +114,7 @@ ] }, { - "name": "Surface Pro 9 - i3, 16 GB, 256 GB", + "name": "Surface Pro 9 (i3/16GB/256GB)", "price": { "nominal": 1200000, "real": 1099000 @@ -167,7 +136,7 @@ ] }, { - "name": "Surface Pro 9 - i3, 16 GB, 512 GB", + "name": "Surface Pro 9 (i3/16GB/512GB)", "price": { "nominal": 1400000, "real": 1299000 @@ -189,7 +158,7 @@ ] }, { - "name": "Surface Pro 9 - i5, 16 GB, 256 GB", + "name": "Surface Pro 9 (i5/16GB/256GB)", "price": { "nominal": 1500000, "real": 1399000 @@ -211,7 +180,7 @@ ] }, { - "name": "Surface Pro 9 - i5, 32 GB, 512 GB", + "name": "Surface Pro 9 (i5/32GB/512GB)", "price": { "nominal": 1800000, "real": 1699000 @@ -233,7 +202,7 @@ ] }, { - "name": "Surface Pro 9 - i7, 16 GB, 512 GB", + "name": "Surface Pro 9 (i7/16GB/512GB)", "price": { "nominal": 1800000, "real": 1699000 @@ -255,7 +224,7 @@ ] }, { - "name": "Surface Pro 9 - i7, 32 GB, 512 GB", + "name": "Surface Pro 9 (i7/32GB/512GB)", "price": { "nominal": 2000000, "real": 1899000 @@ -276,11 +245,48 @@ } ] } - ], - "name": "Surface Pro 9 Entity", - "required": true, - "primary": true + ] + }, + { + "name": "Warranty Program", + "required": false, + "primary": false, + "options": [], + "stocks": [ + { + "name": "Warranty Program", + "price": { + "nominal": 100000, + "real": 89000 + }, + "quantity": 10000, + "choices": [] + } + ] + }, + { + "name": "Magnetic Keyboard", + "required": false, + "primary": false, + "options": [], + "stocks": [ + { + "name": "Magnetic Keyboard", + "price": { + "nominal": 200000, + "real": 169000 + }, + "quantity": 8000, + "choices": [] + } + ] } ], - "tags": [] + "tags": [ + "Surface Pro 9", + "Windows Tablet", + "2-in-1 Laptop", + "Microsoft", + "Tablet PC" + ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.recursive.input.json b/examples/function-calling/arguments/claude.recursive.input.json new file mode 100644 index 0000000..342e3cd --- /dev/null +++ b/examples/function-calling/arguments/claude.recursive.input.json @@ -0,0 +1,147 @@ +[ + { + "code": "electronics", + "name": "Electronics", + "children": [ + { + "code": "desktops", + "name": "Desktops", + "children": [] + }, + { + "code": "laptops", + "name": "Laptops", + "children": [ + { + "code": "ultrabooks", + "name": "Ultrabooks", + "children": [] + }, + { + "code": "macbooks", + "name": "MacBooks", + "children": [] + }, + { + "code": "desknotes", + "name": "Desknotes", + "children": [] + }, + { + "code": "2in1_laptops", + "name": "2 in 1 Laptops", + "children": [] + } + ] + }, + { + "code": "tablets", + "name": "Tablets", + "children": [ + { + "code": "ipads", + "name": "iPads", + "children": [] + }, + { + "code": "android_tablets", + "name": "Android Tablets", + "children": [] + }, + { + "code": "windows_tablets", + "name": "Windows Tablets", + "children": [] + } + ] + }, + { + "code": "smart_phones", + "name": "Smart Phones", + "children": [ + { + "code": "mini_smartphones", + "name": "Mini Smartphones", + "children": [] + }, + { + "code": "phablets", + "name": "Phablets", + "children": [] + }, + { + "code": "gaming_smartphones", + "name": "Gaming Smartphones", + "children": [] + }, + { + "code": "rugged_smartphones", + "name": "Rugged Smartphones", + "children": [] + }, + { + "code": "foldable_smartphones", + "name": "Foldable Smartphones", + "children": [] + } + ] + }, + { + "code": "smart_watches", + "name": "Smart Watches", + "children": [] + }, + { + "code": "smart_glasses", + "name": "Smart Glasses", + "children": [] + }, + { + "code": "cameras", + "name": "Cameras", + "children": [] + }, + { + "code": "televisions", + "name": "Televisions", + "children": [] + } + ] + }, + { + "code": "furnitures", + "name": "Furnitures", + "children": [] + }, + { + "code": "accessories", + "name": "Accessories", + "children": [ + { + "code": "jewelry", + "name": "Jewelry", + "children": [] + }, + { + "code": "clothing", + "name": "Clothing", + "children": [] + }, + { + "code": "shoes", + "name": "Shoes", + "children": [] + } + ] + }, + { + "code": "clothes", + "name": "Clothes", + "children": [] + }, + { + "code": "others", + "name": "Others", + "children": [] + } +] \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.json b/examples/function-calling/arguments/claude.sale.input.json index 15ff604..2d8b912 100644 --- a/examples/function-calling/arguments/claude.sale.input.json +++ b/examples/function-calling/arguments/claude.sale.input.json @@ -3,38 +3,45 @@ "status": null, "opened_at": null, "closed_at": null, + "tags": [ + "surface", + "microsoft", + "2in1", + "tablet", + "laptop" + ], + "channels": [ + { + "code": "samchon", + "category_codes": [ + "2in1_laptops", + "windows_tablets" + ] + } + ], "content": { "title": "Surface Pro 9", "format": "md", "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.", - "files": [], "thumbnails": [ { - "name": "surface-pro-9-thumb-1", + "name": "microsoft-surface-pro-9-thumbnail-1", "extension": "jpeg", "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg" }, { - "name": "surface-pro-9-thumb-2", + "name": "microsoft-surface-pro-9-thumbnail-2", "extension": "jpeg", "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg" }, { - "name": "surface-pro-9-thumb-3", + "name": "microsoft-surface-pro-9-thumbnail-3", "extension": "jpeg", "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg" } - ] + ], + "files": [] }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "2_in_1_laptops", - "windows_tablets" - ] - } - ], "units": [ { "name": "Surface Pro 9 Entity", @@ -92,7 +99,7 @@ ], "stocks": [ { - "name": "Surface Pro 9 i3/8GB/128GB", + "name": "Surface Pro 9 (i3/8GB/128GB)", "price": { "nominal": 1000000, "real": 899000 @@ -114,7 +121,7 @@ ] }, { - "name": "Surface Pro 9 i3/16GB/256GB", + "name": "Surface Pro 9 (i3/16GB/256GB)", "price": { "nominal": 1200000, "real": 1099000 @@ -136,7 +143,7 @@ ] }, { - "name": "Surface Pro 9 i3/16GB/512GB", + "name": "Surface Pro 9 (i3/16GB/512GB)", "price": { "nominal": 1400000, "real": 1299000 @@ -158,7 +165,7 @@ ] }, { - "name": "Surface Pro 9 i5/16GB/256GB", + "name": "Surface Pro 9 (i5/16GB/256GB)", "price": { "nominal": 1500000, "real": 1399000 @@ -180,7 +187,7 @@ ] }, { - "name": "Surface Pro 9 i5/32GB/512GB", + "name": "Surface Pro 9 (i5/32GB/512GB)", "price": { "nominal": 1800000, "real": 1699000 @@ -202,7 +209,7 @@ ] }, { - "name": "Surface Pro 9 i7/16GB/512GB", + "name": "Surface Pro 9 (i7/16GB/512GB)", "price": { "nominal": 1800000, "real": 1699000 @@ -224,7 +231,7 @@ ] }, { - "name": "Surface Pro 9 i7/32GB/512GB", + "name": "Surface Pro 9 (i7/32GB/512GB)", "price": { "nominal": 2000000, "real": 1899000 @@ -254,7 +261,7 @@ "options": [], "stocks": [ { - "name": "Warranty Program", + "name": "Surface Pro 9 Warranty Program", "price": { "nominal": 100000, "real": 89000 @@ -271,7 +278,7 @@ "options": [], "stocks": [ { - "name": "Magnetic Keyboard", + "name": "Surface Pro 9 Magnetic Keyboard", "price": { "nominal": 200000, "real": 169000 @@ -281,13 +288,5 @@ } ] } - ], - "tags": [ - "Surface", - "Microsoft", - "Tablet", - "2-in-1", - "Laptop", - "Windows" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.samsung-galaxy-watch-7.json b/examples/function-calling/arguments/claude.samsung-galaxy-watch-7.input.json similarity index 97% rename from examples/function-calling/arguments/claude.sale.input.samsung-galaxy-watch-7.json rename to examples/function-calling/arguments/claude.samsung-galaxy-watch-7.input.json index 97e6241..c5b3fc1 100644 --- a/examples/function-calling/arguments/claude.sale.input.samsung-galaxy-watch-7.json +++ b/examples/function-calling/arguments/claude.samsung-galaxy-watch-7.input.json @@ -3,33 +3,32 @@ "status": null, "opened_at": null, "closed_at": null, + "channels": [ + { + "code": "samchon", + "category_codes": [ + "smart_watches" + ] + } + ], "content": { "title": "Galaxy Watch 7", "format": "md", "body": "The Galaxy Watch 7 is a premium smartwatch designed with innovative aesthetics and high-quality materials, making it a perfect fit for both daily life and work. ([samsung.com](https://www.samsung.com/sec/watches/galaxy-watch/galaxy-watch7/))\n\n\"Upgrade Your Style\": The Galaxy Watch 7 adds a sophisticated touch to your wrist with its floating glass design and a variety of color options.\n\"Personalized Sleep Coaching\": Its sleep tracking feature analyzes your sleep patterns and provides personalized sleep coaching.\n\n\"Enhanced Workout Tracking\": Supports a wide range of workout modes and provides detailed data such as heart rate and calorie burn.\n\n\"Powerful Performance\": Equipped with the latest processor and long battery life, it offers stable performance for everything from daily use to high-intensity workouts.\n\nIn summary, the Galaxy Watch 7 is a premium smartwatch combining style, functionality, and durability, making it the perfect choice to enhance your health and lifestyle.", - "files": [], "thumbnails": [ { "name": "galaxy-watch-7-thumbnail", "extension": "png", "url": "https://images.samsung.com/kdp/goods/2024/07/07/597615f6-b6f9-4ae4-a93d-cbba6bdde2c6.png?$944_550_PNG$" } - ] + ], + "files": [] }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "electronics", - "smart_watches" - ] - } - ], "units": [ { "name": "Galaxy Watch 7", - "primary": true, "required": true, + "primary": true, "options": [ { "type": "select", @@ -174,8 +173,8 @@ }, { "name": "Warranty Program", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -191,8 +190,8 @@ }, { "name": "Replacement Strap", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -208,9 +207,9 @@ } ], "tags": [ - "Galaxy Watch", - "Samsung", - "Smartwatch", - "Wearable" + "smartwatch", + "galaxy watch", + "wearable", + "samsung" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.sale.input.stanley-tumbler-collection.json b/examples/function-calling/arguments/claude.stanley-tumbler-collection.input.json similarity index 98% rename from examples/function-calling/arguments/claude.sale.input.stanley-tumbler-collection.json rename to examples/function-calling/arguments/claude.stanley-tumbler-collection.input.json index 1819b30..caf1773 100644 --- a/examples/function-calling/arguments/claude.sale.input.stanley-tumbler-collection.json +++ b/examples/function-calling/arguments/claude.stanley-tumbler-collection.input.json @@ -3,6 +3,14 @@ "status": null, "opened_at": null, "closed_at": null, + "channels": [ + { + "code": "samchon", + "category_codes": [ + "accessories" + ] + } + ], "content": { "title": "Stanley Tumbler Collection", "format": "md", @@ -16,19 +24,18 @@ } ] }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "others" - ] - } + "tags": [ + "tumbler", + "stanley", + "drinkware", + "hydration", + "eco-friendly" ], "units": [ { "name": "Classic Tumbler", - "primary": true, "required": true, + "primary": true, "options": [ { "type": "select", @@ -122,8 +129,8 @@ }, { "name": "Adventure Quencher Tumbler", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -139,8 +146,8 @@ }, { "name": "Accessories Set", - "primary": false, "required": false, + "primary": false, "options": [], "stocks": [ { @@ -154,12 +161,5 @@ } ] } - ], - "tags": [ - "tumbler", - "stanley", - "drinkware", - "eco-friendly", - "stainless steel" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/claude.tags.input.json b/examples/function-calling/arguments/claude.tags.input.json new file mode 100644 index 0000000..b45f94c --- /dev/null +++ b/examples/function-calling/arguments/claude.tags.input.json @@ -0,0 +1,7 @@ +{ + "time": null, + "reasons": [ + "marketing sales" + ], + "temporary": false +} \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.apple-iphone.input.json b/examples/function-calling/arguments/gemini.apple-iphone.input.json new file mode 100644 index 0000000..1e071e9 --- /dev/null +++ b/examples/function-calling/arguments/gemini.apple-iphone.input.json @@ -0,0 +1,1068 @@ +{ + "opened_at": "2024-01-01T00:00:00Z", + "content": { + "title": "Apple MacBook Pro", + "thumbnails": [ + { + "extension": "jpeg", + "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617", + "name": "apple-iphone-thumbnail" + } + ], + "body": "MacBook Pro\\n\\n\\n**The Ultimate Tool for Professionals**\\n\\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\\n\\n- **Remarkable Performance**\\n \\n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\\n \\n- **Outstanding Display**\\n \\n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\\n \\n- **All-Day Battery Life**\\n \\n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\\n \\n- **Sleek Yet Powerful Design**\\n \\n A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\\n \\n- **Smart Connectivity**\\n \\n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\\n \\n\\nWith MacBook Pro, your potential knows no bounds. **It’s time to rediscover what you’re capable of.**\\n", + "files": [], + "format": "md" + }, + "section_code": "general", + "channels": [ + { + "category_codes": [ + "electronics", + "laptops", + "macbooks" + ], + "code": "samchon" + } + ], + "closed_at": "2024-12-31T23:59:59Z", + "units": [ + { + "name": "MacBook M3 Pro 14inch Entity", + "required": true, + "options": [ + { + "type": "select", + "name": "Color", + "variable": true, + "candidates": [ + { + "name": "Silver" + }, + { + "name": "Space Gray" + } + ] + }, + { + "candidates": [ + { + "name": "16GB" + }, + { + "name": "32GB" + }, + { + "name": "64GB" + } + ], + "type": "select", + "name": "RAM", + "variable": true + }, + { + "candidates": [ + { + "name": "512GB" + }, + { + "name": "1TB" + }, + { + "name": "2TB" + } + ], + "type": "select", + "variable": true, + "name": "SSD" + }, + { + "candidates": [ + { + "name": "English" + }, + { + "name": "Korean" + } + ], + "variable": true, + "name": "Keyboard Language", + "type": "select" + } + ], + "primary": true, + "stocks": [ + { + "quantity": 1000, + "name": "Silver/16GB/512GB/English", + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], + "price": { + "nominal": 2000000, + "real": 1800000 + } + }, + { + "quantity": 1000, + "name": "Silver/16GB/512GB/Korean", + "price": { + "real": 1800000, + "nominal": 2000000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ] + }, + { + "price": { + "real": 2070000, + "nominal": 2300000 + }, + "name": "Silver/16GB/1TB/English", + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ] + }, + { + "quantity": 1000, + "choices": [ + { + "candidate_index": 0, + "option_index": 0 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "candidate_index": 1, + "option_index": 2 + }, + { + "candidate_index": 1, + "option_index": 3 + } + ], + "name": "Silver/16GB/1TB/Korean", + "price": { + "real": 2070000, + "nominal": 2300000 + } + }, + { + "name": "Silver/16GB/2TB/English", + "price": { + "nominal": 2900000, + "real": 2610000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], + "quantity": 1000 + }, + { + "choices": [ + { + "candidate_index": 0, + "option_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "candidate_index": 1, + "option_index": 3 + } + ], + "quantity": 1000, + "price": { + "real": 2610000, + "nominal": 2900000 + }, + "name": "Silver/16GB/2TB/Korean" + }, + { + "price": { + "nominal": 2600000, + "real": 2340000 + }, + "name": "Silver/32GB/512GB/English", + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 1, + "option_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ] + }, + { + "price": { + "nominal": 2600000, + "real": 2340000 + }, + "quantity": 1000, + "name": "Silver/32GB/512GB/Korean", + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 1, + "option_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "candidate_index": 1, + "option_index": 3 + } + ] + }, + { + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 1, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "price": { + "real": 2610000, + "nominal": 2900000 + }, + "name": "Silver/32GB/1TB/English" + }, + { + "quantity": 1000, + "name": "Silver/32GB/1TB/Korean", + "price": { + "real": 2610000, + "nominal": 2900000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "candidate_index": 1, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ] + }, + { + "name": "Silver/32GB/2TB/English", + "quantity": 1000, + "price": { + "nominal": 3500000, + "real": 3150000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "candidate_index": 2, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ] + }, + { + "price": { + "real": 3150000, + "nominal": 3500000 + }, + "name": "Silver/32GB/2TB/Korean", + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "candidate_index": 2, + "option_index": 2 + }, + { + "candidate_index": 1, + "option_index": 3 + } + ] + }, + { + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "quantity": 1000, + "name": "Silver/64GB/512GB/English", + "price": { + "real": 2880000, + "nominal": 3200000 + } + }, + { + "quantity": 1000, + "price": { + "real": 2880000, + "nominal": 3200000 + }, + "name": "Silver/64GB/512GB/Korean", + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ] + }, + { + "quantity": 1000, + "price": { + "real": 3150000, + "nominal": 3500000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 2 + }, + { + "candidate_index": 1, + "option_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "name": "Silver/64GB/1TB/English" + }, + { + "choices": [ + { + "candidate_index": 0, + "option_index": 0 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "candidate_index": 1, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "price": { + "nominal": 3500000, + "real": 3150000 + }, + "quantity": 1000, + "name": "Silver/64GB/1TB/Korean" + }, + { + "name": "Silver/64GB/2TB/English", + "price": { + "real": 3690000, + "nominal": 4100000 + }, + "choices": [ + { + "candidate_index": 0, + "option_index": 0 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], + "quantity": 1000 + }, + { + "price": { + "nominal": 4100000, + "real": 3690000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "candidate_index": 2, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "name": "Silver/64GB/2TB/Korean" + }, + { + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "name": "Space Gray/16GB/512GB/English", + "quantity": 1000, + "price": { + "nominal": 2050000, + "real": 1845000 + } + }, + { + "choices": [ + { + "candidate_index": 1, + "option_index": 0 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "candidate_index": 1, + "option_index": 3 + } + ], + "name": "Space Gray/16GB/512GB/Korean", + "quantity": 1000, + "price": { + "real": 1845000, + "nominal": 2050000 + } + }, + { + "price": { + "nominal": 2350000, + "real": 2115000 + }, + "choices": [ + { + "candidate_index": 1, + "option_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "name": "Space Gray/16GB/1TB/English", + "quantity": 1000 + }, + { + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "quantity": 1000, + "name": "Space Gray/16GB/1TB/Korean", + "price": { + "nominal": 2350000, + "real": 2115000 + } + }, + { + "quantity": 1000, + "price": { + "real": 2655000, + "nominal": 2950000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], + "name": "Space Gray/16GB/2TB/English" + }, + { + "price": { + "real": 2655000, + "nominal": 2950000 + }, + "name": "Space Gray/16GB/2TB/Korean", + "quantity": 1000, + "choices": [ + { + "candidate_index": 1, + "option_index": 0 + }, + { + "candidate_index": 0, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ] + }, + { + "quantity": 1000, + "price": { + "real": 2385000, + "nominal": 2650000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], + "name": "Space Gray/32GB/512GB/English" + }, + { + "quantity": 1000, + "price": { + "real": 2385000, + "nominal": 2650000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "candidate_index": 0, + "option_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "name": "Space Gray/32GB/512GB/Korean" + }, + { + "name": "Space Gray/32GB/1TB/English", + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "candidate_index": 1, + "option_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "price": { + "real": 2655000, + "nominal": 2950000 + }, + "quantity": 1000 + }, + { + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "name": "Space Gray/32GB/1TB/Korean", + "price": { + "real": 2655000, + "nominal": 2950000 + } + }, + { + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "name": "Space Gray/32GB/2TB/English", + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ], + "quantity": 1000 + }, + { + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "name": "Space Gray/32GB/2TB/Korean" + }, + { + "price": { + "real": 2925000, + "nominal": 3250000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], + "name": "Space Gray/64GB/512GB/English" + }, + { + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 2 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ], + "price": { + "real": 2925000, + "nominal": 3250000 + }, + "quantity": 1000, + "name": "Space Gray/64GB/512GB/Korean" + }, + { + "name": "Space Gray/64GB/1TB/English", + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ] + }, + { + "name": "Space Gray/64GB/1TB/Korean", + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 2 + }, + { + "option_index": 2, + "candidate_index": 1 + }, + { + "candidate_index": 1, + "option_index": 3 + } + ], + "quantity": 1000 + }, + { + "name": "Space Gray/64GB/2TB/English", + "quantity": 1000, + "price": { + "nominal": 4150000, + "real": 3735000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "candidate_index": 2, + "option_index": 1 + }, + { + "candidate_index": 2, + "option_index": 2 + }, + { + "candidate_index": 0, + "option_index": 3 + } + ] + }, + { + "price": { + "real": 3735000, + "nominal": 4150000 + }, + "quantity": 1000, + "name": "Space Gray/64GB/2TB/Korean", + "choices": [ + { + "candidate_index": 1, + "option_index": 0 + }, + { + "option_index": 1, + "candidate_index": 2 + }, + { + "option_index": 2, + "candidate_index": 2 + }, + { + "option_index": 3, + "candidate_index": 1 + } + ] + } + ] + }, + { + "name": "Warranty Program", + "options": [], + "stocks": [ + { + "choices": [], + "name": "Warranty Program", + "quantity": 10000, + "price": { + "nominal": 100000, + "real": 89000 + } + } + ], + "primary": false, + "required": false + }, + { + "name": "Magnetic Keyboard", + "required": false, + "primary": false, + "options": [], + "stocks": [ + { + "quantity": 8000, + "name": "Magnetic Keyboard", + "choices": [], + "price": { + "nominal": 200000, + "real": 169000 + } + } + ] + } + ], + "tags": [] +} \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.apple-macbook-pro.json b/examples/function-calling/arguments/gemini.apple-macbook-pro.input.json similarity index 83% rename from examples/function-calling/arguments/gemini.sale.input.apple-macbook-pro.json rename to examples/function-calling/arguments/gemini.apple-macbook-pro.input.json index 55f56c3..2b01a7d 100644 --- a/examples/function-calling/arguments/gemini.sale.input.apple-macbook-pro.json +++ b/examples/function-calling/arguments/gemini.apple-macbook-pro.input.json @@ -1,25 +1,12 @@ { - "content": { - "title": "Apple MacBook Pro", - "thumbnails": [ - { - "extension": "png", - "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617", - "name": "apple-macbook-pro-thumbnail" - } - ], - "body": "MacBook Pro\\n\\n\\n**The Ultimate Tool for Professionals**\\n\\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\\n\\n- **Remarkable Performance**\\n \\n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\\n \\n- **Outstanding Display**\\n \\n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\\n \\n- **All-Day Battery Life**\\n \\n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\\n \\n- **Sleek Yet Powerful Design**\\n \\n A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\\n \\n- **Smart Connectivity**\\n \\n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\\n \\n\\nWith MacBook Pro, your potential knows no bounds. **It’s time to rediscover what you’re capable of.**\\n", - "format": "md", - "files": [] - }, "section_code": "general", - "opened_at": "2024-07-27T12:34:56.789Z", + "closed_at": "2024-12-31T23:59:59Z", "units": [ { - "name": "MacBook M3 Pro 14inch Entity", - "required": true, "options": [ { + "name": "Color", + "type": "select", "variable": true, "candidates": [ { @@ -28,14 +15,10 @@ { "name": "Space Gray" } - ], - "type": "select", - "name": "Color" + ] }, { - "type": "select", "name": "RAM", - "variable": true, "candidates": [ { "name": "16GB" @@ -46,12 +29,13 @@ { "name": "64GB" } - ] + ], + "variable": true, + "type": "select" }, { - "name": "SSD", - "variable": true, "type": "select", + "name": "SSD", "candidates": [ { "name": "512GB" @@ -62,9 +46,11 @@ { "name": "2TB" } - ] + ], + "variable": true }, { + "name": "Keyboard Language", "candidates": [ { "name": "English" @@ -73,150 +59,174 @@ "name": "Korean" } ], - "name": "Keyboard Language", "variable": true, "type": "select" } ], - "primary": true, "stocks": [ { + "name": "Silver / 16GB / 512GB / English", + "choices": [ + { + "candidate_index": 0, + "option_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 0 + }, + { + "option_index": 3, + "candidate_index": 0 + } + ], "quantity": 10000, - "name": "Silver/16GB/512GB/English", "price": { "real": 1800000, "nominal": 2000000 - }, + } + }, + { "choices": [ { "option_index": 0, "candidate_index": 0 }, { - "candidate_index": 0, - "option_index": 1 + "option_index": 1, + "candidate_index": 0 }, { - "candidate_index": 0, - "option_index": 2 + "option_index": 2, + "candidate_index": 0 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } - ] - }, - { + ], + "name": "Silver / 16GB / 512GB / Korean", "price": { "real": 1800000, "nominal": 2000000 }, + "quantity": 10000 + }, + { + "name": "Silver / 16GB / 1TB / English", "choices": [ { - "candidate_index": 0, - "option_index": 0 + "option_index": 0, + "candidate_index": 0 }, { "option_index": 1, "candidate_index": 0 }, { - "candidate_index": 0, + "candidate_index": 1, "option_index": 2 }, { - "candidate_index": 1, + "candidate_index": 0, "option_index": 3 } ], - "name": "Silver/16GB/512GB/Korean", + "price": { + "nominal": 2300000, + "real": 2070000 + }, "quantity": 10000 }, { - "name": "Silver/16GB/1TB/English", - "quantity": 10000, + "price": { + "nominal": 2300000, + "real": 2070000 + }, + "name": "Silver / 16GB / 1TB / Korean", "choices": [ { "candidate_index": 0, "option_index": 0 }, { - "candidate_index": 0, - "option_index": 1 + "option_index": 1, + "candidate_index": 0 }, { "candidate_index": 1, "option_index": 2 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } ], - "price": { - "real": 2070000, - "nominal": 2300000 - } + "quantity": 10000 }, { - "name": "Silver/16GB/1TB/Korean", + "name": "Silver / 16GB / 2TB / English", + "quantity": 10000, + "price": { + "nominal": 2900000, + "real": 2610000 + }, "choices": [ { "option_index": 0, "candidate_index": 0 }, { - "option_index": 1, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 1 }, { - "candidate_index": 1, + "candidate_index": 2, "option_index": 2 }, { - "option_index": 3, - "candidate_index": 1 + "candidate_index": 0, + "option_index": 3 } - ], - "quantity": 10000, - "price": { - "real": 2070000, - "nominal": 2300000 - } + ] }, { "price": { - "nominal": 2900000, - "real": 2610000 + "real": 2610000, + "nominal": 2900000 }, "quantity": 10000, - "name": "Silver/16GB/2TB/English", "choices": [ { "candidate_index": 0, "option_index": 0 }, { - "option_index": 1, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 1 }, { "candidate_index": 2, "option_index": 2 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } - ] + ], + "name": "Silver / 16GB / 2TB / Korean" }, { - "quantity": 10000, - "name": "Silver/16GB/2TB/Korean", "price": { - "nominal": 2900000, - "real": 2610000 + "nominal": 2600000, + "real": 2340000 }, + "name": "Silver / 32GB / 512GB / English", + "quantity": 10000, "choices": [ { "option_index": 0, @@ -224,23 +234,24 @@ }, { "option_index": 1, - "candidate_index": 0 + "candidate_index": 1 }, { - "candidate_index": 2, + "candidate_index": 0, "option_index": 2 }, { - "candidate_index": 1, - "option_index": 3 + "option_index": 3, + "candidate_index": 0 } ] }, { "price": { - "real": 2340000, - "nominal": 2600000 + "nominal": 2600000, + "real": 2340000 }, + "name": "Silver / 32GB / 512GB / Korean", "quantity": 10000, "choices": [ { @@ -248,48 +259,46 @@ "option_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 1 }, { - "option_index": 2, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 2 }, { - "option_index": 3, - "candidate_index": 0 + "candidate_index": 1, + "option_index": 3 } - ], - "name": "Silver/32GB/512GB/English" + ] }, { + "quantity": 10000, + "name": "Silver / 32GB / 1TB / English", + "price": { + "real": 2610000, + "nominal": 2900000 + }, "choices": [ { "candidate_index": 0, "option_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 1 }, { "option_index": 2, - "candidate_index": 0 + "candidate_index": 1 }, { - "option_index": 3, - "candidate_index": 1 + "candidate_index": 0, + "option_index": 3 } - ], - "price": { - "real": 2340000, - "nominal": 2600000 - }, - "name": "Silver/32GB/512GB/Korean", - "quantity": 10000 + ] }, { - "name": "Silver/32GB/1TB/English", "choices": [ { "candidate_index": 0, @@ -304,22 +313,22 @@ "option_index": 2 }, { - "candidate_index": 0, + "candidate_index": 1, "option_index": 3 } ], - "quantity": 10000, "price": { "real": 2610000, "nominal": 2900000 - } + }, + "name": "Silver / 32GB / 1TB / Korean", + "quantity": 10000 }, { "price": { - "nominal": 2900000, - "real": 2610000 + "real": 3150000, + "nominal": 3500000 }, - "name": "Silver/32GB/1TB/Korean", "choices": [ { "candidate_index": 0, @@ -330,23 +339,24 @@ "option_index": 1 }, { - "candidate_index": 1, + "candidate_index": 2, "option_index": 2 }, { "option_index": 3, - "candidate_index": 1 + "candidate_index": 0 } ], - "quantity": 10000 + "quantity": 10000, + "name": "Silver / 32GB / 2TB / English" }, { - "quantity": 10000, - "name": "Silver/32GB/2TB/English", + "name": "Silver / 32GB / 2TB / Korean", "price": { "real": 3150000, "nominal": 3500000 }, + "quantity": 10000, "choices": [ { "option_index": 0, @@ -361,17 +371,18 @@ "option_index": 2 }, { - "candidate_index": 0, + "candidate_index": 1, "option_index": 3 } ] }, { + "quantity": 10000, + "name": "Silver / 64GB / 512GB / English", "price": { - "nominal": 3500000, - "real": 3150000 + "nominal": 3200000, + "real": 2880000 }, - "name": "Silver/32GB/2TB/Korean", "choices": [ { "candidate_index": 0, @@ -379,34 +390,7 @@ }, { "option_index": 1, - "candidate_index": 1 - }, - { - "candidate_index": 2, - "option_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ], - "quantity": 10000 - }, - { - "price": { - "nominal": 3200000, - "real": 2880000 - }, - "quantity": 10000, - "name": "Silver/64GB/512GB/English", - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "candidate_index": 2, - "option_index": 1 + "candidate_index": 2 }, { "candidate_index": 0, @@ -437,18 +421,23 @@ "option_index": 3 } ], + "quantity": 10000, "price": { - "nominal": 3200000, - "real": 2880000 + "real": 2880000, + "nominal": 3200000 }, - "name": "Silver/64GB/512GB/Korean", - "quantity": 10000 + "name": "Silver / 64GB / 512GB / Korean" }, { + "quantity": 10000, + "price": { + "real": 3150000, + "nominal": 3500000 + }, "choices": [ { - "candidate_index": 0, - "option_index": 0 + "option_index": 0, + "candidate_index": 0 }, { "candidate_index": 2, @@ -459,42 +448,37 @@ "candidate_index": 1 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 0 } ], - "quantity": 10000, - "name": "Silver/64GB/1TB/English", - "price": { - "real": 3150000, - "nominal": 3500000 - } + "name": "Silver / 64GB / 1TB / English" }, { - "name": "Silver/64GB/1TB/Korean", "price": { - "nominal": 3500000, - "real": 3150000 + "real": 3150000, + "nominal": 3500000 }, "quantity": 10000, "choices": [ { - "option_index": 0, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 0 }, { - "option_index": 1, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 1 }, { - "candidate_index": 1, - "option_index": 2 + "option_index": 2, + "candidate_index": 1 }, { - "candidate_index": 1, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } - ] + ], + "name": "Silver / 64GB / 1TB / Korean" }, { "choices": [ @@ -515,118 +499,124 @@ "candidate_index": 0 } ], - "name": "Silver/64GB/2TB/English", "price": { - "nominal": 4100000, - "real": 3690000 + "real": 3690000, + "nominal": 4100000 }, + "name": "Silver / 64GB / 2TB / English", "quantity": 10000 }, { - "quantity": 10000, - "price": { - "nominal": 4100000, - "real": 3690000 - }, - "name": "Silver/64GB/2TB/Korean", "choices": [ { - "candidate_index": 0, - "option_index": 0 + "option_index": 0, + "candidate_index": 0 }, { - "candidate_index": 2, - "option_index": 1 + "option_index": 1, + "candidate_index": 2 }, { - "option_index": 2, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 2 }, { "candidate_index": 1, "option_index": 3 } - ] + ], + "quantity": 10000, + "price": { + "nominal": 4100000, + "real": 3690000 + }, + "name": "Silver / 64GB / 2TB / Korean" }, { + "price": { + "nominal": 2050000, + "real": 1845000 + }, "quantity": 10000, + "name": "Space Gray / 16GB / 512GB / English", "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, "candidate_index": 0 }, { - "option_index": 2, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 2 }, { - "option_index": 3, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 3 } - ], - "name": "Space Gray/16GB/512GB/English", - "price": { - "nominal": 2050000, - "real": 1845000 - } + ] }, { "price": { "real": 1845000, "nominal": 2050000 }, + "quantity": 10000, "choices": [ { "option_index": 0, "candidate_index": 1 }, { - "candidate_index": 0, - "option_index": 1 + "option_index": 1, + "candidate_index": 0 }, { - "candidate_index": 0, - "option_index": 2 + "option_index": 2, + "candidate_index": 0 }, { - "option_index": 3, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 3 } ], - "quantity": 10000, - "name": "Space Gray/16GB/512GB/Korean" + "name": "Space Gray / 16GB / 512GB / Korean" }, { - "price": { - "real": 2115000, - "nominal": 2350000 - }, - "quantity": 10000, + "name": "Space Gray / 16GB / 1TB / English", "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "candidate_index": 0, "option_index": 1 }, { - "option_index": 2, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 2 }, { "candidate_index": 0, "option_index": 3 } ], - "name": "Space Gray/16GB/1TB/English" + "quantity": 10000, + "price": { + "real": 2115000, + "nominal": 2350000 + } }, { + "quantity": 10000, + "price": { + "nominal": 2350000, + "real": 2115000 + }, + "name": "Space Gray / 16GB / 1TB / Korean", "choices": [ { "candidate_index": 1, @@ -637,23 +627,18 @@ "option_index": 1 }, { - "option_index": 2, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 2 }, { "option_index": 3, "candidate_index": 1 } - ], - "price": { - "nominal": 2350000, - "real": 2115000 - }, - "quantity": 10000, - "name": "Space Gray/16GB/1TB/Korean" + ] }, { "quantity": 10000, + "name": "Space Gray / 16GB / 2TB / English", "choices": [ { "candidate_index": 1, @@ -664,101 +649,98 @@ "candidate_index": 0 }, { - "option_index": 2, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 2 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 0 } ], "price": { - "nominal": 2950000, - "real": 2655000 - }, - "name": "Space Gray/16GB/2TB/English" + "real": 2655000, + "nominal": 2950000 + } }, { - "quantity": 10000, - "price": { - "nominal": 2950000, - "real": 2655000 - }, - "name": "Space Gray/16GB/2TB/Korean", "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { - "candidate_index": 0, - "option_index": 1 + "option_index": 1, + "candidate_index": 0 }, { "option_index": 2, "candidate_index": 2 }, { - "candidate_index": 1, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } - ] + ], + "name": "Space Gray / 16GB / 2TB / Korean", + "price": { + "real": 2655000, + "nominal": 2950000 + }, + "quantity": 10000 }, { + "quantity": 10000, + "name": "Space Gray / 32GB / 512GB / English", "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 1 }, { "candidate_index": 0, "option_index": 2 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 0 } ], - "name": "Space Gray/32GB/512GB/English", - "quantity": 10000, "price": { - "nominal": 2650000, - "real": 2385000 + "real": 2385000, + "nominal": 2650000 } }, { - "price": { - "nominal": 2650000, - "real": 2385000 - }, - "name": "Space Gray/32GB/512GB/Korean", "choices": [ { - "candidate_index": 1, - "option_index": 0 + "option_index": 0, + "candidate_index": 1 }, { - "option_index": 1, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 1 }, { "option_index": 2, "candidate_index": 0 }, { - "candidate_index": 1, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } ], + "name": "Space Gray / 32GB / 512GB / Korean", + "price": { + "real": 2385000, + "nominal": 2650000 + }, "quantity": 10000 }, { - "name": "Space Gray/32GB/1TB/English", - "quantity": 10000, "choices": [ { "candidate_index": 1, @@ -769,100 +751,102 @@ "candidate_index": 1 }, { - "option_index": 2, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 2 }, { "option_index": 3, "candidate_index": 0 } ], + "quantity": 10000, + "name": "Space Gray / 32GB / 1TB / English", "price": { - "real": 2655000, - "nominal": 2950000 + "nominal": 2950000, + "real": 2655000 } }, { + "name": "Space Gray / 32GB / 1TB / Korean", + "quantity": 10000, + "price": { + "nominal": 2950000, + "real": 2655000 + }, "choices": [ - { - "option_index": 0, - "candidate_index": 1 - }, { "candidate_index": 1, - "option_index": 1 + "option_index": 0 }, { - "option_index": 2, + "option_index": 1, "candidate_index": 1 }, + { + "candidate_index": 1, + "option_index": 2 + }, { "candidate_index": 1, "option_index": 3 } - ], - "quantity": 10000, - "name": "Space Gray/32GB/1TB/Korean", - "price": { - "real": 2655000, - "nominal": 2950000 - } + ] }, { - "price": { - "real": 3195000, - "nominal": 3550000 - }, - "quantity": 10000, "choices": [ { "candidate_index": 1, "option_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 1 }, { - "candidate_index": 2, - "option_index": 2 + "option_index": 2, + "candidate_index": 2 }, { - "option_index": 3, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 3 } ], - "name": "Space Gray/32GB/2TB/English" - }, - { - "name": "Space Gray/32GB/2TB/Korean", "quantity": 10000, "price": { "real": 3195000, "nominal": 3550000 }, + "name": "Space Gray / 32GB / 2TB / English" + }, + { + "name": "Space Gray / 32GB / 2TB / Korean", + "quantity": 10000, "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, "candidate_index": 1 }, { - "candidate_index": 2, - "option_index": 2 + "option_index": 2, + "candidate_index": 2 }, { - "option_index": 3, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 3 } - ] + ], + "price": { + "nominal": 3550000, + "real": 3195000 + } }, { "quantity": 10000, - "name": "Space Gray/64GB/512GB/English", + "name": "Space Gray / 64GB / 512GB / English", "choices": [ { "candidate_index": 1, @@ -877,20 +861,24 @@ "candidate_index": 0 }, { - "candidate_index": 0, - "option_index": 3 + "option_index": 3, + "candidate_index": 0 } ], "price": { - "real": 2925000, - "nominal": 3250000 + "nominal": 3250000, + "real": 2925000 } }, { + "price": { + "real": 2925000, + "nominal": 3250000 + }, "choices": [ { - "candidate_index": 1, - "option_index": 0 + "option_index": 0, + "candidate_index": 1 }, { "candidate_index": 2, @@ -901,22 +889,18 @@ "option_index": 2 }, { - "candidate_index": 1, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } ], - "quantity": 10000, - "name": "Space Gray/64GB/512GB/Korean", - "price": { - "real": 2925000, - "nominal": 3250000 - } + "name": "Space Gray / 64GB / 512GB / Korean", + "quantity": 10000 }, { "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, @@ -927,26 +911,22 @@ "option_index": 2 }, { - "option_index": 3, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 3 } ], + "name": "Space Gray / 64GB / 1TB / English", "quantity": 10000, "price": { "nominal": 3550000, "real": 3195000 - }, - "name": "Space Gray/64GB/1TB/English" + } }, { - "price": { - "nominal": 3550000, - "real": 3195000 - }, "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, @@ -957,20 +937,22 @@ "option_index": 2 }, { - "candidate_index": 1, - "option_index": 3 + "option_index": 3, + "candidate_index": 1 } ], "quantity": 10000, - "name": "Space Gray/64GB/1TB/Korean" + "name": "Space Gray / 64GB / 1TB / Korean", + "price": { + "nominal": 3550000, + "real": 3195000 + } }, { - "quantity": 10000, "price": { "real": 3735000, "nominal": 4150000 }, - "name": "Space Gray/64GB/2TB/English", "choices": [ { "candidate_index": 1, @@ -981,79 +963,83 @@ "candidate_index": 2 }, { - "option_index": 2, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 2 }, { - "option_index": 3, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 3 } - ] + ], + "quantity": 10000, + "name": "Space Gray / 64GB / 2TB / English" }, { + "quantity": 10000, "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { - "candidate_index": 2, - "option_index": 1 + "option_index": 1, + "candidate_index": 2 }, { "candidate_index": 2, "option_index": 2 }, { - "option_index": 3, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 3 } ], - "name": "Space Gray/64GB/2TB/Korean", + "name": "Space Gray / 64GB / 2TB / Korean", "price": { "nominal": 4150000, "real": 3735000 - }, - "quantity": 10000 + } } - ] + ], + "primary": true, + "required": true, + "name": "MacBook M3 Pro 14inch Entity" }, { - "primary": false, - "required": false, - "name": "Warranty Program", "stocks": [ { - "name": "Warranty Program", - "quantity": 10000, "price": { "real": 89000, "nominal": 100000 }, + "quantity": 10000, + "name": "Warranty Program", "choices": [] } ], + "primary": false, + "name": "Warranty Program", + "required": false, "options": [] }, { + "required": false, + "name": "Magnetic Keyboard", "primary": false, "options": [], "stocks": [ { "choices": [], - "price": { - "nominal": 200000, - "real": 169000 - }, + "name": "Magnetic Keyboard", "quantity": 8000, - "name": "Magnetic Keyboard" + "price": { + "real": 169000, + "nominal": 200000 + } } - ], - "name": "Magnetic Keyboard", - "required": false + ] } ], - "closed_at": "2024-07-30T12:34:56.789Z", "channels": [ { "code": "samchon", @@ -1064,5 +1050,19 @@ ] } ], - "tags": [] + "tags": [], + "opened_at": "2024-01-01T00:00:00Z", + "content": { + "body": "MacBook Pro\\n\\n\\n**The Ultimate Tool for Professionals**\\n\\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\\n\\n- **Remarkable Performance**\\n \\n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\\n \\n- **Outstanding Display**\\n \\n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\\n \\n- **All-Day Battery Life**\\n \\n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\\n \\n- **Sleek Yet Powerful Design**\\n \\n A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\\n \\n- **Smart Connectivity**\\n \\n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\\n \\n\\nWith MacBook Pro, your potential knows no bounds.\\n**It’s time to rediscover what you’re capable of.**", + "thumbnails": [ + { + "extension": "png", + "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617", + "name": "apple-macbook-pro-thumbnail" + } + ], + "title": "Apple MacBook Pro", + "files": [], + "format": "md" + } } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.apple-vision-pro.input.json b/examples/function-calling/arguments/gemini.apple-vision-pro.input.json new file mode 100644 index 0000000..00d4dc5 --- /dev/null +++ b/examples/function-calling/arguments/gemini.apple-vision-pro.input.json @@ -0,0 +1,103 @@ +{ + "units": [ + { + "required": true, + "primary": true, + "name": "Apple Vision Air", + "stocks": [ + { + "name": "AVA-2023-001", + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + } + ], + "price": { + "nominal": 2990000, + "real": 2990000 + }, + "quantity": 100 + }, + { + "quantity": 100, + "price": { + "nominal": 3490000, + "real": 3490000 + }, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + } + ], + "name": "AVA-2023-002" + }, + { + "name": "AVA-2023-003", + "choices": [ + { + "candidate_index": 2, + "option_index": 0 + } + ], + "quantity": 100, + "price": { + "nominal": 3990000, + "real": 3990000 + } + } + ], + "options": [ + { + "variable": true, + "type": "select", + "candidates": [ + { + "name": "256GB" + }, + { + "name": "512GB" + }, + { + "name": "1TB" + } + ], + "name": "Storage" + } + ] + } + ], + "channels": [ + { + "code": "samchon", + "category_codes": [ + "smart_glasses" + ] + } + ], + "opened_at": "2023-07-20T12:34:56.789Z", + "content": { + "body": "The Apple Vision Air features a lightweight and comfortable design, making it perfect for extended use. Equipped with high-resolution displays and cutting-edge optics, it offers stunning visuals that immerse users in their augmented reality experiences. The device is powered by the latest Apple silicon, ensuring smooth performance and efficient battery life.\\n\\nThe Apple Vision Air is more than just a device; it’s a gateway to a new reality. Whether for work, play, or exploration, it represents the future of immersive technology.", + "thumbnails": [ + { + "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s", + "name": "apple-vision-pro-thumbnail", + "extension": "png" + } + ], + "format": "html", + "title": "Apple Vision Air", + "files": [] + }, + "tags": [ + "apple", + "vision", + "air", + "ar", + "augmented reality", + "smart glasses" + ], + "closed_at": "2024-07-19T12:34:56.789Z", + "section_code": "general" +} \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json b/examples/function-calling/arguments/gemini.drawfit-women-soft-cashmere-oversized-half-coat.input.json similarity index 82% rename from examples/function-calling/arguments/gemini.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json rename to examples/function-calling/arguments/gemini.drawfit-women-soft-cashmere-oversized-half-coat.input.json index cd6211d..455b5ea 100644 --- a/examples/function-calling/arguments/gemini.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json +++ b/examples/function-calling/arguments/gemini.drawfit-women-soft-cashmere-oversized-half-coat.input.json @@ -1,83 +1,83 @@ { - "closed_at": "2024-12-31T23:59:59Z", - "units": [ + "channels": [ { - "options": [ - { - "variable": true, - "candidates": [ - { - "name": "XS" - }, - { - "name": "S" - }, - { - "name": "M" - } - ], - "name": "size", - "type": "select" - }, - { - "candidates": [ - { - "name": "GREY" - }, - { - "name": "NAVY" - }, - { - "name": "BUTTER" - } - ], - "name": "color", - "variable": true, - "type": "select" - } + "category_codes": [ + "clothes" ], - "required": true, - "primary": true, + "code": "samchon" + } + ], + "tags": [], + "section_code": "general", + "content": { + "title": "Drawfit Women Soft Cashmere Oversized Half Coat", + "body": "The Drawfit Women Soft Cashmere Oversized Half Coat is an essential winter item, crafted from a soft cashmere blend that provides warmth and comfort. Its stylish oversized design makes it perfect for pairing with various outfits.\\n\\n- \\\"Comfortable Fit\\\": Made from soft materials, it can be worn comfortably without irritating the skin.\\n- \\\"Stylish Oversized Design\\\": The relaxed fit allows for easy layering, suitable for both casual daily looks and formal occasions.\\n- Luxurious Design\\\": With classic colors and minimal details, it easily matches with any outfit.\\n- \\\"Warmth and Elegance\\\": A perfect choice to stay warm in winter while maintaining a stylish appearance.\\n\\nIn summary, the Drawfit Women Soft Cashmere Oversized Half Coat is a must-have winter item that combines style and functionality. With its luxurious design and excellent comfort, it’s the perfect choice for any occasion.", + "format": "md", + "thumbnails": [ + { + "extension": "jpg", + "url": "https://image.msscdn.net/thumbnails/images/goods_img/20240927/4472993/4472993_17274236009691_big.jpg?w=1200", + "name": "drawfit-women-soft-cashmere-oversized-half-coat-thumbnail-1" + }, + { + "extension": "jpg", + "name": "drawfit-women-soft-cashmere-oversized-half-coat-thumbnail-2", + "url": "https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552514/3552514_17276848381488_big.jpg?w=1200" + }, + { + "extension": "jpg", + "name": "drawfit-women-soft-cashmere-oversized-half-coat-thumbnail-3", + "url": "https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552513/3552513_17276848899638_big.jpg?w=1200" + } + ], + "files": [] + }, + "opened_at": "2024-10-27T00:00:00", + "units": [ + { "stocks": [ { "quantity": 300, + "price": { + "nominal": 220000, + "real": 198000 + }, + "name": "(XS, GREY)", "choices": [ { - "candidate_index": 0, - "option_index": 0 + "option_index": 0, + "candidate_index": 0 }, { "option_index": 1, "candidate_index": 0 } - ], - "name": "(XS, GREY)", - "price": { - "nominal": 220000, - "real": 198000 - } + ] }, { - "quantity": 300, "price": { - "real": 198000, - "nominal": 220000 + "nominal": 220000, + "real": 198000 }, - "name": "(XS, NAVY)", "choices": [ { - "candidate_index": 0, - "option_index": 0 + "option_index": 0, + "candidate_index": 0 }, { "option_index": 1, "candidate_index": 1 } - ] + ], + "name": "(XS, NAVY)", + "quantity": 300 }, { "name": "(XS, BUTTER)", - "quantity": 300, + "price": { + "nominal": 220000, + "real": 198000 + }, "choices": [ { "candidate_index": 0, @@ -88,17 +88,15 @@ "option_index": 1 } ], - "price": { - "nominal": 220000, - "real": 198000 - } + "quantity": 300 }, { - "name": "(S, GREY)", "price": { "nominal": 240000, "real": 198000 }, + "name": "(S, GREY)", + "quantity": 300, "choices": [ { "option_index": 0, @@ -108,69 +106,68 @@ "candidate_index": 0, "option_index": 1 } - ], - "quantity": 300 + ] }, { - "price": { - "real": 198000, - "nominal": 240000 - }, "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "candidate_index": 1, "option_index": 1 } ], - "name": "(S, NAVY)", - "quantity": 300 + "price": { + "nominal": 240000, + "real": 198000 + }, + "quantity": 300, + "name": "(S, NAVY)" }, { + "quantity": 300, + "price": { + "real": 198000, + "nominal": 240000 + }, + "name": "(S, BUTTER)", "choices": [ { "option_index": 0, "candidate_index": 1 }, { - "option_index": 1, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 1 } - ], - "quantity": 300, - "name": "(S, BUTTER)", - "price": { - "nominal": 240000, - "real": 198000 - } + ] }, { "quantity": 300, "name": "(M, GREY)", "price": { - "nominal": 260000, - "real": 198000 + "real": 198000, + "nominal": 260000 }, "choices": [ { - "candidate_index": 2, - "option_index": 0 + "option_index": 0, + "candidate_index": 2 }, { - "candidate_index": 0, - "option_index": 1 + "option_index": 1, + "candidate_index": 0 } ] }, { - "name": "(M, NAVY)", "price": { - "real": 198000, - "nominal": 260000 + "nominal": 260000, + "real": 198000 }, + "name": "(M, NAVY)", "quantity": 300, "choices": [ { @@ -186,57 +183,60 @@ { "choices": [ { - "option_index": 0, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 0 }, { - "option_index": 1, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 1 } ], - "name": "(M, BUTTER)", - "quantity": 300, "price": { "nominal": 260000, "real": 198000 - } + }, + "quantity": 300, + "name": "(M, BUTTER)" } ], - "name": "coat" - } - ], - "content": { - "title": "Drawfit Women Soft Cashmere Oversized Half Coat", - "files": [], - "thumbnails": [ - { - "name": "drawfit-women-soft-cashmere-oversized-half-coat-thumbnail-1", - "url": "https://image.msscdn.net/thumbnails/images/goods_img/20240927/4472993/4472993_17274236009691_big.jpg?w=1200", - "extension": "jpg" - }, - { - "url": "https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552514/3552514_17276848381488_big.jpg?w=1200", - "extension": "jpg", - "name": "drawfit-women-soft-cashmere-oversized-half-coat-thumbnail-2" - }, - { - "name": "drawfit-women-soft-cashmere-oversized-half-coat-thumbnail-3", - "url": "https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552513/3552513_17276848899638_big.jpg?w=1200", - "extension": "jpg" - } - ], - "body": "The Drawfit Women Soft Cashmere Oversized Half Coat is an essential winter item, crafted from a soft cashmere blend that provides warmth and comfort. Its stylish oversized design makes it perfect for pairing with various outfits.\\n\\n- \\\"Comfortable Fit\\\": Made from soft materials, it can be worn comfortably without irritating the skin.\\n- \\\"Stylish Oversized Design\\\": The relaxed fit allows for easy layering, suitable for both casual daily looks and formal occasions.\\n- Luxurious Design\\\": With classic colors and minimal details, it easily matches with any outfit.\\n- \\\"Warmth and Elegance\\\": A perfect choice to stay warm in winter while maintaining a stylish appearance.\\n\\nIn summary, the Drawfit Women Soft Cashmere Oversized Half Coat is a must-have winter item that combines style and functionality. With its luxurious design and excellent comfort, it’s the perfect choice for any occasion.", - "format": "md" - }, - "opened_at": "2024-10-26T00:00:00Z", - "channels": [ - { - "code": "samchon", - "category_codes": [ - "clothes" - ] + "options": [ + { + "candidates": [ + { + "name": "XS" + }, + { + "name": "S" + }, + { + "name": "M" + } + ], + "name": "Size", + "type": "select", + "variable": true + }, + { + "candidates": [ + { + "name": "GREY" + }, + { + "name": "NAVY" + }, + { + "name": "BUTTER" + } + ], + "name": "Color", + "type": "select", + "variable": true + } + ], + "required": true, + "name": "Drawfit Women Soft Cashmere Oversized Half Coat", + "primary": true } ], - "tags": [], - "section_code": "general" + "closed_at": "2024-12-31T23:59:59" } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.herman-miller-chair.json b/examples/function-calling/arguments/gemini.herman-miller-chair.input.json similarity index 81% rename from examples/function-calling/arguments/gemini.sale.input.herman-miller-chair.json rename to examples/function-calling/arguments/gemini.herman-miller-chair.input.json index d6bf6d4..a5a472a 100644 --- a/examples/function-calling/arguments/gemini.sale.input.herman-miller-chair.json +++ b/examples/function-calling/arguments/gemini.herman-miller-chair.input.json @@ -1,168 +1,184 @@ { - "closed_at": "2024-07-19T12:34:56.789Z", - "tags": [ - "Herman Miller", - "Chair", - "Ergonomic", - "Office", - "Home", - "Furniture" - ], + "closed_at": "2024-07-30T12:00:00.000Z", "section_code": "general", + "tags": [], + "channels": [ + { + "category_codes": [ + "furnitures" + ], + "code": "samchon" + } + ], + "content": { + "body": "The Herman Miller chair is an iconic ergonomic seating solution designed to provide unparalleled comfort and support. With its innovative design and high-quality materials, it is perfect for both home and office use.\\n\\n\\\"Elevate Your Workspace\\\": The Herman Miller chair enhances your productivity with its ergonomic features, ensuring you stay comfortable during long hours of work.\\n\\\"Timeless Design\\\": Combining aesthetics with functionality, this chair fits seamlessly into any environment, adding a touch of elegance to your space.\\n\\\"Adjustable Comfort\\\": With customizable settings, the Herman Miller chair adapts to your body, promoting better posture and reducing fatigue.\\n\\\"Built to Last\\\": Made from durable materials, this chair is designed for longevity, making it a worthwhile investment for anyone seeking quality seating.\\nIn summary, the Herman Miller chair stands out as a premium choice for users who value comfort, style, and durability. Whether for work or leisure, this chair is ready to enhance your experience and support your well-being.", + "files": [], + "thumbnails": [ + { + "name": "herman-miller-chair-thumbnail", + "extension": "png", + "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRaJWHEnwGGg-8rHni_2hN8HKUSkEBdU3X4w&s" + } + ], + "format": "md", + "title": "Herman Miller Chair" + }, + "opened_at": "2024-07-20T12:00:00.000Z", "units": [ { "required": true, - "options": [ + "name": "Herman Miller Chair", + "stocks": [ { - "type": "select", - "variable": true, - "candidates": [ + "price": { + "real": 1099000, + "nominal": 1200000 + }, + "name": "Aeron Black", + "choices": [ { - "name": "Aeron" + "option_index": 0, + "candidate_index": 0 }, { - "name": "Embody" + "option_index": 1, + "candidate_index": 0 } ], - "name": "Model" + "quantity": 1000 }, { - "name": "Color", - "variable": true, - "candidates": [ - { - "name": "Black" - }, - { - "name": "Gray" - }, - { - "name": "White" - } - ], - "type": "select" - } - ], - "primary": true, - "stocks": [ - { - "quantity": 1000, "price": { "real": 1099000, "nominal": 1200000 }, + "quantity": 1000, "choices": [ { "candidate_index": 0, "option_index": 0 }, { - "candidate_index": 0, + "candidate_index": 1, "option_index": 1 } ], - "name": "Aeron Black" + "name": "Aeron Gray" }, { + "choices": [ + { + "candidate_index": 0, + "option_index": 0 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ], "quantity": 1000, "price": { "nominal": 1200000, "real": 1099000 }, + "name": "Aeron White" + }, + { + "name": "Embody Black", "choices": [ { - "option_index": 0, - "candidate_index": 0 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, - "candidate_index": 1 + "candidate_index": 0 } ], - "name": "Aeron Gray" + "price": { + "real": 1599000, + "nominal": 1800000 + }, + "quantity": 1000 }, { - "name": "Aeron White", "price": { - "real": 1099000, - "nominal": 1200000 + "real": 1599000, + "nominal": 1800000 }, "choices": [ { - "option_index": 0, - "candidate_index": 0 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, - "candidate_index": 2 + "candidate_index": 1 } ], + "name": "Embody Gray", "quantity": 1000 }, { + "quantity": 1000, "choices": [ { - "candidate_index": 1, - "option_index": 0 + "option_index": 0, + "candidate_index": 1 }, { - "candidate_index": 0, - "option_index": 1 + "option_index": 1, + "candidate_index": 2 } ], - "quantity": 1000, - "name": "Embody Black", + "name": "Embody White", "price": { "real": 1599000, "nominal": 1800000 } - }, + } + ], + "primary": true, + "options": [ { - "price": { - "nominal": 1800000, - "real": 1599000 - }, - "quantity": 1000, - "choices": [ + "variable": true, + "name": "Model", + "candidates": [ { - "option_index": 0, - "candidate_index": 1 + "name": "Aeron" }, { - "candidate_index": 1, - "option_index": 1 + "name": "Embody" } ], - "name": "Embody Gray" + "type": "select" }, { - "price": { - "real": 1599000, - "nominal": 1800000 - }, - "quantity": 1000, - "name": "Embody White", - "choices": [ + "type": "select", + "candidates": [ { - "option_index": 0, - "candidate_index": 1 + "name": "Black" }, { - "candidate_index": 2, - "option_index": 1 + "name": "Gray" + }, + { + "name": "White" } - ] + ], + "variable": true, + "name": "Color" } - ], - "name": "Herman Miller Chair" + ] }, { + "name": "Warranty Program", "options": [], "stocks": [ { "choices": [], - "quantity": 10000, "name": "Warranty Program", + "quantity": 10000, "price": { "nominal": 100000, "real": 89000 @@ -170,47 +186,24 @@ } ], "required": false, - "name": "Warranty Program", "primary": false }, { - "options": [], - "primary": false, - "name": "Replacement Cushion", - "required": false, "stocks": [ { + "choices": [], + "quantity": 5000, "name": "Replacement Cushion", "price": { "nominal": 50000, "real": 39000 - }, - "choices": [], - "quantity": 5000 + } } - ] - } - ], - "content": { - "body": "The Herman Miller chair is an iconic ergonomic seating solution designed to provide unparalleled comfort and support. With its innovative design and high-quality materials, it is perfect for both home and office use.\\n\\n\\\"Elevate Your Workspace\\\": The Herman Miller chair enhances your productivity with its ergonomic features, ensuring you stay comfortable during long hours of work.\\n\\\"Timeless Design\\\": Combining aesthetics with functionality, this chair fits seamlessly into any environment, adding a touch of elegance to your space.\\n\\\"Adjustable Comfort\\\": With customizable settings, the Herman Miller chair adapts to your body, promoting better posture and reducing fatigue.\\n\\\"Built to Last\\\": Made from durable materials, this chair is designed for longevity, making it a worthwhile investment for anyone seeking quality seating.\\nIn summary, the Herman Miller chair stands out as a premium choice for users who value comfort, style, and durability. Whether for work or leisure, this chair is ready to enhance your experience and support your well-being.", - "title": "Herman Miller Chair", - "files": [], - "format": "md", - "thumbnails": [ - { - "extension": "png", - "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRaJWHEnwGGg-8rHni_2hN8HKUSkEBdU3X4w&s", - "name": "herman-miller-chair-thumbnail" - } - ] - }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "furnitures" - ] + ], + "options": [], + "name": "Replacement Cushion", + "required": false, + "primary": false } - ], - "opened_at": "2024-01-02T03:04:05.678Z" + ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.leica-m6.json b/examples/function-calling/arguments/gemini.leica-m6.input.json similarity index 51% rename from examples/function-calling/arguments/gemini.sale.input.leica-m6.json rename to examples/function-calling/arguments/gemini.leica-m6.input.json index a81766f..6b553cd 100644 --- a/examples/function-calling/arguments/gemini.sale.input.leica-m6.json +++ b/examples/function-calling/arguments/gemini.leica-m6.input.json @@ -1,6 +1,8 @@ { + "section_code": "general", "units": [ { + "name": "Leica M6 Body (2022 Reissue)", "options": [ { "candidates": [ @@ -11,20 +13,22 @@ "name": "Silver Chrome Finish" } ], - "name": "Finish", + "type": "select", "variable": true, - "type": "select" + "name": "Finish" } ], + "required": true, + "primary": true, "stocks": [ { + "name": "Leica M6 Body (2022 Reissue) - Black Paint Finish", "choices": [ { "option_index": 0, "candidate_index": 0 } ], - "name": "Leica M6 Body (2022 Reissue) - Black Paint Finish", "quantity": 500, "price": { "real": 6899000, @@ -45,19 +49,16 @@ } ] } - ], - "required": true, - "primary": true, - "name": "Leica M6 Body (2022 Reissue)" + ] }, { - "name": "50mm Summilux Lens", "options": [], + "primary": false, "stocks": [ { "price": { - "real": 4999000, - "nominal": 5200000 + "nominal": 5200000, + "real": 4999000 }, "quantity": 1000, "name": "50mm Summilux Lens", @@ -65,19 +66,21 @@ } ], "required": false, - "primary": false + "name": "50mm Summilux Lens" } ], - "closed_at": "2024-01-01T00:00:00Z", - "section_code": "general", + "tags": [], + "closed_at": "2024-07-19T12:00:00.000Z", + "opened_at": "2023-10-27T00:00:00.000Z", "content": { - "files": [], + "format": "md", + "body": "> The Leica M6, a beloved classic in the world of film photography, is back! The 2022 reissue brings modern enhancements while staying true to the original’s timeless charm. Designed for enthusiasts and professionals, the new M6 is a tribute to the past, with a touch of the future.\\n> \\n> - **\\\"Rediscover the Classic\\\":** The Leica M6 reissue retains the original design, offering the same iconic look and feel that photographers fell in love with decades ago.\\n> - **\\\"Enhanced for the Modern Era\\\":** Now featuring improved durability, a brighter viewfinder, and the latest advancements in metering, the M6 reissue ensures a seamless shooting experience.\\n> - **\\\"Craftsmanship Meets Tradition\\\":** Made in Germany, the M6 embodies Leica's dedication to quality and precision, delivering a tool that feels as good as it performs.\\n> - **\\\"For the Love of Film\\\":** The M6 is perfect for those who cherish the art of analog photography, providing an unmatched tactile and creative experience.\\n> \\n> In summary, the 2022 Leica M6 reissue is a perfect blend of heritage and innovation. It’s a must-have for collectors, analog enthusiasts, and anyone seeking the pure joy of shooting on film with a legendary camera.\\n> ", "title": "Leica M6 (2022 Reissue): The Return of a Legend", "thumbnails": [ { - "extension": "png", + "name": "leica-m6-thumbnail-1", "url": "https://leica-camera.com/sites/default/files/styles/r_media_medium_desktop_4_3/public/pm-84724-10557_leica_m6_black_front_1.png?itok=SpVHc0cq", - "name": "leica-m6-thumbnail-1" + "extension": "png" }, { "extension": "webp", @@ -85,24 +88,14 @@ "url": "https://leica-camera.com/sites/default/files/styles/r_media_fullscreen/public/2022-09/leica_m6_packaging_ambient_3840x2160.jpg.webp?itok=lig4kkiB" } ], - "body": "The Leica M6, a beloved classic in the world of film photography, is back! The 2022 reissue brings modern enhancements while staying true to the original’s timeless charm. Designed for enthusiasts and professionals, the new M6 is a tribute to the past, with a touch of the future.\\n\\n- **\\\"Rediscover the Classic\\\":** The Leica M6 reissue retains the original design, offering the same iconic look and feel that photographers fell in love with decades ago.\\n- **\\\"Enhanced for the Modern Era\\\":** Now featuring improved durability, a brighter viewfinder, and the latest advancements in metering, the M6 reissue ensures a seamless shooting experience.\\n- **\\\"Craftsmanship Meets Tradition\\\":** Made in Germany, the M6 embodies Leica's dedication to quality and precision, delivering a tool that feels as good as it performs.\\n- **\\\"For the Love of Film\\\":** The M6 is perfect for those who cherish the art of analog photography, providing an unmatched tactile and creative experience.\\n\\nIn summary, the 2022 Leica M6 reissue is a perfect blend of heritage and innovation. It’s a must-have for collectors, analog enthusiasts, and anyone seeking the pure joy of shooting on film with a legendary camera.", - "format": "md" + "files": [] }, "channels": [ { + "code": "samchon", "category_codes": [ "cameras" - ], - "code": "samchon" + ] } - ], - "opened_at": "2023-12-08T00:00:00Z", - "tags": [ - "leica", - "m6", - "film", - "camera", - "photography", - "analog" ] } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.microsoft-surface-pro-9.json b/examples/function-calling/arguments/gemini.microsoft-surface-pro-9.input.json similarity index 82% rename from examples/function-calling/arguments/gemini.sale.input.microsoft-surface-pro-9.json rename to examples/function-calling/arguments/gemini.microsoft-surface-pro-9.input.json index 345106f..5dc8ff7 100644 --- a/examples/function-calling/arguments/gemini.sale.input.microsoft-surface-pro-9.json +++ b/examples/function-calling/arguments/gemini.microsoft-surface-pro-9.input.json @@ -1,47 +1,131 @@ { + "content": { + "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.", + "thumbnails": [ + { + "extension": ".jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg", + "name": "microsoft-surface-pro-9-thumbnail-1" + }, + { + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg", + "name": "microsoft-surface-pro-9-thumbnail-2", + "extension": ".jpeg" + }, + { + "name": "microsoft-surface-pro-9-thumbnail-3", + "extension": ".jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg" + } + ], + "title": "Surface Pro 9", + "files": [], + "format": "md" + }, + "section_code": "general", + "opened_at": null, + "tags": [], + "channels": [ + { + "category_codes": [ + "laptops", + "tablets", + "2in1_laptops" + ], + "code": "samchon" + } + ], "units": [ { - "primary": false, - "options": [], - "required": false, "name": "Warranty Program", + "primary": false, "stocks": [ { + "name": "Warranty Program", + "quantity": 10000, "price": { - "real": 89000, - "nominal": 100000 + "nominal": 100000, + "real": 89000 }, - "choices": [], - "quantity": 10000, - "name": "Warranty Program" + "choices": [] } - ] + ], + "options": [], + "required": false }, { "stocks": [ { - "name": "Magnetic Keyboard", + "choices": [], + "quantity": 8000, "price": { - "real": 169000, - "nominal": 200000 + "nominal": 200000, + "real": 169000 }, - "choices": [], - "quantity": 8000 + "name": "Magnetic Keyboard" } ], - "name": "Magnetic Keyboard", "required": false, + "options": [], "primary": false, - "options": [] + "name": "Magnetic Keyboard" }, { + "name": "Surface Pro 9 Entity", + "required": true, + "primary": true, + "options": [ + { + "type": "select", + "candidates": [ + { + "name": "Intel Core i3" + }, + { + "name": "Intel Core i5" + }, + { + "name": "Intel Core i7" + } + ], + "variable": true, + "name": "CPU" + }, + { + "candidates": [ + { + "name": "8 GB" + }, + { + "name": "16 GB" + }, + { + "name": "32 GB" + } + ], + "variable": true, + "type": "select", + "name": "RAM" + }, + { + "candidates": [ + { + "name": "128 GB" + }, + { + "name": "256 GB" + }, + { + "name": "512 GB" + } + ], + "type": "select", + "variable": true, + "name": "Storage" + } + ], "stocks": [ { - "price": { - "nominal": 1000000, - "real": 899000 - }, - "name": "(i3, 8 GB, 128 GB)", "quantity": 1000, "choices": [ { @@ -53,22 +137,25 @@ "option_index": 1 }, { - "option_index": 2, - "candidate_index": 0 + "candidate_index": 0, + "option_index": 2 } - ] + ], + "price": { + "nominal": 1000000, + "real": 899000 + }, + "name": "i3 + 8GB + 128GB" }, { - "name": "(i3, 16 GB, 256 GB)", - "quantity": 1000, "choices": [ { - "candidate_index": 0, - "option_index": 0 + "option_index": 0, + "candidate_index": 0 }, { - "option_index": 1, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 1 }, { "candidate_index": 1, @@ -78,45 +165,47 @@ "price": { "real": 1099000, "nominal": 1200000 - } + }, + "quantity": 1000, + "name": "i3 + 16GB + 256GB" }, { - "name": "(i3, 16 GB, 512 GB)", "price": { "nominal": 1400000, "real": 1299000 }, - "quantity": 1000, + "name": "i3 + 16GB + 512GB", "choices": [ { "option_index": 0, "candidate_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 1 }, { "option_index": 2, "candidate_index": 2 } - ] + ], + "quantity": 1000 }, { + "name": "i5 + 16GB + 256GB", "quantity": 1000, - "name": "(i5, 16 GB, 256 GB)", "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 0 }, { "option_index": 1, "candidate_index": 1 }, { - "candidate_index": 1, - "option_index": 2 + "option_index": 2, + "candidate_index": 1 } ], "price": { @@ -125,26 +214,26 @@ } }, { - "price": { - "real": 1699000, - "nominal": 1800000 - }, - "name": "(i5, 32 GB, 512 GB)", + "quantity": 1000, "choices": [ { "candidate_index": 1, "option_index": 0 }, { - "option_index": 1, - "candidate_index": 2 + "candidate_index": 2, + "option_index": 1 }, { "option_index": 2, "candidate_index": 2 } ], - "quantity": 1000 + "price": { + "nominal": 1800000, + "real": 1699000 + }, + "name": "i5 + 32GB + 512GB" }, { "choices": [ @@ -157,8 +246,8 @@ "candidate_index": 1 }, { - "candidate_index": 2, - "option_index": 2 + "option_index": 2, + "candidate_index": 2 } ], "price": { @@ -166,121 +255,32 @@ "real": 1699000 }, "quantity": 1000, - "name": "(i7, 16 GB, 512 GB)" + "name": "i7 + 16GB + 512GB" }, { - "name": "(i7, 32 GB, 512 GB)", "choices": [ { "candidate_index": 2, "option_index": 0 }, { - "candidate_index": 2, - "option_index": 1 + "option_index": 1, + "candidate_index": 2 }, { "option_index": 2, "candidate_index": 2 } ], - "quantity": 1000, "price": { - "real": 1899000, - "nominal": 2000000 - } - } - ], - "primary": true, - "options": [ - { - "variable": true, - "name": "CPU", - "type": "select", - "candidates": [ - { - "name": "Intel Core i3" - }, - { - "name": "Intel Core i5" - }, - { - "name": "Intel Core i7" - } - ] - }, - { - "variable": true, - "type": "select", - "name": "RAM", - "candidates": [ - { - "name": "8 GB" - }, - { - "name": "16 GB" - }, - { - "name": "32 GB" - } - ] - }, - { - "variable": true, - "name": "Storage", - "candidates": [ - { - "name": "128 GB" - }, - { - "name": "256 GB" - }, - { - "name": "512 GB" - } - ], - "type": "select" + "nominal": 2000000, + "real": 1899000 + }, + "quantity": 1000, + "name": "i7 + 32GB + 512GB" } - ], - "required": true, - "name": "Surface Pro 9 Entity" - } - ], - "opened_at": "2024-01-01T00:00:00.000Z", - "channels": [ - { - "category_codes": [ - "electronics", - "laptops", - "2_in_1_laptops" - ], - "code": "samchon" + ] } ], - "content": { - "files": [], - "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.", - "format": "md", - "title": "Surface Pro 9", - "thumbnails": [ - { - "name": "microsoft-surface-pro-9-thumbnail-1", - "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg", - "extension": "jpeg" - }, - { - "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg", - "extension": "jpeg", - "name": "microsoft-surface-pro-9-thumbnail-2" - }, - { - "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg", - "name": "microsoft-surface-pro-9-thumbnail-3", - "extension": "jpeg" - } - ] - }, - "section_code": "general", - "tags": [], - "closed_at": "2024-07-30T07:11:00.000Z" + "closed_at": null } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.apple-iphone.json b/examples/function-calling/arguments/gemini.sale.input.apple-iphone.json deleted file mode 100644 index cf26aad..0000000 --- a/examples/function-calling/arguments/gemini.sale.input.apple-iphone.json +++ /dev/null @@ -1,287 +0,0 @@ -{ - "content": { - "format": "md", - "title": "Apple MacBook Pro", - "thumbnails": [ - { - "extension": "jpeg", - "url": "https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/mbp14-spaceblack-gallery1-202410?wid=4000&hei=3074&fmt=jpeg&qlt=90&.v=1729264981617", - "name": "apple-iphone-thumbnail" - } - ], - "files": [], - "body": "MacBook Pro\\n\\n\\n**The Ultimate Tool for Professionals**\\n\\nMacBook Pro is designed to elevate your creativity and productivity to new heights. Combining exceptional performance, elegant design, and the unparalleled experience only Apple can deliver, this is the device that empowers you to tackle any challenge with confidence.\\n\\n- **Remarkable Performance**\\n \\n Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency.\\n \\n- **Outstanding Display**\\n \\n The Retina display offers rich colors and sharp contrast, creating an immersive visual experience. With ProMotion technology, enjoy smooth scrolling and fluid animations like never before.\\n \\n- **All-Day Battery Life**\\n \\n Stay focused and in the flow wherever you go with a battery that lasts all day. This is a laptop that works as hard as you do.\\n \\n- **Sleek Yet Powerful Design**\\n \\n A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go.\\n \\n- **Smart Connectivity**\\n \\n Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment.\\n \\n\\nWith MacBook Pro, your potential knows no bounds.\\n**It’s time to rediscover what you’re capable of.**" - }, - "tags": [], - "opened_at": "2024-01-01T00:00:00Z", - "channels": [ - { - "code": "samchon", - "category_codes": [ - "laptops", - "macbooks" - ] - } - ], - "section_code": "general", - "closed_at": "2024-12-31T23:59:59Z", - "units": [ - { - "name": "MacBook M3 Pro 14inch Entity", - "primary": true, - "required": true, - "stocks": [ - { - "choices": [ - { - "candidate_index": 0, - "option_index": 0 - }, - { - "candidate_index": 0, - "option_index": 1 - }, - { - "candidate_index": 0, - "option_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ], - "name": "Silver/16GB/512GB/English", - "price": { - "nominal": 2000000, - "real": 1800000 - }, - "quantity": 100 - }, - { - "quantity": 100, - "price": { - "real": 1800000, - "nominal": 2000000 - }, - "name": "Silver/16GB/512GB/Korean", - "choices": [ - { - "candidate_index": 0, - "option_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "candidate_index": 0, - "option_index": 2 - }, - { - "candidate_index": 1, - "option_index": 3 - } - ] - }, - { - "choices": [ - { - "candidate_index": 0, - "option_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "option_index": 2, - "candidate_index": 1 - }, - { - "candidate_index": 0, - "option_index": 3 - } - ], - "quantity": 100, - "name": "Silver/16GB/1TB/English", - "price": { - "nominal": 2300000, - "real": 2070000 - } - }, - { - "price": { - "real": 2070000, - "nominal": 2300000 - }, - "name": "Silver/16GB/1TB/Korean", - "quantity": 100, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - }, - { - "option_index": 1, - "candidate_index": 0 - }, - { - "candidate_index": 1, - "option_index": 2 - }, - { - "option_index": 3, - "candidate_index": 1 - } - ] - }, - { - "quantity": 100, - "name": "Silver/16GB/2TB/English", - "price": { - "real": 2610000, - "nominal": 2900000 - }, - "choices": [ - { - "candidate_index": 0, - "option_index": 0 - }, - { - "candidate_index": 0, - "option_index": 1 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "option_index": 3, - "candidate_index": 0 - } - ] - }, - { - "choices": [ - { - "candidate_index": 1, - "option_index": 0 - }, - { - "option_index": 1, - "candidate_index": 2 - }, - { - "option_index": 2, - "candidate_index": 2 - }, - { - "candidate_index": 1, - "option_index": 3 - } - ], - "price": { - "real": 3735000, - "nominal": 4150000 - }, - "name": "Space Gray/64GB/2TB/Korean", - "quantity": 100 - } - ], - "options": [ - { - "type": "select", - "candidates": [ - { - "name": "Silver" - }, - { - "name": "Space Gray" - } - ], - "variable": true, - "name": "Color" - }, - { - "candidates": [ - { - "name": "16GB" - }, - { - "name": "32GB" - }, - { - "name": "64GB" - } - ], - "name": "RAM", - "type": "select", - "variable": true - }, - { - "name": "SSD", - "type": "select", - "candidates": [ - { - "name": "512GB" - }, - { - "name": "1TB" - }, - { - "name": "2TB" - } - ], - "variable": true - }, - { - "variable": true, - "candidates": [ - { - "name": "English" - }, - { - "name": "Korean" - } - ], - "name": "Keyboard Language", - "type": "select" - } - ] - }, - { - "options": [], - "required": false, - "primary": false, - "stocks": [ - { - "price": { - "real": 89000, - "nominal": 100000 - }, - "quantity": 10000, - "name": "Warranty Program", - "choices": [] - } - ], - "name": "Warranty Program" - }, - { - "stocks": [ - { - "choices": [], - "name": "Magsafe Keyboard", - "price": { - "nominal": 200000, - "real": 169000 - }, - "quantity": 8000 - } - ], - "options": [], - "name": "Magnetic Keyboard", - "required": false, - "primary": false - } - ] -} \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.apple-vision-pro.json b/examples/function-calling/arguments/gemini.sale.input.apple-vision-pro.json deleted file mode 100644 index b11ce34..0000000 --- a/examples/function-calling/arguments/gemini.sale.input.apple-vision-pro.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "tags": [ - "apple", - "vision", - "air", - "ar", - "augmented", - "reality" - ], - "section_code": "general", - "content": { - "files": [], - "title": "Apple Vision Air", - "body": "### Product Introduction\\n\\nApple Vision Air\\n\\n### Preface\\n\\nThe Apple Vision Air is a groundbreaking addition to Apple's lineup of innovative devices, designed to enhance your digital experience through augmented reality. With its sleek design and advanced technology, the Vision Air aims to redefine how users interact with their surroundings, providing a seamless blend of the physical and digital worlds.\\n\\n### Content\\n\\n![apple-vision-pro-thumbnail.png](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s)\\n\\nThe Apple Vision Air features a lightweight and comfortable design, making it perfect for extended use. Equipped with high-resolution displays and cutting-edge optics, it offers stunning visuals that immerse users in their augmented reality experiences. The device is powered by the latest Apple silicon, ensuring smooth performance and efficient battery life.\\n\\nThe Apple Vision Air is more than just a device; it’s a gateway to a new reality. Whether for work, play, or exploration, it represents the future of immersive technology.\\n\\n### Key Features\\n\\nAugmented Reality Capabilities: Experience a new dimension of interaction with AR applications that enhance everyday tasks and entertainment.\\n\\nHigh-Resolution Display: Enjoy vibrant and crisp visuals, making every detail come to life.\\nIntuitive Controls: Navigate effortlessly with gesture controls and voice commands, designed for user convenience.\\n\\nSeamless Integration: Connect with other Apple devices for a unified ecosystem that enhances productivity and creativity.\\n\\nDurability and Comfort: Built with premium materials, the Vision Air ensures longevity and comfort during prolonged use.\\n\\n### SKU\\n\\nAVA-2023-001 | 256GB | ₩2,990,000\\n\\nAVA-2023-002 | 512GB | ₩3,490,000\\n\\nAVA-2023-003 | 1TB | ₩3,990,000", - "thumbnails": [ - { - "name": "apple-vision-pro-thumbnail", - "extension": "png", - "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdIP_qI0xBL04d0DRIw7tIU9y0cLcwfIqi7g&s" - } - ], - "format": "md" - }, - "channels": [ - { - "code": "samchon", - "category_codes": [ - "smart_glasses" - ] - } - ], - "opened_at": "2023-07-20T12:34:56.789Z", - "units": [ - { - "name": "Apple Vision Air", - "options": [ - { - "variable": true, - "name": "Storage", - "candidates": [ - { - "name": "256GB" - }, - { - "name": "512GB" - }, - { - "name": "1TB" - } - ], - "type": "select" - } - ], - "stocks": [ - { - "quantity": 100, - "name": "Apple Vision Air 256GB", - "price": { - "nominal": 2990000, - "real": 2990000 - }, - "choices": [ - { - "option_index": 0, - "candidate_index": 0 - } - ] - }, - { - "quantity": 100, - "choices": [ - { - "option_index": 0, - "candidate_index": 1 - } - ], - "name": "Apple Vision Air 512GB", - "price": { - "real": 3490000, - "nominal": 3490000 - } - }, - { - "choices": [ - { - "candidate_index": 2, - "option_index": 0 - } - ], - "quantity": 50, - "name": "Apple Vision Air 1TB", - "price": { - "real": 3990000, - "nominal": 3990000 - } - } - ], - "required": true, - "primary": true - } - ], - "closed_at": "2024-07-19T12:34:56.789Z" -} \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.json b/examples/function-calling/arguments/gemini.sale.input.json index 04c253c..b273326 100644 --- a/examples/function-calling/arguments/gemini.sale.input.json +++ b/examples/function-calling/arguments/gemini.sale.input.json @@ -1,84 +1,76 @@ { - "closed_at": "2024-07-19T12:00:00.000Z", - "content": { - "title": "Surface Pro 9", - "format": "md", - "files": [], - "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.", - "thumbnails": [ - { - "name": "microsoft-surface-pro-9-thumbnail-1", - "extension": "jpeg", - "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg" - }, - { - "name": "microsoft-surface-pro-9-thumbnail-2", - "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg", - "extension": "jpeg" - }, - { - "name": "microsoft-surface-pro-9-thumbnail-3", - "extension": "jpeg", - "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg" - } - ] - }, + "channels": [ + { + "category_codes": [ + "laptops", + "tablets", + "2in1_laptops" + ], + "code": "samchon" + } + ], + "closed_at": "2024-07-30T12:00:00.000Z", "units": [ { - "required": true, "name": "Surface Pro 9 Entity", - "stocks": [ + "required": true, + "options": [ { - "quantity": 1000, - "choices": [ + "variable": true, + "candidates": [ { - "candidate_index": 0, - "option_index": 0 + "name": "Intel Core i3" }, { - "option_index": 1, - "candidate_index": 0 + "name": "Intel Core i5" }, { - "candidate_index": 0, - "option_index": 2 + "name": "Intel Core i7" } ], - "price": { - "real": 899000, - "nominal": 1000000 - }, - "name": "(i3, 8 GB, 128 GB)" + "type": "select", + "name": "CPU" }, { - "choices": [ + "type": "select", + "variable": true, + "candidates": [ { - "option_index": 0, - "candidate_index": 0 + "name": "8 GB" }, { - "option_index": 1, - "candidate_index": 1 + "name": "16 GB" }, { - "candidate_index": 1, - "option_index": 2 + "name": "32 GB" } ], - "name": "(i3, 16 GB, 256 GB)", - "quantity": 1000, - "price": { - "real": 1099000, - "nominal": 1200000 - } + "name": "RAM" }, { - "quantity": 1000, - "name": "(i3, 16 GB, 512 GB)", + "candidates": [ + { + "name": "128 GB" + }, + { + "name": "256 GB" + }, + { + "name": "512 GB" + } + ], + "variable": true, + "name": "Storage", + "type": "select" + } + ], + "stocks": [ + { "price": { - "real": 1299000, - "nominal": 1400000 + "nominal": 1000000, + "real": 899000 }, + "quantity": 1000, "choices": [ { "candidate_index": 0, @@ -86,84 +78,85 @@ }, { "option_index": 1, - "candidate_index": 1 + "candidate_index": 0 }, { - "option_index": 2, - "candidate_index": 2 + "candidate_index": 0, + "option_index": 2 } - ] + ], + "name": "(i3, 8 GB, 128 GB)" }, { "quantity": 1000, - "name": "(i5, 16 GB, 256 GB)", "price": { - "nominal": 1500000, - "real": 1399000 + "nominal": 1200000, + "real": 1099000 }, "choices": [ { - "candidate_index": 1, + "candidate_index": 0, "option_index": 0 }, { - "option_index": 1, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 1 }, { - "option_index": 2, - "candidate_index": 1 + "candidate_index": 1, + "option_index": 2 } - ] + ], + "name": "(i3, 16 GB, 256 GB)" }, { - "price": { - "real": 1699000, - "nominal": 1800000 - }, "choices": [ { - "option_index": 0, - "candidate_index": 1 + "candidate_index": 0, + "option_index": 0 }, { "option_index": 1, - "candidate_index": 2 + "candidate_index": 1 }, { - "candidate_index": 2, - "option_index": 2 + "option_index": 2, + "candidate_index": 2 } ], + "name": "(i3, 16 GB, 512 GB)", "quantity": 1000, - "name": "(i5, 32 GB, 512 GB)" + "price": { + "real": 1299000, + "nominal": 1400000 + } }, { - "name": "(i7, 16 GB, 512 GB)", + "name": "(i5, 16 GB, 256 GB)", + "quantity": 1000, "choices": [ { - "option_index": 0, - "candidate_index": 2 + "candidate_index": 1, + "option_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 1 }, { - "candidate_index": 2, + "candidate_index": 1, "option_index": 2 } ], - "quantity": 1000, "price": { - "real": 1699000, - "nominal": 1800000 + "nominal": 1500000, + "real": 1399000 } }, { "choices": [ { - "candidate_index": 2, + "candidate_index": 1, "option_index": 0 }, { @@ -175,112 +168,119 @@ "candidate_index": 2 } ], - "name": "(i7, 32 GB, 512 GB)", + "quantity": 1000, "price": { - "real": 1899000, - "nominal": 2000000 + "nominal": 1800000, + "real": 1699000 }, - "quantity": 1000 - } - ], - "primary": true, - "options": [ - { - "candidates": [ - { - "name": "Intel Core i3" - }, - { - "name": "Intel Core i5" - }, - { - "name": "Intel Core i7" - } - ], - "name": "CPU", - "type": "select", - "variable": true + "name": "(i5, 32 GB, 512 GB)" }, { - "type": "select", - "candidates": [ + "choices": [ { - "name": "8 GB" + "option_index": 0, + "candidate_index": 2 }, { - "name": "16 GB" + "option_index": 1, + "candidate_index": 1 }, { - "name": "32 GB" + "option_index": 2, + "candidate_index": 2 } ], - "name": "RAM", - "variable": true + "price": { + "nominal": 1800000, + "real": 1699000 + }, + "quantity": 1000, + "name": "(i7, 16 GB, 512 GB)" }, { - "variable": true, - "candidates": [ + "choices": [ { - "name": "128 GB" + "candidate_index": 2, + "option_index": 0 }, { - "name": "256 GB" + "option_index": 1, + "candidate_index": 2 }, { - "name": "512 GB" + "candidate_index": 2, + "option_index": 2 } ], - "type": "select", - "name": "Storage" + "quantity": 1000, + "price": { + "nominal": 2000000, + "real": 1899000 + }, + "name": "(i7, 32 GB, 512 GB)" } - ] + ], + "primary": true }, { - "primary": false, "options": [], + "name": "Warranty Program", + "required": false, "stocks": [ { - "name": "1 year warranty", "price": { - "real": 89000, - "nominal": 100000 + "nominal": 100000, + "real": 89000 }, - "choices": [], - "quantity": 10000 + "name": "Warranty Program", + "quantity": 10000, + "choices": [] } ], - "required": false, - "name": "Warranty Program" + "primary": false }, { - "name": "Magnetic Keyboard", - "required": false, "options": [], - "primary": false, "stocks": [ { - "name": "Black", "quantity": 8000, - "choices": [], + "name": "Magnetic Keyboard", "price": { - "real": 169000, - "nominal": 200000 - } + "nominal": 200000, + "real": 169000 + }, + "choices": [] } - ] - } - ], - "channels": [ - { - "category_codes": [ - "electronics", - "laptops", - "2_in_1_laptops" ], - "code": "samchon" + "name": "Magnetic Keyboard", + "required": false, + "primary": false } ], - "opened_at": "2023-12-25T12:00:00.000Z", - "section_code": "general", - "tags": [] + "content": { + "thumbnails": [ + { + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg", + "name": "microsoft-surface-pro-9-thumbnail-1" + }, + { + "extension": "jpeg", + "name": "microsoft-surface-pro-9-thumbnail-2", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg" + }, + { + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg", + "name": "microsoft-surface-pro-9-thumbnail-3", + "extension": "jpeg" + } + ], + "files": [], + "format": "md", + "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.", + "title": "Surface Pro 9" + }, + "tags": [], + "opened_at": "2024-01-01T00:00:00.000Z", + "section_code": "general" } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.samsung-galaxy-watch-7.json b/examples/function-calling/arguments/gemini.samsung-galaxy-watch-7.input.json similarity index 81% rename from examples/function-calling/arguments/gemini.sale.input.samsung-galaxy-watch-7.json rename to examples/function-calling/arguments/gemini.samsung-galaxy-watch-7.input.json index 7ef0d42..bf0b7ea 100644 --- a/examples/function-calling/arguments/gemini.sale.input.samsung-galaxy-watch-7.json +++ b/examples/function-calling/arguments/gemini.samsung-galaxy-watch-7.input.json @@ -1,100 +1,86 @@ { "tags": [], + "content": { + "thumbnails": [ + { + "url": "https://images.samsung.com/kdp/goods/2024/07/07/597615f6-b6f9-4ae4-a93d-cbba6bdde2c6.png?$944_550_PNG$", + "name": "galaxy-watch-7-thumbnail", + "extension": "png" + } + ], + "format": "md", + "title": "Galaxy Watch 7", + "body": "The Galaxy Watch 7 is a premium smartwatch designed with innovative aesthetics and high-quality materials, making it a perfect fit for both daily life and work. ([samsung.com](https://www.samsung.com/sec/watches/galaxy-watch/galaxy-watch7/))\\n\\n“Upgrade Your Style”: The Galaxy Watch 7 adds a sophisticated touch to your wrist with its floating glass design and a variety of color options.\\n“Personalized Sleep Coaching”: Its sleep tracking feature analyzes your sleep patterns and provides personalized sleep coaching.\\n\\n“Enhanced Workout Tracking”: Supports a wide range of workout modes and provides detailed data such as heart rate and calorie burn.\\n\\n“Powerful Performance”: Equipped with the latest processor and long battery life, it offers stable performance for everything from daily use to high-intensity workouts.\\n\\nIn summary, the Galaxy Watch 7 is a premium smartwatch combining style, functionality, and durability, making it the perfect choice to enhance your health and lifestyle.", + "files": [] + }, "section_code": "general", + "closed_at": "2025-07-30T12:00:00.000Z", "channels": [ { + "code": "samchon", "category_codes": [ "smart_watches" - ], - "code": "samchon" + ] } ], - "content": { - "files": [], - "title": "Galaxy Watch 7", - "format": "md", - "body": "The Galaxy Watch 7 is a premium smartwatch designed with innovative aesthetics and high-quality materials, making it a perfect fit for both daily life and work. ([samsung.com](https://www.samsung.com/sec/watches/galaxy-watch/galaxy-watch7/))\\n\\n“Upgrade Your Style”: The Galaxy Watch 7 adds a sophisticated touch to your wrist with its floating glass design and a variety of color options.\\n“Personalized Sleep Coaching”: Its sleep tracking feature analyzes your sleep patterns and provides personalized sleep coaching.\\n\\n“Enhanced Workout Tracking”: Supports a wide range of workout modes and provides detailed data such as heart rate and calorie burn.\\n\\n“Powerful Performance”: Equipped with the latest processor and long battery life, it offers stable performance for everything from daily use to high-intensity workouts.\\n\\nIn summary, the Galaxy Watch 7 is a premium smartwatch combining style, functionality, and durability, making it the perfect choice to enhance your health and lifestyle.", - "thumbnails": [ - { - "name": "galaxy-watch-7-thumbnail", - "extension": "png", - "url": "https://images.samsung.com/kdp/goods/2024/07/07/597615f6-b6f9-4ae4-a93d-cbba6bdde2c6.png?$944_550_PNG$" - } - ] - }, - "closed_at": "2024-08-31T15:00:00.000Z", "units": [ { - "primary": false, - "required": false, + "name": "Warranty Program", "stocks": [ { + "name": "Warranty Program", "quantity": 10000, "choices": [], - "name": "Warranty Program", "price": { - "real": 89000, - "nominal": 100000 + "nominal": 100000, + "real": 89000 } } ], - "name": "Warranty Program", + "required": false, + "primary": false, "options": [] }, { "primary": false, "stocks": [ { - "choices": [], - "quantity": 5000, - "name": "Replacement Strap", "price": { "nominal": 50000, "real": 39000 - } + }, + "quantity": 5000, + "choices": [], + "name": "Replacement Strap" } ], + "required": false, "name": "Replacement Strap", - "options": [], - "required": false + "options": [] }, { - "options": [ + "stocks": [ { - "variable": true, - "candidates": [ + "quantity": 1000, + "name": "Standard Green", + "choices": [ { - "name": "Standard" + "candidate_index": 0, + "option_index": 0 }, { - "name": "Ultra" + "option_index": 1, + "candidate_index": 0 } ], - "name": "Model", - "type": "select" + "price": { + "real": 359000, + "nominal": 400000 + } }, { - "candidates": [ - { - "name": "Green" - }, - { - "name": "Silver" - }, - { - "name": "Cream" - } - ], - "type": "select", - "variable": true, - "name": "Color" - } - ], - "primary": true, - "name": "Galaxy Watch 7", - "required": true, - "stocks": [ - { + "name": "Standard Silver", + "quantity": 1000, "price": { "real": 359000, "nominal": 400000 @@ -105,56 +91,54 @@ "option_index": 0 }, { - "option_index": 1, - "candidate_index": 0 + "candidate_index": 1, + "option_index": 1 } - ], - "name": "Galaxy Watch 7 (Standard, Green)", - "quantity": 1000 + ] }, { + "price": { + "real": 359000, + "nominal": 400000 + }, + "name": "Standard Cream", "choices": [ { "candidate_index": 0, "option_index": 0 }, { - "candidate_index": 1, - "option_index": 1 + "option_index": 1, + "candidate_index": 2 } ], - "quantity": 1000, - "price": { - "nominal": 400000, - "real": 359000 - }, - "name": "Galaxy Watch 7 (Standard, Silver)" + "quantity": 1000 }, { "quantity": 1000, - "price": { - "real": 359000, - "nominal": 400000 - }, "choices": [ { "option_index": 0, - "candidate_index": 0 + "candidate_index": 1 }, { - "candidate_index": 2, - "option_index": 1 + "option_index": 1, + "candidate_index": 0 } ], - "name": "Galaxy Watch 7 (Standard, Cream)" + "price": { + "nominal": 600000, + "real": 549000 + }, + "name": "Ultra Green" }, { "quantity": 1000, - "name": "Galaxy Watch 7 (Ultra, Green)", "price": { - "real": 549000, - "nominal": 600000 + "nominal": 600000, + "real": 549000 }, + "name": "Ultra Silver", "choices": [ { "candidate_index": 1, @@ -162,48 +146,64 @@ }, { "option_index": 1, - "candidate_index": 0 + "candidate_index": 1 } ] }, { - "name": "Galaxy Watch 7 (Ultra, Silver)", - "quantity": 1000, "price": { - "nominal": 600000, - "real": 549000 + "real": 549000, + "nominal": 600000 }, + "quantity": 1000, + "name": "Ultra Cream", "choices": [ { "candidate_index": 1, "option_index": 0 }, { - "candidate_index": 1, + "candidate_index": 2, "option_index": 1 } ] + } + ], + "required": true, + "options": [ + { + "type": "select", + "candidates": [ + { + "name": "Standard" + }, + { + "name": "Ultra" + } + ], + "variable": true, + "name": "Model" }, { - "choices": [ + "type": "select", + "name": "Color", + "candidates": [ { - "candidate_index": 1, - "option_index": 0 + "name": "Green" }, { - "option_index": 1, - "candidate_index": 2 + "name": "Silver" + }, + { + "name": "Cream" } ], - "name": "Galaxy Watch 7 (Ultra, Cream)", - "price": { - "nominal": 600000, - "real": 549000 - }, - "quantity": 1000 + "variable": true } - ] + ], + "name": "Galaxy Watch 7", + "primary": true } ], - "opened_at": "2024-08-01T15:00:00.000Z" + "opened_at": "2024-07-30T12:00:00.000Z" } \ No newline at end of file diff --git a/examples/function-calling/arguments/gemini.sale.input.stanley-tumbler-collection.json b/examples/function-calling/arguments/gemini.stanley-tumbler-collection.input.json similarity index 54% rename from examples/function-calling/arguments/gemini.sale.input.stanley-tumbler-collection.json rename to examples/function-calling/arguments/gemini.stanley-tumbler-collection.input.json index a30043e..8b40070 100644 --- a/examples/function-calling/arguments/gemini.sale.input.stanley-tumbler-collection.json +++ b/examples/function-calling/arguments/gemini.stanley-tumbler-collection.input.json @@ -1,158 +1,164 @@ { - "closed_at": "2024-07-30T12:00:00.000Z", + "opened_at": "2024-07-20T12:00:00.000Z", + "channels": [ + { + "code": "samchon", + "category_codes": [ + "others" + ] + } + ], "section_code": "general", + "tags": [ + "stanley", + "tumbler", + "drinkware", + "eco-friendly", + "durable" + ], + "content": { + "files": [], + "title": "Stanley Tumbler Collection", + "thumbnails": [ + { + "url": "https://serpapi.com/searches/673d71322c566d56d9c20ceb/images/ce9a07f2aa831dbec8bb1c287299706e24a52a8e0c119fa162041805038957a7.jpeg", + "extension": "jpeg", + "name": "stanley-tumbler-collection-thumbnail" + } + ], + "format": "md", + "body": "The Stanley Tumbler Collection is the perfect companion for staying hydrated, whether you're at work, on the go, or exploring the great outdoors. Designed with functionality and durability in mind, these tumblers are built to keep your drinks at the perfect temperature all day long.\\n\\n- **\\\"Built for Adventure\\\"**: The Stanley Tumbler features rugged construction, making it ideal for outdoor enthusiasts and urban adventurers alike.\\n- **\\\"Temperature Control at Its Best\\\"**: With double-wall vacuum insulation, the Stanley Tumbler keeps drinks hot for up to 7 hours or cold for up to 11 hours.\\n- **\\\"Leakproof and Spillproof\\\"**: Designed for ease of use, these tumblers are 100% leakproof, ensuring your drink stays exactly where it belongs.\\n- **\\\"Eco-Friendly and Sustainable\\\"**: Made with 18/8 stainless steel, Stanley Tumblers are BPA-free and built to last, reducing waste from disposable cups.\\n\\nIn summary, the Stanley Tumbler Collection combines durability, functionality, and style. Whether you're sipping coffee during your morning commute or staying hydrated during a hike, Stanley Tumblers are designed to meet your needs. Choose Stanley and enjoy unmatched quality and performance." + }, "units": [ { - "stocks": [ + "options": [ { - "choices": [ + "candidates": [ { - "candidate_index": 0, - "option_index": 0 + "name": "16 oz" }, { - "option_index": 1, - "candidate_index": 0 + "name": "20 oz" + }, + { + "name": "24 oz" } ], - "price": { - "real": 35000, - "nominal": 40000 - }, - "quantity": 2000, - "name": "(16 oz, Matte Black)" + "variable": true, + "name": "Capacity", + "type": "select" }, { - "price": { - "real": 44000, - "nominal": 50000 - }, - "choices": [ + "variable": true, + "type": "select", + "candidates": [ { - "candidate_index": 1, - "option_index": 0 + "name": "Matte Black" }, { - "candidate_index": 1, - "option_index": 1 + "name": "Hammertone Green" + }, + { + "name": "Polar White" } ], - "name": "(20 oz, Hammertone Green)", - "quantity": 2000 - }, + "name": "Color Options" + } + ], + "primary": true, + "stocks": [ { + "quantity": 2000, + "price": { + "nominal": 40000, + "real": 35000 + }, "choices": [ { - "candidate_index": 2, + "candidate_index": 0, "option_index": 0 }, { - "candidate_index": 2, + "candidate_index": 0, "option_index": 1 } ], + "name": "(16 oz, Matte Black)" + }, + { "quantity": 2000, + "name": "(20 oz, Hammertone Green)", "price": { - "nominal": 60000, - "real": 54000 + "nominal": 50000, + "real": 44000 }, - "name": "(24 oz, Polar White)" - } - ], - "name": "Classic Tumbler", - "options": [ - { - "type": "select", - "name": "Capacity", - "variable": true, - "candidates": [ - { - "name": "16 oz" - }, + "choices": [ { - "name": "20 oz" + "candidate_index": 1, + "option_index": 0 }, { - "name": "24 oz" + "candidate_index": 1, + "option_index": 1 } ] }, { - "variable": true, - "type": "select", - "name": "Color Options", - "candidates": [ + "choices": [ { - "name": "Matte Black" + "option_index": 0, + "candidate_index": 2 }, { - "name": "Hammertone Green" - }, - { - "name": "Polar White" + "option_index": 1, + "candidate_index": 2 } - ] + ], + "price": { + "real": 54000, + "nominal": 60000 + }, + "quantity": 2000, + "name": "(24 oz, Polar White)" } ], - "required": true, - "primary": true + "name": "Classic Tumbler", + "required": true }, { + "required": false, + "primary": false, + "name": "Adventure Quencher Tumbler", "stocks": [ { + "quantity": 5000, "name": "Adventure Quencher Tumbler", "choices": [], "price": { "nominal": 70000, "real": 64000 - }, - "quantity": 5000 + } } ], - "name": "Adventure Quencher Tumbler", - "required": false, - "primary": false, "options": [] }, { + "name": "Accessories Set", + "options": [], + "required": false, + "primary": false, "stocks": [ { + "quantity": 10000, + "choices": [], "price": { - "nominal": 20000, - "real": 18000 + "real": 18000, + "nominal": 20000 }, - "choices": [], - "quantity": 10000, "name": "Accessories Set" } - ], - "name": "Accessories Set", - "options": [], - "required": false, - "primary": false - } - ], - "content": { - "thumbnails": [ - { - "extension": "jpeg", - "name": "stanley-tumbler-collection-thumbnail", - "url": "https://serpapi.com/searches/673d71322c566d56d9c20ceb/images/ce9a07f2aa831dbec8bb1c287299706e24a52a8e0c119fa162041805038957a7.jpeg" - } - ], - "title": "Stanley Tumbler Collection", - "format": "md", - "body": "> The Stanley Tumbler Collection is the perfect companion for staying hydrated, whether you're at work, on the go, or exploring the great outdoors. Designed with functionality and durability in mind, these tumblers are built to keep your drinks at the perfect temperature all day long.\\n> \\n> - **\\\"Built for Adventure\\\"**: The Stanley Tumbler features rugged construction, making it ideal for outdoor enthusiasts and urban adventurers alike.\\n> - **\\\"Temperature Control at Its Best\\\"**: With double-wall vacuum insulation, the Stanley Tumbler keeps drinks hot for up to 7 hours or cold for up to 11 hours.\\n> - **\\\"Leakproof and Spillproof\\\"**: Designed for ease of use, these tumblers are 100% leakproof, ensuring your drink stays exactly where it belongs.\\n> - **\\\"Eco-Friendly and Sustainable\\\"**: Made with 18/8 stainless steel, Stanley Tumblers are BPA-free and built to last, reducing waste from disposable cups.\\n> \\n> In summary, the Stanley Tumbler Collection combines durability, functionality, and style. Whether you're sipping coffee during your morning commute or staying hydrated during a hike, Stanley Tumblers are designed to meet your needs. Choose Stanley and enjoy unmatched quality and performance.\\n> ", - "files": [] - }, - "channels": [ - { - "category_codes": [ - "others" - ], - "code": "samchon" + ] } ], - "opened_at": "2024-07-10T12:00:00.000Z", - "tags": [] + "closed_at": "2024-07-30T12:00:00.000Z" } \ No newline at end of file diff --git a/examples/function-calling/schemas/chatgpt.sale.schema.json b/examples/function-calling/schemas/chatgpt.sale.schema.json index 022285c..6d339e8 100644 --- a/examples/function-calling/schemas/chatgpt.sale.schema.json +++ b/examples/function-calling/schemas/chatgpt.sale.schema.json @@ -326,23 +326,23 @@ "description": "Representative name of the unit.", "type": "string" }, - "required": { - "title": "Whether the unit is required or not", - "description": "Whether the unit is required or not.\n\nWhen the unit is required, the customer must select the unit. If do not\nselect, customer can't buy it.\n\nFor example, if there's a sale \"Macbook Set\" and one of the unit is the\n\"Main Body\", is it possible to buy the \"Macbook Set\" without the\n\"Main Body\" unit? This property is for that case.", - "type": "boolean" - }, "primary": { "title": "Whether the unit is primary or not", "description": "Whether the unit is primary or not.\n\nJust a labeling value.", "type": "boolean" + }, + "required": { + "title": "Whether the unit is required or not", + "description": "Whether the unit is required or not.\n\nWhen the unit is required, the customer must select the unit. If do not\nselect, customer can't buy it.\n\nFor example, if there's a sale \"Macbook Set\" and one of the unit is the\n\"Main Body\", is it possible to buy the \"Macbook Set\" without the\n\"Main Body\" unit? This property is for that case.", + "type": "boolean" } }, "required": [ "options", "stocks", "name", - "required", - "primary" + "primary", + "required" ], "additionalProperties": false } diff --git a/examples/function-calling/schemas/chatgpt.tags.schema.json b/examples/function-calling/schemas/chatgpt.tags.schema.json index ff21ee2..707fa75 100644 --- a/examples/function-calling/schemas/chatgpt.tags.schema.json +++ b/examples/function-calling/schemas/chatgpt.tags.schema.json @@ -2,23 +2,14 @@ "type": "object", "properties": { "input": { - "$ref": "#/$defs/OpeningTime" - } - }, - "required": [ - "input" - ], - "additionalProperties": false, - "$defs": { - "OpeningTime": { "type": "object", "properties": { "reasons": { + "description": "@minItems 1", "type": "array", "items": { "type": "string" - }, - "minItems": 1 + } }, "temporary": { "type": "boolean" @@ -30,7 +21,7 @@ }, { "type": "string", - "format": "date-time" + "description": "@format date-time" } ] } @@ -42,5 +33,10 @@ ], "additionalProperties": false } - } + }, + "required": [ + "input" + ], + "additionalProperties": false, + "$defs": {} } \ No newline at end of file diff --git a/examples/function-calling/schemas/claude.example.schema.json b/examples/function-calling/schemas/claude.example.schema.json new file mode 100644 index 0000000..0d2320d --- /dev/null +++ b/examples/function-calling/schemas/claude.example.schema.json @@ -0,0 +1,32 @@ +{ + "type": "object", + "properties": { + "input": { + "$ref": "#/$defs/IPerson" + } + }, + "required": [ + "input" + ], + "additionalProperties": false, + "$defs": { + "IPerson": { + "type": "object", + "properties": { + "name": { + "example": "John Doe", + "type": "string" + }, + "age": { + "example": 42, + "type": "number" + } + }, + "required": [ + "name", + "age" + ], + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/examples/function-calling/schemas/claude.recursive.schema.json b/examples/function-calling/schemas/claude.recursive.schema.json new file mode 100644 index 0000000..81a109f --- /dev/null +++ b/examples/function-calling/schemas/claude.recursive.schema.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "input": { + "type": "array", + "items": { + "$ref": "#/$defs/IShoppingCategory" + } + } + }, + "required": [ + "input" + ], + "additionalProperties": false, + "$defs": { + "IShoppingCategory": { + "type": "object", + "properties": { + "code": { + "title": "Identifier code of the category", + "description": "Identifier code of the category.", + "type": "string", + "pattern": "^[a-z0-9_]+$" + }, + "name": { + "title": "Name of the category", + "description": "Name of the category.", + "type": "string" + }, + "children": { + "title": "Children categories belong to this category", + "description": "Children categories belong to this category.", + "type": "array", + "items": { + "$ref": "#/$defs/IShoppingCategory" + } + } + }, + "required": [ + "code", + "name", + "children" + ], + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/examples/function-calling/schemas/claude.sale.schema.json b/examples/function-calling/schemas/claude.sale.schema.json index 4cb00b8..a67e505 100644 --- a/examples/function-calling/schemas/claude.sale.schema.json +++ b/examples/function-calling/schemas/claude.sale.schema.json @@ -2,16 +2,7 @@ "type": "object", "properties": { "input": { - "$ref": "#/$defs/IShoppingSale.ICreate" - } - }, - "required": [ - "input" - ], - "additionalProperties": false, - "$defs": { - "IShoppingSale.ICreate": { - "description": "Creation information of sale.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSale} type:\n\n> Seller sales products.\n> \n> `IShoppingSale` is an entity that embodies \"product sales\" (sales)\n> information registered by the {@link ISoppingSeller seller}. And the main\n> information of the sale is recorded in the sub {@link IShoppingSaleSnapshot},\n> not in the main `IShoppingSale`. When a seller changes a previously registered\n> item, the existing `IShoppingSale` record is not changed, but a new\n> {@link IShoppingSaleSnapshot snapshot} record be created.\n> \n> This is to preserve the {@link IShoppingCustomer customer}'s\n> {@link IShoppingOrder purchase history} flawlessly after the customer\n> purchases a specific item, even if the seller changes the components or\n> price of the item. It is also intended to support sellers in so-called A/B\n> testing, which involves changing components or prices and measuring the\n> performance in each case.", + "description": "Creation information of sale.\n\n------------------------------\n\nDescription of the current {@link IShoppingSale.ICreate} type:\n\n> Creation information of sale.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSale} type:\n\n> Seller sales products.\n> \n> `IShoppingSale` is an entity that embodies \"product sales\" (sales)\n> information registered by the {@link ISoppingSeller seller}. And the main\n> information of the sale is recorded in the sub {@link IShoppingSaleSnapshot},\n> not in the main `IShoppingSale`. When a seller changes a previously registered\n> item, the existing `IShoppingSale` record is not changed, but a new\n> {@link IShoppingSaleSnapshot snapshot} record be created.\n> \n> This is to preserve the {@link IShoppingCustomer customer}'s\n> {@link IShoppingOrder purchase history} flawlessly after the customer\n> purchases a specific item, even if the seller changes the components or\n> price of the item. It is also intended to support sellers in so-called A/B\n> testing, which involves changing components or prices and measuring the\n> performance in each case.", "type": "object", "properties": { "section_code": { @@ -59,14 +50,149 @@ ] }, "content": { - "$ref": "#/$defs/IShoppingSaleContent.ICreate" + "title": "Description and image content describing the sale", + "description": "Description of the current {@link IShoppingSaleContent} type:\n\n> Content information of sale snapshot.\n> \n> `IShoppingSaleContent` is an entity embodies the description contents\n> of {@link IShoppingSale}.", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "format": { + "description": "Description of the current {@link IShoppingSaleContent} type:\n\n> Content information of sale snapshot.\n> \n> `IShoppingSaleContent` is an entity embodies the description contents\n> of {@link IShoppingSale}.", + "oneOf": [ + { + "const": "html" + }, + { + "const": "md" + }, + { + "const": "txt" + } + ] + }, + "body": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "description": "Description of the current {@link IAttachmentFile} type:\n\n> Attachment File.\n> \n> Every attachment files that are managed in current system.\n> \n> For reference, it is possible to omit one of file {@link name}\n> or {@link extension} like `.gitignore` or `README` case, but not\n> possible to omit both of them.", + "type": "object", + "properties": { + "name": { + "title": "File name, except extension", + "description": "File name, except extension.\n\nIf there's file `.gitignore`, then its name is an empty string.", + "type": "string", + "maxLength": 255 + }, + "extension": { + "title": "Extension", + "description": "Extension.\n\nPossible to omit like `README` case.", + "oneOf": [ + { + "type": "null" + }, + { + "type": "string", + "minLength": 1, + "maxLength": 8 + } + ] + }, + "url": { + "title": "URL path of the real file", + "description": "URL path of the real file.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "name", + "extension", + "url" + ], + "additionalProperties": false + } + }, + "thumbnails": { + "type": "array", + "items": { + "description": "Description of the current {@link IAttachmentFile} type:\n\n> Attachment File.\n> \n> Every attachment files that are managed in current system.\n> \n> For reference, it is possible to omit one of file {@link name}\n> or {@link extension} like `.gitignore` or `README` case, but not\n> possible to omit both of them.", + "type": "object", + "properties": { + "name": { + "title": "File name, except extension", + "description": "File name, except extension.\n\nIf there's file `.gitignore`, then its name is an empty string.", + "type": "string", + "maxLength": 255 + }, + "extension": { + "title": "Extension", + "description": "Extension.\n\nPossible to omit like `README` case.", + "oneOf": [ + { + "type": "null" + }, + { + "type": "string", + "minLength": 1, + "maxLength": 8 + } + ] + }, + "url": { + "title": "URL path of the real file", + "description": "URL path of the real file.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "name", + "extension", + "url" + ], + "additionalProperties": false + } + } + }, + "required": [ + "title", + "format", + "body", + "files", + "thumbnails" + ], + "additionalProperties": false }, "channels": { "title": "List of channels and categories", "description": "List of channels and categories.\n\nWhich channels and categories the sale is registered to.", "type": "array", "items": { - "$ref": "#/$defs/IShoppingSaleChannel.ICreate" + "description": "Creation information of the target channel (and categories) of sale to sell.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleChannel.ICreate} type:\n\n> Creation information of the target channel (and categories) of sale to sell.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleChannel} type:\n\n> Target channel (and categories) of sale to sell.\n> \n> `IShoppingSaleChannel` is an entity that expresses through which\n> {@link IShoppingChannel channel} a listing {@link IShoppingSale} is sold.\n> \n> Also, if {@link IShoppingChannelCategory categories} are specified, it also\n> means that the sale be sold. Otherwise, none of the categories of the channel\n> being specified, it means that every categories of the channel is listing the\n> target sale.", + "type": "object", + "properties": { + "code": { + "title": "Target channel's {@link IShoppingChannel.code}", + "description": "Target channel's {@link IShoppingChannel.code}.", + "type": "string" + }, + "category_codes": { + "title": "List of target categories' {@link IShoppingChannelCategory.code}s", + "description": "List of target categories' {@link IShoppingChannelCategory.code}s.\n\nIf empty, it means all categories of the channel is listing the sale.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "code", + "category_codes" + ], + "additionalProperties": false }, "minItems": 1 }, @@ -75,7 +201,165 @@ "description": "List of units.\n\nRecords about individual product composition informations that are sold\nin the sale. Each {@link IShoppingSaleUnit unit} record has configurable\n{@link IShoppingSaleUnitOption options},\n{@link IShoppingSaleUnitOptionCandidate candidate} values for each\noption, and {@link IShoppingSaleUnitStock final stocks} determined by\nselecting every candidate values of each option.", "type": "array", "items": { - "$ref": "#/$defs/IShoppingSaleUnit.ICreate" + "description": "Creation information of sale unit.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnit.ICreate} type:\n\n> Creation information of sale unit.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnit} type:\n\n> Product composition information handled in the sale.\n> \n> `IShoppingSaleUnit` is an entity that embodies the \"individual product\"\n> information handled in the {@link IShoppingSale sale}.\n> \n> For reference, the reason why `IShoppingSaleUnit` is separated from\n> {@link IShoppingSaleSnapshot} by an algebraic relationship of 1: N is because\n> there are some cases where multiple products are sold in one listing. This is\n> the case with so-called \"bundled products\".\n> \n> - Bundle from regular product (Mackbook Set)\n> - Main Body\n> - Keyboard\n> - Mouse\n> - Apple Care (Free A/S Voucher)\n> \n> And again, `IShoppingSaleUnit` does not in itself refer to the\n> {@link IShoppingSaleUnitStock final stock} that the\n> {@link IShoppingCustomer customer} will {@link IShoppingOrder purchase}.\n> The final stock can be found only after selecting all given\n> {@link IShoppingSaleUnitOption options} and their\n> {@link IShoppingSaleUnitOptionCandidate candidate values}.\n> \n> For example, even if you buy a Macbook, the final stocks are determined only\n> after selecting all the options (CPU / RAM / SSD), etc.", + "type": "object", + "properties": { + "options": { + "title": "List of options", + "description": "List of options.", + "type": "array", + "items": { + "description": "Creation information of the selectable option.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitSelectableOption.ICreate} type:\n\n> Creation information of the selectable option.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitSelectableOption} type:\n\n> Individual option information on units for sale.\n> \n> `IShoppingSaleUnitSelectableOption` is a subsidiary entity of\n> {@link IShoppingSaleUnit} that represents individual products in the\n> {@link IShoppingSale sale}, and is an entity designed to represent individual\n> selectable option information for the unit.\n> \n> - Examples of Options\n> - selectable options\n> - Computer: CPU, RAM, SSD, etc.\n> - Clothes: size, color, style, etc.\n> - descriptive options\n> - Engrave\n> - Simple question\n> \n> If the {@link variable} property value is `true`, the final stock that the\n> {@link IShoppingCustomer customer} will purchase changes depending on the\n> selection of the {@link IShoppingSaleUnitOptionCandidate candidate value}.\n> \n> Conversely, if it is a type other than \"select\", or if the {@link variable}\n> property value is \"false\", , this is an option that has no meaning beyond\n> simple information transfer. Therefore, no matter what value the customer\n> chooses when purchasing it, the option in this case does not affect the\n> {@link IShoppingSaleUnitStock final stock}.", + "type": "object", + "properties": { + "type": { + "title": "Discriminant for the type of selectable option", + "description": "Discriminant for the type of selectable option.", + "const": "select" + }, + "name": { + "title": "Represents the name of the option", + "description": "Represents the name of the option.", + "type": "string" + }, + "variable": { + "title": "Whether the option is variable or not", + "description": "Whether the option is variable or not.\n\nWhen type of current option is \"select\", this attribute means whether\nselecting different candidate value affects the final stock or not.", + "type": "boolean" + }, + "candidates": { + "title": "List of candidate values", + "description": "List of candidate values.", + "type": "array", + "items": { + "description": "Creation information of the candidate value.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitOptionCandidate.ICreate} type:\n\n> Creation information of the candidate value.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitOptionCandidate} type:\n\n> Selectable candidate values within an option.\n> \n> `IShoppingSaleUnitOptionCandidate` is an entity that represents individual\n> candidate values that can be selected from\n> {@link IShoppingSaleUnitSelectableOption options of the \"select\" type}.\n> \n> - Example\n> - RAM: 8GB, 16GB, 32GB\n> - GPU: RTX 3060, RTX 4080, TESLA\n> - License: Private, Commercial, Educatiion\n> \n> By the way, if belonged option is not \"select\" type, this entity never\n> being used.", + "type": "object", + "properties": { + "name": { + "title": "Represents the name of the candidate value", + "description": "Represents the name of the candidate value.", + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "minItems": 1 + } + }, + "required": [ + "type", + "name", + "variable", + "candidates" + ], + "additionalProperties": false + } + }, + "stocks": { + "title": "List of final stocks", + "description": "List of final stocks.", + "type": "array", + "items": { + "description": "Creation information of the stock.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitStock.ICreate} type:\n\n> Creation information of the stock.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitStock} type:\n\n> Final component information on units for sale.\n> \n> `IShoppingSaleUnitStock` is a subsidiary entity of {@link IShoppingSaleUnit}\n> that represents a product catalog for sale, and is a kind of final stock that is\n> constructed by selecting all {@link IShoppingSaleUnitSelectableOption options}\n> (variable \"select\" type) and their\n> {@link IShoppingSaleUnitOptionCandidate candidate} values in the belonging unit.\n> It is the \"good\" itself that customers actually purchase.\n> \n> - Product Name) MacBook\n> - Options\n> - CPU: { i3, i5, i7, i9 }\n> - RAM: { 8GB, 16GB, 32GB, 64GB, 96GB }\n> - SSD: { 256GB, 512GB, 1TB }\n> - Number of final stocks: 4 * 5 * 3 = 60\n> \n> For reference, the total number of `IShoppingSaleUnitStock` records in an\n> attribution unit can be obtained using Cartesian Product. In other words, the\n> value obtained by multiplying all the candidate values that each\n> (variable \"select\" type) option can have by the number of cases is the total\n> number of final stocks in the unit.\n> \n> Of course, without a single variable \"select\" type option, the final stocks\n> count in the unit is only 1.", + "type": "object", + "properties": { + "name": { + "title": "Representative name of the stock", + "description": "Representative name of the stock.", + "type": "string" + }, + "price": { + "title": "Price of the stock", + "description": "Shopping price interface.", + "type": "object", + "properties": { + "nominal": { + "title": "Nominal price", + "description": "Nominal price.\n\nThis is not {@link real real price} to pay, but just a nominal price to show.\nIf this value is greater than the {@link real real price}, it would be shown\nlike {@link IShoppingSeller seller} is giving a discount.", + "type": "number", + "minimum": 0 + }, + "real": { + "title": "Real price to pay", + "description": "Real price to pay.", + "type": "number", + "minimum": 0 + } + }, + "required": [ + "nominal", + "real" + ], + "additionalProperties": false + }, + "quantity": { + "title": "Initial inventory quantity", + "description": "Initial inventory quantity.", + "type": "integer", + "minimum": 1 + }, + "choices": { + "title": "List of choices", + "description": "List of choices.\n\nWhich candidate values being chosen for each option.", + "type": "array", + "items": { + "description": "Creation information of stock choice.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitStockChoice.ICreate} type:\n\n> Creation information of stock choice.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitStockChoice} type:\n\n> Selection information of final stock.\n> \n> `IShoppingSaleUnitStockChoice` is an entity that represents which\n> {@link IShoppingSaleUnitSelectableOption option} of each variable \"select\"\n> type was selected for each {@link IShoppingSaleUnitStock stock} and which\n> {@link IShoppingSaleUnitOptionCandidate candidate value} was selected within\n> it.\n> \n> Of course, if the bound {@link IShoppingSaleUnit unit} does not have any\n> options, this entity can also be ignored.", + "type": "object", + "properties": { + "option_index": { + "description": "Target option's index number in\n{@link IShoppingSaleUnit.ICreate.options}.", + "type": "integer" + }, + "candidate_index": { + "description": "Target candidate's index number in\n{@link IShoppingSaleUnitSelectableOption.ICreate.candidates}.", + "type": "integer" + } + }, + "required": [ + "option_index", + "candidate_index" + ], + "additionalProperties": false + } + } + }, + "required": [ + "name", + "price", + "quantity", + "choices" + ], + "additionalProperties": false + }, + "minItems": 1 + }, + "name": { + "title": "Representative name of the unit", + "description": "Representative name of the unit.", + "type": "string" + }, + "primary": { + "title": "Whether the unit is primary or not", + "description": "Whether the unit is primary or not.\n\nJust a labeling value.", + "type": "boolean" + }, + "required": { + "title": "Whether the unit is required or not", + "description": "Whether the unit is required or not.\n\nWhen the unit is required, the customer must select the unit. If do not\nselect, customer can't buy it.\n\nFor example, if there's a sale \"Macbook Set\" and one of the unit is the\n\"Main Body\", is it possible to buy the \"Macbook Set\" without the\n\"Main Body\" unit? This property is for that case.", + "type": "boolean" + } + }, + "required": [ + "options", + "stocks", + "name", + "primary", + "required" + ], + "additionalProperties": false }, "minItems": 1 }, @@ -99,335 +383,11 @@ "tags" ], "additionalProperties": false - }, - "IShoppingSaleContent.ICreate": { - "description": "Description of the parent {@link IShoppingSaleContent} type:\n\n> Content information of sale snapshot.\n> \n> `IShoppingSaleContent` is an entity embodies the description contents\n> of {@link IShoppingSale}.", - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "format": { - "$ref": "#/$defs/IShoppingSaleContent.Type" - }, - "body": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/$defs/IAttachmentFile.ICreate" - } - }, - "thumbnails": { - "type": "array", - "items": { - "$ref": "#/$defs/IAttachmentFile.ICreate" - } - } - }, - "required": [ - "title", - "format", - "body", - "files", - "thumbnails" - ], - "additionalProperties": false - }, - "IShoppingSaleContent.Type": { - "description": "Description of the parent {@link IShoppingSaleContent} type:\n\n> Content information of sale snapshot.\n> \n> `IShoppingSaleContent` is an entity embodies the description contents\n> of {@link IShoppingSale}.", - "oneOf": [ - { - "const": "html" - }, - { - "const": "md" - }, - { - "const": "txt" - } - ] - }, - "IAttachmentFile.ICreate": { - "description": "Description of the parent {@link IAttachmentFile} type:\n\n> Attachment File.\n> \n> Every attachment files that are managed in current system.\n> \n> For reference, it is possible to omit one of file {@link name}\n> or {@link extension} like `.gitignore` or `README` case, but not\n> possible to omit both of them.", - "type": "object", - "properties": { - "name": { - "title": "File name, except extension", - "description": "File name, except extension.\n\nIf there's file `.gitignore`, then its name is an empty string.", - "type": "string", - "maxLength": 255 - }, - "extension": { - "title": "Extension", - "description": "Extension.\n\nPossible to omit like `README` case.", - "oneOf": [ - { - "type": "null" - }, - { - "type": "string", - "minLength": 1, - "maxLength": 8 - } - ] - }, - "url": { - "title": "URL path of the real file", - "description": "URL path of the real file.", - "type": "string", - "format": "uri" - } - }, - "required": [ - "name", - "extension", - "url" - ], - "additionalProperties": false - }, - "IShoppingSaleChannel.ICreate": { - "description": "Creation information of the target channel (and categories) of sale to sell.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleChannel} type:\n\n> Target channel (and categories) of sale to sell.\n> \n> `IShoppingSaleChannel` is an entity that expresses through which\n> {@link IShoppingChannel channel} a listing {@link IShoppingSale} is sold.\n> \n> Also, if {@link IShoppingChannelCategory categories} are specified, it also\n> means that the sale be sold. Otherwise, none of the categories of the channel\n> being specified, it means that every categories of the channel is listing the\n> target sale.", - "type": "object", - "properties": { - "code": { - "title": "Target channel's {@link IShoppingChannel.code}", - "description": "Target channel's {@link IShoppingChannel.code}.", - "type": "string" - }, - "category_codes": { - "title": "List of target categories' {@link IShoppingChannelCategory.code}s", - "description": "List of target categories' {@link IShoppingChannelCategory.code}s.\n\nIf empty, it means all categories of the channel is listing the sale.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "code", - "category_codes" - ], - "additionalProperties": false - }, - "IShoppingSaleUnit.ICreate": { - "description": "Creation information of sale unit.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnit} type:\n\n> Product composition information handled in the sale.\n> \n> `IShoppingSaleUnit` is an entity that embodies the \"individual product\"\n> information handled in the {@link IShoppingSale sale}.\n> \n> For reference, the reason why `IShoppingSaleUnit` is separated from\n> {@link IShoppingSaleSnapshot} by an algebraic relationship of 1: N is because\n> there are some cases where multiple products are sold in one listing. This is\n> the case with so-called \"bundled products\".\n> \n> - Bundle from regular product (Mackbook Set)\n> - Main Body\n> - Keyboard\n> - Mouse\n> - Apple Care (Free A/S Voucher)\n> \n> And again, `IShoppingSaleUnit` does not in itself refer to the\n> {@link IShoppingSaleUnitStock final stock} that the\n> {@link IShoppingCustomer customer} will {@link IShoppingOrder purchase}.\n> The final stock can be found only after selecting all given\n> {@link IShoppingSaleUnitOption options} and their\n> {@link IShoppingSaleUnitOptionCandidate candidate values}.\n> \n> For example, even if you buy a Macbook, the final stocks are determined only\n> after selecting all the options (CPU / RAM / SSD), etc.", - "type": "object", - "properties": { - "options": { - "title": "List of options", - "description": "List of options.", - "type": "array", - "items": { - "$ref": "#/$defs/IShoppingSaleUnitOption.ICreate" - } - }, - "stocks": { - "title": "List of final stocks", - "description": "List of final stocks.", - "type": "array", - "items": { - "$ref": "#/$defs/IShoppingSaleUnitStock.ICreate" - }, - "minItems": 1 - }, - "name": { - "title": "Representative name of the unit", - "description": "Representative name of the unit.", - "type": "string" - }, - "primary": { - "title": "Whether the unit is primary or not", - "description": "Whether the unit is primary or not.\n\nJust a labeling value.", - "type": "boolean" - }, - "required": { - "title": "Whether the unit is required or not", - "description": "Whether the unit is required or not.\n\nWhen the unit is required, the customer must select the unit. If do not\nselect, customer can't buy it.\n\nFor example, if there's a sale \"Macbook Set\" and one of the unit is the\n\"Main Body\", is it possible to buy the \"Macbook Set\" without the\n\"Main Body\" unit? This property is for that case.", - "type": "boolean" - } - }, - "required": [ - "options", - "stocks", - "name", - "primary", - "required" - ], - "additionalProperties": false - }, - "IShoppingSaleUnitOption.ICreate": { - "title": "Creation information of the option", - "description": "Creation information of the option.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitOption} type:\n\n> Individual option information on units for sale.\n> \n> `IShoppingSaleUnitOption` is a subsidiary entity of\n> {@link IShoppingSaleUnit} that represents individual products in the\n> {@link IShoppingSale sale}, and is an entity designed to represent individual\n> option information for the unit.\n> \n> Also, `IShoppingSaleUnitOption` is an union type of two entities,\n> {@link IShoppingSaleUnitSelectableOption} and\n> {@link IShoppingSaleUnitDescriptiveOption}. To specify the detailed type of\n> them, just use the `if` statement to the {@link type} property like below:\n> \n> ```typescript\n> if (option.type === \"select\")\n> option.candidates; // IShoppingSaleUnitSelectableOption\n> ```\n> \n> - Examples of Options\n> - selectable options\n> - Computer: CPU, RAM, SSD, etc.\n> - Clothes: size, color, style, etc.\n> - descriptive options\n> - Engrave\n> - Simple question\n> \n> If the type of option is a variable value in \"select\", the final stock that the\n> {@link IShoppingCustomer customer} will purchase changes depending on the\n> selection of the {@link IShoppingSaleUnitOptionCandidate candidate value}.\n> \n> Conversely, if it is a type other than \"select\", or if the type is \"select\" but\n> variable is false, this is an option that has no meaning beyond simple information\n> transfer. Therefore, no matter what value the customer enters and chooses when\n> purchasing it, the option in this case does not affect the\n> {@link IShoppingSaleUnitStock final stock}.", - "oneOf": [ - { - "$ref": "#/$defs/IShoppingSaleUnitSelectableOption.ICreate" - }, - { - "$ref": "#/$defs/IShoppingSaleUnitDescriptiveOption.ICreate" - } - ] - }, - "IShoppingSaleUnitSelectableOption.ICreate": { - "description": "Creation information of the selectable option.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitSelectableOption} type:\n\n> Individual option information on units for sale.\n> \n> `IShoppingSaleUnitSelectableOption` is a subsidiary entity of\n> {@link IShoppingSaleUnit} that represents individual products in the\n> {@link IShoppingSale sale}, and is an entity designed to represent individual\n> selectable option information for the unit.\n> \n> - Examples of Options\n> - selectable options\n> - Computer: CPU, RAM, SSD, etc.\n> - Clothes: size, color, style, etc.\n> - descriptive options\n> - Engrave\n> - Simple question\n> \n> If the {@link variable} property value is `true`, the final stock that the\n> {@link IShoppingCustomer customer} will purchase changes depending on the\n> selection of the {@link IShoppingSaleUnitOptionCandidate candidate value}.\n> \n> Conversely, if it is a type other than \"select\", or if the {@link variable}\n> property value is \"false\", , this is an option that has no meaning beyond\n> simple information transfer. Therefore, no matter what value the customer\n> chooses when purchasing it, the option in this case does not affect the\n> {@link IShoppingSaleUnitStock final stock}.", - "type": "object", - "properties": { - "type": { - "title": "Discriminant for the type of selectable option", - "description": "Discriminant for the type of selectable option.", - "const": "select" - }, - "name": { - "title": "Represents the name of the option", - "description": "Represents the name of the option.", - "type": "string" - }, - "variable": { - "title": "Whether the option is variable or not", - "description": "Whether the option is variable or not.\n\nWhen type of current option is \"select\", this attribute means whether\nselecting different candidate value affects the final stock or not.", - "type": "boolean" - }, - "candidates": { - "title": "List of candidate values", - "description": "List of candidate values.", - "type": "array", - "items": { - "$ref": "#/$defs/IShoppingSaleUnitOptionCandidate.ICreate" - }, - "minItems": 1 - } - }, - "required": [ - "type", - "name", - "variable", - "candidates" - ], - "additionalProperties": false - }, - "IShoppingSaleUnitOptionCandidate.ICreate": { - "description": "Creation information of the candidate value.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitOptionCandidate} type:\n\n> Selectable candidate values within an option.\n> \n> `IShoppingSaleUnitOptionCandidate` is an entity that represents individual\n> candidate values that can be selected from\n> {@link IShoppingSaleUnitSelectableOption options of the \"select\" type}.\n> \n> - Example\n> - RAM: 8GB, 16GB, 32GB\n> - GPU: RTX 3060, RTX 4080, TESLA\n> - License: Private, Commercial, Educatiion\n> \n> By the way, if belonged option is not \"select\" type, this entity never\n> being used.", - "type": "object", - "properties": { - "name": { - "title": "Represents the name of the candidate value", - "description": "Represents the name of the candidate value.", - "type": "string" - } - }, - "required": [ - "name" - ], - "additionalProperties": false - }, - "IShoppingSaleUnitDescriptiveOption.ICreate": { - "description": "Creation information of the descriptive option.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitDescriptiveOption} type:\n\n> Descriptive option.\n> \n> When type of the option not `\"select\"`, it means the option is descriptive\n> that requiring {@link IShoppingCustomer customers} to write some value to\n> {@link IShoppingOrder purchase}. Also, whatever customer writes about the\n> option, it does not affect the {@link IShoppingSaleUnitStock final stock}.\n> \n> Another words, the descriptive option is just for information transfer.", - "type": "object", - "properties": { - "type": { - "title": "Type of descriptive option", - "description": "Type of descriptive option.\n\nWhich typed value should be written when purchasing.", - "oneOf": [ - { - "const": "string" - }, - { - "const": "number" - }, - { - "const": "boolean" - } - ] - }, - "name": { - "title": "Readable name of the option", - "description": "Readable name of the option.", - "type": "string" - } - }, - "required": [ - "type", - "name" - ], - "additionalProperties": false - }, - "IShoppingSaleUnitStock.ICreate": { - "description": "Creation information of the stock.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitStock} type:\n\n> Final component information on units for sale.\n> \n> `IShoppingSaleUnitStock` is a subsidiary entity of {@link IShoppingSaleUnit}\n> that represents a product catalog for sale, and is a kind of final stock that is\n> constructed by selecting all {@link IShoppingSaleUnitSelectableOption options}\n> (variable \"select\" type) and their\n> {@link IShoppingSaleUnitOptionCandidate candidate} values in the belonging unit.\n> It is the \"good\" itself that customers actually purchase.\n> \n> - Product Name) MacBook\n> - Options\n> - CPU: { i3, i5, i7, i9 }\n> - RAM: { 8GB, 16GB, 32GB, 64GB, 96GB }\n> - SSD: { 256GB, 512GB, 1TB }\n> - Number of final stocks: 4 * 5 * 3 = 60\n> \n> For reference, the total number of `IShoppingSaleUnitStock` records in an\n> attribution unit can be obtained using Cartesian Product. In other words, the\n> value obtained by multiplying all the candidate values that each\n> (variable \"select\" type) option can have by the number of cases is the total\n> number of final stocks in the unit.\n> \n> Of course, without a single variable \"select\" type option, the final stocks\n> count in the unit is only 1.", - "type": "object", - "properties": { - "name": { - "title": "Representative name of the stock", - "description": "Representative name of the stock.", - "type": "string" - }, - "price": { - "$ref": "#/$defs/IShoppingPrice" - }, - "quantity": { - "title": "Initial inventory quantity", - "description": "Initial inventory quantity.", - "type": "integer", - "minimum": 1 - }, - "choices": { - "title": "List of choices", - "description": "List of choices.\n\nWhich candidate values being chosen for each option.", - "type": "array", - "items": { - "$ref": "#/$defs/IShoppingSaleUnitStockChoice.ICreate" - } - } - }, - "required": [ - "name", - "price", - "quantity", - "choices" - ], - "additionalProperties": false - }, - "IShoppingPrice": { - "description": "Shopping price interface.", - "type": "object", - "properties": { - "nominal": { - "title": "Nominal price", - "description": "Nominal price.\n\nThis is not {@link real real price} to pay, but just a nominal price to show.\nIf this value is greater than the {@link real real price}, it would be shown\nlike {@link IShoppingSeller seller} is giving a discount.", - "type": "number", - "minimum": 0 - }, - "real": { - "title": "Real price to pay", - "description": "Real price to pay.", - "type": "number", - "minimum": 0 - } - }, - "required": [ - "nominal", - "real" - ], - "additionalProperties": false - }, - "IShoppingSaleUnitStockChoice.ICreate": { - "description": "Creation information of stock choice.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitStockChoice} type:\n\n> Selection information of final stock.\n> \n> `IShoppingSaleUnitStockChoice` is an entity that represents which\n> {@link IShoppingSaleUnitSelectableOption option} of each variable \"select\"\n> type was selected for each {@link IShoppingSaleUnitStock stock} and which\n> {@link IShoppingSaleUnitOptionCandidate candidate value} was selected within\n> it.\n> \n> Of course, if the bound {@link IShoppingSaleUnit unit} does not have any\n> options, this entity can also be ignored.", - "type": "object", - "properties": { - "option_index": { - "description": "Target option's index number in\n{@link IShoppingSaleUnit.ICreate.options}.", - "type": "integer" - }, - "candidate_index": { - "description": "Target candidate's index number in\n{@link IShoppingSaleUnitSelectableOption.ICreate.candidates}.", - "type": "integer" - } - }, - "required": [ - "option_index", - "candidate_index" - ], - "additionalProperties": false } - } + }, + "required": [ + "input" + ], + "additionalProperties": false, + "$defs": {} } \ No newline at end of file diff --git a/examples/function-calling/schemas/claude.tags.schema.json b/examples/function-calling/schemas/claude.tags.schema.json new file mode 100644 index 0000000..7d8e773 --- /dev/null +++ b/examples/function-calling/schemas/claude.tags.schema.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "input": { + "$ref": "#/$defs/OpeningTime" + } + }, + "required": [ + "input" + ], + "additionalProperties": false, + "$defs": { + "OpeningTime": { + "type": "object", + "properties": { + "reasons": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "temporary": { + "type": "boolean" + }, + "time": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string", + "format": "date-time" + } + ] + } + }, + "required": [ + "reasons", + "temporary", + "time" + ], + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/examples/function-calling/schemas/gemini.sale.schema.json b/examples/function-calling/schemas/gemini.sale.schema.json index 92563da..339ce3f 100644 --- a/examples/function-calling/schemas/gemini.sale.schema.json +++ b/examples/function-calling/schemas/gemini.sale.schema.json @@ -36,7 +36,8 @@ "html", "md", "txt" - ] + ], + "description": "Description of the current {@link IShoppingSaleContent} type:\n\n> Content information of sale snapshot.\n> \n> `IShoppingSaleContent` is an entity embodies the description contents\n> of {@link IShoppingSale}." }, "body": { "type": "string" @@ -64,7 +65,8 @@ "name", "extension", "url" - ] + ], + "description": "Description of the current {@link IAttachmentFile} type:\n\n> Attachment File.\n> \n> Every attachment files that are managed in current system.\n> \n> For reference, it is possible to omit one of file {@link name}\n> or {@link extension} like `.gitignore` or `README` case, but not\n> possible to omit both of them." } }, "thumbnails": { @@ -90,7 +92,8 @@ "name", "extension", "url" - ] + ], + "description": "Description of the current {@link IAttachmentFile} type:\n\n> Attachment File.\n> \n> Every attachment files that are managed in current system.\n> \n> For reference, it is possible to omit one of file {@link name}\n> or {@link extension} like `.gitignore` or `README` case, but not\n> possible to omit both of them." } } }, @@ -100,7 +103,8 @@ "body", "files", "thumbnails" - ] + ], + "description": "Description of the current {@link IShoppingSaleContent} type:\n\n> Content information of sale snapshot.\n> \n> `IShoppingSaleContent` is an entity embodies the description contents\n> of {@link IShoppingSale}." }, "channels": { "type": "array", @@ -123,7 +127,7 @@ "code", "category_codes" ], - "description": "Creation information of the target channel (and categories) of sale to sell.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleChannel.ICreate} type:\n\n> Creation information of the target channel (and categories) of sale to sell." + "description": "Creation information of the target channel (and categories) of sale to sell.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleChannel.ICreate} type:\n\n> Creation information of the target channel (and categories) of sale to sell.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleChannel} type:\n\n> Target channel (and categories) of sale to sell.\n> \n> `IShoppingSaleChannel` is an entity that expresses through which\n> {@link IShoppingChannel channel} a listing {@link IShoppingSale} is sold.\n> \n> Also, if {@link IShoppingChannelCategory categories} are specified, it also\n> means that the sale be sold. Otherwise, none of the categories of the channel\n> being specified, it means that every categories of the channel is listing the\n> target sale." }, "description": "List of channels and categories.\n\nWhich channels and categories the sale is registered to.\n\n\n@minItems 1" }, @@ -165,7 +169,7 @@ "required": [ "name" ], - "description": "Creation information of the candidate value.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitOptionCandidate.ICreate} type:\n\n> Creation information of the candidate value." + "description": "Creation information of the candidate value.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitOptionCandidate.ICreate} type:\n\n> Creation information of the candidate value.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitOptionCandidate} type:\n\n> Selectable candidate values within an option.\n> \n> `IShoppingSaleUnitOptionCandidate` is an entity that represents individual\n> candidate values that can be selected from\n> {@link IShoppingSaleUnitSelectableOption options of the \"select\" type}.\n> \n> - Example\n> - RAM: 8GB, 16GB, 32GB\n> - GPU: RTX 3060, RTX 4080, TESLA\n> - License: Private, Commercial, Educatiion\n> \n> By the way, if belonged option is not \"select\" type, this entity never\n> being used." }, "description": "List of candidate values.\n\n\n@minItems 1" } @@ -176,7 +180,7 @@ "variable", "candidates" ], - "description": "Creation information of the selectable option.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitSelectableOption.ICreate} type:\n\n> Creation information of the selectable option." + "description": "Creation information of the selectable option.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitSelectableOption.ICreate} type:\n\n> Creation information of the selectable option.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitSelectableOption} type:\n\n> Individual option information on units for sale.\n> \n> `IShoppingSaleUnitSelectableOption` is a subsidiary entity of\n> {@link IShoppingSaleUnit} that represents individual products in the\n> {@link IShoppingSale sale}, and is an entity designed to represent individual\n> selectable option information for the unit.\n> \n> - Examples of Options\n> - selectable options\n> - Computer: CPU, RAM, SSD, etc.\n> - Clothes: size, color, style, etc.\n> - descriptive options\n> - Engrave\n> - Simple question\n> \n> If the {@link variable} property value is `true`, the final stock that the\n> {@link IShoppingCustomer customer} will purchase changes depending on the\n> selection of the {@link IShoppingSaleUnitOptionCandidate candidate value}.\n> \n> Conversely, if it is a type other than \"select\", or if the {@link variable}\n> property value is \"false\", , this is an option that has no meaning beyond\n> simple information transfer. Therefore, no matter what value the customer\n> chooses when purchasing it, the option in this case does not affect the\n> {@link IShoppingSaleUnitStock final stock}." }, "description": "List of options." }, @@ -229,7 +233,7 @@ "option_index", "candidate_index" ], - "description": "Creation information of stock choice.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitStockChoice.ICreate} type:\n\n> Creation information of stock choice." + "description": "Creation information of stock choice.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitStockChoice.ICreate} type:\n\n> Creation information of stock choice.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitStockChoice} type:\n\n> Selection information of final stock.\n> \n> `IShoppingSaleUnitStockChoice` is an entity that represents which\n> {@link IShoppingSaleUnitSelectableOption option} of each variable \"select\"\n> type was selected for each {@link IShoppingSaleUnitStock stock} and which\n> {@link IShoppingSaleUnitOptionCandidate candidate value} was selected within\n> it.\n> \n> Of course, if the bound {@link IShoppingSaleUnit unit} does not have any\n> options, this entity can also be ignored." }, "description": "List of choices.\n\nWhich candidate values being chosen for each option." } @@ -240,7 +244,7 @@ "quantity", "choices" ], - "description": "Creation information of the stock.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitStock.ICreate} type:\n\n> Creation information of the stock." + "description": "Creation information of the stock.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnitStock.ICreate} type:\n\n> Creation information of the stock.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnitStock} type:\n\n> Final component information on units for sale.\n> \n> `IShoppingSaleUnitStock` is a subsidiary entity of {@link IShoppingSaleUnit}\n> that represents a product catalog for sale, and is a kind of final stock that is\n> constructed by selecting all {@link IShoppingSaleUnitSelectableOption options}\n> (variable \"select\" type) and their\n> {@link IShoppingSaleUnitOptionCandidate candidate} values in the belonging unit.\n> It is the \"good\" itself that customers actually purchase.\n> \n> - Product Name) MacBook\n> - Options\n> - CPU: { i3, i5, i7, i9 }\n> - RAM: { 8GB, 16GB, 32GB, 64GB, 96GB }\n> - SSD: { 256GB, 512GB, 1TB }\n> - Number of final stocks: 4 * 5 * 3 = 60\n> \n> For reference, the total number of `IShoppingSaleUnitStock` records in an\n> attribution unit can be obtained using Cartesian Product. In other words, the\n> value obtained by multiplying all the candidate values that each\n> (variable \"select\" type) option can have by the number of cases is the total\n> number of final stocks in the unit.\n> \n> Of course, without a single variable \"select\" type option, the final stocks\n> count in the unit is only 1." }, "description": "List of final stocks.\n\n\n@minItems 1" }, @@ -248,23 +252,23 @@ "type": "string", "description": "Representative name of the unit." }, - "required": { - "type": "boolean", - "description": "Whether the unit is required or not.\n\nWhen the unit is required, the customer must select the unit. If do not\nselect, customer can't buy it.\n\nFor example, if there's a sale \"Macbook Set\" and one of the unit is the\n\"Main Body\", is it possible to buy the \"Macbook Set\" without the\n\"Main Body\" unit? This property is for that case." - }, "primary": { "type": "boolean", "description": "Whether the unit is primary or not.\n\nJust a labeling value." + }, + "required": { + "type": "boolean", + "description": "Whether the unit is required or not.\n\nWhen the unit is required, the customer must select the unit. If do not\nselect, customer can't buy it.\n\nFor example, if there's a sale \"Macbook Set\" and one of the unit is the\n\"Main Body\", is it possible to buy the \"Macbook Set\" without the\n\"Main Body\" unit? This property is for that case." } }, "required": [ "options", "stocks", "name", - "required", - "primary" + "primary", + "required" ], - "description": "Creation information of sale unit.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnit.ICreate} type:\n\n> Creation information of sale unit." + "description": "Creation information of sale unit.\n\n------------------------------\n\nDescription of the current {@link IShoppingSaleUnit.ICreate} type:\n\n> Creation information of sale unit.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSaleUnit} type:\n\n> Product composition information handled in the sale.\n> \n> `IShoppingSaleUnit` is an entity that embodies the \"individual product\"\n> information handled in the {@link IShoppingSale sale}.\n> \n> For reference, the reason why `IShoppingSaleUnit` is separated from\n> {@link IShoppingSaleSnapshot} by an algebraic relationship of 1: N is because\n> there are some cases where multiple products are sold in one listing. This is\n> the case with so-called \"bundled products\".\n> \n> - Bundle from regular product (Mackbook Set)\n> - Main Body\n> - Keyboard\n> - Mouse\n> - Apple Care (Free A/S Voucher)\n> \n> And again, `IShoppingSaleUnit` does not in itself refer to the\n> {@link IShoppingSaleUnitStock final stock} that the\n> {@link IShoppingCustomer customer} will {@link IShoppingOrder purchase}.\n> The final stock can be found only after selecting all given\n> {@link IShoppingSaleUnitOption options} and their\n> {@link IShoppingSaleUnitOptionCandidate candidate values}.\n> \n> For example, even if you buy a Macbook, the final stocks are determined only\n> after selecting all the options (CPU / RAM / SSD), etc." }, "description": "List of units.\n\nRecords about individual product composition informations that are sold\nin the sale. Each {@link IShoppingSaleUnit unit} record has configurable\n{@link IShoppingSaleUnitOption options},\n{@link IShoppingSaleUnitOptionCandidate candidate} values for each\noption, and {@link IShoppingSaleUnitStock final stocks} determined by\nselecting every candidate values of each option.\n\n\n@minItems 1" }, @@ -285,7 +289,7 @@ "units", "tags" ], - "description": "Creation information of sale.\n\n------------------------------\n\nDescription of the current {@link IShoppingSale.ICreate} type:\n\n> Creation information of sale." + "description": "Creation information of sale.\n\n------------------------------\n\nDescription of the current {@link IShoppingSale.ICreate} type:\n\n> Creation information of sale.\n\n------------------------------\n\nDescription of the parent {@link IShoppingSale} type:\n\n> Seller sales products.\n> \n> `IShoppingSale` is an entity that embodies \"product sales\" (sales)\n> information registered by the {@link ISoppingSeller seller}. And the main\n> information of the sale is recorded in the sub {@link IShoppingSaleSnapshot},\n> not in the main `IShoppingSale`. When a seller changes a previously registered\n> item, the existing `IShoppingSale` record is not changed, but a new\n> {@link IShoppingSaleSnapshot snapshot} record be created.\n> \n> This is to preserve the {@link IShoppingCustomer customer}'s\n> {@link IShoppingOrder purchase history} flawlessly after the customer\n> purchases a specific item, even if the seller changes the components or\n> price of the item. It is also intended to support sellers in so-called A/B\n> testing, which involves changing components or prices and measuring the\n> performance in each case." } }, "required": [ diff --git a/examples/function-calling/schemas/gemini.tags.schema.json b/examples/function-calling/schemas/gemini.tags.schema.json new file mode 100644 index 0000000..ce06cfa --- /dev/null +++ b/examples/function-calling/schemas/gemini.tags.schema.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "input": { + "type": "object", + "properties": { + "reasons": { + "type": "array", + "items": { + "type": "string" + }, + "description": "@minItems 1" + }, + "temporary": { + "type": "boolean" + }, + "time": { + "type": "string", + "nullable": true, + "description": "@format date-time" + } + }, + "required": [ + "reasons", + "temporary", + "time" + ] + } + }, + "required": [ + "input" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 346db31..d19415d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@samchon/openapi", - "version": "2.0.0-dev.20241124-2", + "version": "2.0.0-dev.20241125", "description": "OpenAPI definitions and converters for 'typia' and 'nestia'.", "main": "./lib/index.js", "module": "./lib/index.mjs", diff --git a/src/HttpLlm.ts b/src/HttpLlm.ts index 971c59e..59b0c48 100644 --- a/src/HttpLlm.ts +++ b/src/HttpLlm.ts @@ -88,7 +88,7 @@ export namespace HttpLlm { }): IHttpLlmApplication => { // MIGRATE const migrate: IHttpMigrateApplication = - (props.document as OpenApi.IDocument)["x-samchon-emend"] === true + (props.document as OpenApi.IDocument)["x-samchon-emended"] === true ? HttpMigration.application(props.document as OpenApi.IDocument) : (props.document as IHttpMigrateApplication); return HttpLlmConverter.application({ diff --git a/src/OpenApi.ts b/src/OpenApi.ts index 60bd263..5687b27 100644 --- a/src/OpenApi.ts +++ b/src/OpenApi.ts @@ -214,7 +214,7 @@ export namespace OpenApi { /** * Flag for indicating this document is emended by `@samchon/openapi`. */ - "x-samchon-emend": true; + "x-samchon-emended": true; } export namespace IDocument { /** diff --git a/src/converters/OpenApiV3Converter.ts b/src/converters/OpenApiV3Converter.ts index 8f9d323..decf592 100644 --- a/src/converters/OpenApiV3Converter.ts +++ b/src/converters/OpenApiV3Converter.ts @@ -16,7 +16,7 @@ export namespace OpenApiV3Converter { ) : undefined, openapi: "3.1.0", - "x-samchon-emend": true, + "x-samchon-emended": true, }); /* ----------------------------------------------------------- diff --git a/src/converters/OpenApiV3_1Converter.ts b/src/converters/OpenApiV3_1Converter.ts index 400a46a..1f7fe8d 100644 --- a/src/converters/OpenApiV3_1Converter.ts +++ b/src/converters/OpenApiV3_1Converter.ts @@ -3,7 +3,7 @@ import { OpenApiV3_1 } from "../OpenApiV3_1"; export namespace OpenApiV3_1Converter { export const convert = (input: OpenApiV3_1.IDocument): OpenApi.IDocument => { - if ((input as OpenApi.IDocument)["x-samchon-emend"] === true) + if ((input as OpenApi.IDocument)["x-samchon-emended"] === true) return input as OpenApi.IDocument; return { ...input, @@ -28,7 +28,7 @@ export namespace OpenApiV3_1Converter { .filter(([_, value]) => value !== undefined), ) : undefined, - "x-samchon-emend": true, + "x-samchon-emended": true, }; }; diff --git a/src/converters/SwaggerV2Converter.ts b/src/converters/SwaggerV2Converter.ts index ce8f5a0..5121fe3 100644 --- a/src/converters/SwaggerV2Converter.ts +++ b/src/converters/SwaggerV2Converter.ts @@ -25,7 +25,7 @@ export namespace SwaggerV2Converter { : undefined, security: input.security, tags: input.tags, - "x-samchon-emend": true, + "x-samchon-emended": true, }); /* ----------------------------------------------------------- diff --git a/src/structures/ILlmSchema.ts b/src/structures/ILlmSchema.ts index 4c068da..21e1920 100644 --- a/src/structures/ILlmSchema.ts +++ b/src/structures/ILlmSchema.ts @@ -1,4 +1,5 @@ import { IChatGptSchema } from "./IChatGptSchema"; +import { IClaudeSchema } from "./IClaudeSchema"; import { IGeminiSchema } from "./IGeminiSchema"; import { ILlmSchemaV3 } from "./ILlmSchemaV3"; import { ILlmSchemaV3_1 } from "./ILlmSchemaV3_1"; @@ -15,6 +16,7 @@ import { ILlmSchemaV3_1 } from "./ILlmSchemaV3_1"; */ export type ILlmSchema = | IChatGptSchema + | IClaudeSchema | IGeminiSchema | ILlmSchemaV3 | ILlmSchemaV3_1; @@ -22,12 +24,14 @@ export type ILlmSchema = export namespace ILlmSchema { export type IParameters = | IChatGptSchema.IParameters + | IClaudeSchema.IParameters | IGeminiSchema.IParameters | ILlmSchemaV3.IParameters | ILlmSchemaV3_1.IParameters; export type IConfig = | IChatGptSchema.IConfig + | IClaudeSchema.IConfig | IGeminiSchema.IConfig | ILlmSchemaV3.IConfig | ILlmSchemaV3_1.IConfig; diff --git a/test/examples/chatgpt-function-calling.ts b/test/examples/chatgpt-function-calling.ts index 30714c6..1b4e125 100644 --- a/test/examples/chatgpt-function-calling.ts +++ b/test/examples/chatgpt-function-calling.ts @@ -1,111 +1,40 @@ -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IChatGptSchema, OpenApi } from "@samchon/openapi"; -import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter"; import fs from "fs"; -import OpenAI from "openai"; -import { ChatCompletion } from "openai/resources"; -import typia, { IJsonSchemaCollection } from "typia"; +import typia from "typia"; import { TestGlobal } from "../TestGlobal"; -import { IShoppingSale } from "../structures/IShoppingSale"; +import { ChatGptFunctionCaller } from "../utils/ChatGptFunctionCaller"; +import { ShoppingSalePrompt } from "../utils/ShoppingSalePrompt"; +import { StopWatch } from "../utils/StopWatch"; const main = async (): Promise => { - if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingSale.ICreate }, IShoppingSale]>(); - const parameters: IChatGptSchema.IParameters | null = - ChatGptConverter.parameters({ - components: collection.components, - schema: typia.assert(collection.schemas[0]), - config: { - reference: process.argv.includes("--reference"), - constraint: process.argv.includes("--constraint"), - }, - }); - if (parameters === null) - throw new Error("Failed to convert the JSON schema to the ChatGPT schema."); - - const client: OpenAI = new OpenAI({ - apiKey: TestGlobal.env.CHATGPT_API_KEY, - }); - - const directory: string[] = await fs.promises.readdir( - `${TestGlobal.ROOT}/examples/function-calling/prompts`, - ); - for (const file of directory) { - if (file.endsWith(".md") === false) continue; - - const title: string = file.substring(0, file.length - 3); + for (const title of await ShoppingSalePrompt.documents()) { if ( process.argv.includes("--include") && process.argv.every((v) => title.includes(v) === false) ) continue; - console.log(title); - - const content: string = await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/${file}`, - "utf8", - ); try { - const completion: ChatCompletion = await client.chat.completions.create({ - model: "gpt-4o", - messages: [ - { - role: "system", - content, - }, - { - role: "assistant", - content: [ - "Here is the list of categories belonged to the samchon channel", - "", - "```json", - await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - "utf8", - ), - "```", - ].join("\n"), + await StopWatch.trace(title)(async () => + ChatGptFunctionCaller.test({ + config: { + constraint: process.argv.includes("--constraint"), + reference: process.argv.includes("--reference"), }, - { - role: "user", - content: await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/${file}`, + ...ShoppingSalePrompt.schema(), + texts: await ShoppingSalePrompt.texts(title), + handleCompletion: async (input) => { + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.${title}.input.json`, + JSON.stringify(input, null, 2), "utf8", - ), + ); }, - ], - tools: [ - { - type: "function", - function: { - name: "createSale", - description: - "Create a sale and returns the detailed information.", - parameters: parameters as any, - strict: true, - }, - }, - ], - }); - await ArrayUtil.asyncForEach( - completion.choices[0].message.tool_calls ?? [], - )(async (call) => { - TestValidator.equals("name")(call.function.name)("createSale"); - const { input } = typia.assert<{ - input: IShoppingSale.ICreate; - }>(JSON.parse(call.function.arguments)); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.sale.input.${title}.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }); + }), + ); } catch (error) { + console.log(title, " -> Error"); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.sale.error.${title}.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.${title}.error.json`, JSON.stringify(typia.is(error) ? { ...error } : error, null, 2), "utf8", ); diff --git a/test/examples/claude-function-calling.ts b/test/examples/claude-function-calling.ts index 2702e1e..0a70978 100644 --- a/test/examples/claude-function-calling.ts +++ b/test/examples/claude-function-calling.ts @@ -1,108 +1,40 @@ -import Anthropic from "@anthropic-ai/sdk"; -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { OpenApi } from "@samchon/openapi"; -import { LlmSchemaConverter } from "@samchon/openapi/lib/converters/LlmSchemaConverter"; -import { IClaudeSchema } from "@samchon/openapi/lib/structures/IClaudeSchema"; import fs from "fs"; -import typia, { IJsonSchemaCollection } from "typia"; +import typia from "typia"; import { TestGlobal } from "../TestGlobal"; -import { IShoppingSale } from "../structures/IShoppingSale"; +import { ClaudeFunctionCaller } from "../utils/ClaudeFunctionCaller"; +import { ShoppingSalePrompt } from "../utils/ShoppingSalePrompt"; +import { StopWatch } from "../utils/StopWatch"; const main = async (): Promise => { - if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingSale.ICreate }, IShoppingSale]>(); - const parameters: IClaudeSchema.IParameters | null = - LlmSchemaConverter.parameters("claude")({ - components: collection.components, - schema: typia.assert(collection.schemas[0]), - config: { - reference: true, - }, - }); - if (parameters === null) - throw new Error("Failed to convert the JSON schema to the ChatGPT schema."); - - const client: Anthropic = new Anthropic({ - apiKey: TestGlobal.env.CLAUDE_API_KEY, - }); - const directory: string[] = await fs.promises.readdir( - `${TestGlobal.ROOT}/examples/function-calling/prompts`, - ); - for (const file of directory) { - if (file.endsWith(".md") === false) continue; - - const title: string = file.substring(0, file.length - 3); + for (const title of await ShoppingSalePrompt.documents()) { if ( process.argv.includes("--include") && process.argv.every((v) => title.includes(v) === false) ) continue; - console.log(title); - - const content: string = await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/${file}`, - "utf8", - ); try { - const completion: Anthropic.Message = await client.messages.create({ - model: "claude-3-5-sonnet-latest", - max_tokens: 8_192, - messages: [ - { - role: "assistant", - content, - }, - { - role: "assistant", - content: [ - "Here is the list of categories belonged to the samchon channel", - "", - "```json", - await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - "utf8", - ), - "```", - ].join("\n"), + await StopWatch.trace(title)(async () => + ClaudeFunctionCaller.test({ + model: "claude", + config: { + reference: process.argv.includes("--reference"), }, - { - role: "user", - content: await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/${file}`, + ...ShoppingSalePrompt.schema(), + texts: await ShoppingSalePrompt.texts(title), + handleCompletion: async (input) => { + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.${title}.input.json`, + JSON.stringify(input, null, 2), "utf8", - ), - }, - ], - tools: [ - { - name: "createSale", - description: "Create a sale and returns the detailed information.", - input_schema: parameters as any, + ); }, - ], - }); - const toolCalls: Anthropic.ToolUseBlock[] = completion.content.filter( - (c) => c.type === "tool_use", + }), ); - if (toolCalls.length === 0) - throw new Error("LLM has not called any function."); - await ArrayUtil.asyncForEach(toolCalls)(async (call) => { - TestValidator.equals("name")(call.name)("createSale"); - const { input } = typia.assert<{ - input: IShoppingSale.ICreate; - }>(call.input); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.sale.input.${title}.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }); } catch (error) { + console.log(title, " -> Error"); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.sale.error.${title}.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.${title}.error.json`, JSON.stringify(typia.is(error) ? { ...error } : error, null, 2), "utf8", ); diff --git a/test/examples/gemini-function-calling.ts b/test/examples/gemini-function-calling.ts index 79f661f..76f75fe 100644 --- a/test/examples/gemini-function-calling.ts +++ b/test/examples/gemini-function-calling.ts @@ -1,130 +1,39 @@ -import { - FunctionCall, - FunctionCallingMode, - GenerateContentResult, - GenerativeModel, - GoogleGenerativeAI, -} from "@google/generative-ai"; -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IGeminiSchema, OpenApi } from "@samchon/openapi"; -import { GeminiConverter } from "@samchon/openapi/lib/converters/GeminiConverter"; import fs from "fs"; -import typia, { IJsonSchemaCollection } from "typia"; +import typia from "typia"; import { TestGlobal } from "../TestGlobal"; -import { IShoppingSale } from "../structures/IShoppingSale"; +import { GeminiFunctionCaller } from "../utils/GeminiFunctionCaller"; +import { ShoppingSalePrompt } from "../utils/ShoppingSalePrompt"; +import { StopWatch } from "../utils/StopWatch"; const main = async (): Promise => { - if (TestGlobal.env.GEMINI_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingSale.ICreate }, IShoppingSale]>(); - const parameters: IGeminiSchema.IParameters | null = - GeminiConverter.parameters({ - components: collection.components, - schema: typia.assert(collection.schemas[0]), - config: { - recursive: 3, - }, - }); - if (parameters === null) - throw new Error("Failed to convert the JSON schema to the Gemini schema."); - - const directory: string[] = await fs.promises.readdir( - `${TestGlobal.ROOT}/examples/function-calling/prompts`, - ); - for (const file of directory) { - if (file.endsWith(".md") === false) continue; - - const title: string = file.substring(0, file.length - 3); + for (const title of await ShoppingSalePrompt.documents()) { if ( process.argv.includes("--include") && process.argv.every((v) => title.includes(v) === false) ) continue; - console.log(title); - - const content: string = await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/${file}`, - "utf8", - ); - const model: GenerativeModel = new GoogleGenerativeAI( - TestGlobal.env.GEMINI_API_KEY, - ).getGenerativeModel({ - model: "gemini-1.5-pro", - }); try { - const result: GenerateContentResult = await model.generateContent({ - contents: [ - { - role: "model", - parts: [ - { - text: SYSTEM_MESSAGE, - }, - ], + await StopWatch.trace(title)(async () => + GeminiFunctionCaller.test({ + config: { + recursive: 3, }, - { - role: "model", - parts: [ - { - text: [ - "Here is the list of categories belonged to the samchon channel", - "", - "```json", - await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - "utf8", - ), - "```", - ].join("\n"), - }, - ], + ...ShoppingSalePrompt.schema(), + texts: await ShoppingSalePrompt.texts(title), + handleCompletion: async (input) => { + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.${title}.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); }, - { - role: "model", - parts: [ - { - text: content, - }, - ], - }, - ], - tools: [ - { - functionDeclarations: [ - { - name: "createSale", - description: - "Create a sale and returns the detailed information.", - parameters: parameters as any, - }, - ], - }, - ], - toolConfig: { - functionCallingConfig: { - mode: FunctionCallingMode.ANY, - allowedFunctionNames: ["createSale"], - }, - }, - }); - await ArrayUtil.asyncMap(result.response.functionCalls() ?? [])( - async (call: FunctionCall) => { - TestValidator.equals("name")(call.name)("createSale"); - const { input } = typia.assert<{ - input: IShoppingSale.ICreate; - }>(call.args); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.sale.input.${title}.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }, + }), ); } catch (error) { + console.log(title, " -> Error"); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.sale.error.${title}.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.${title}.error.json`, JSON.stringify(typia.is(error) ? { ...error } : error, null, 2), "utf8", ); @@ -135,6 +44,3 @@ main().catch((error) => { console.log(error); process.exit(-1); }); - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; diff --git a/test/features/llm/chatgpt/test_chatgpt_function_calling_example.ts b/test/features/llm/chatgpt/test_chatgpt_function_calling_example.ts new file mode 100644 index 0000000..0d7a2c1 --- /dev/null +++ b/test/features/llm/chatgpt/test_chatgpt_function_calling_example.ts @@ -0,0 +1,54 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { ChatGptFunctionCaller } from "../../../utils/ChatGptFunctionCaller"; + +export const test_chatgpt_function_calling_example = () => + ChatGptFunctionCaller.test({ + config: { + constraint: true, + reference: true, + }, + name: "enrollPerson", + description: "Enroll a person to the restaurant reservation list.", + collection: typia.json.schemas<[{ input: IPerson }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.example.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.example.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface IPerson { + name: string & tags.Example<"John Doe">; + age: number & tags.Example<42>; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = + "Just enroll a person whose name and age values exactly same with the example values."; diff --git a/test/features/llm/chatgpt/test_chatgpt_function_calling_recursive.ts b/test/features/llm/chatgpt/test_chatgpt_function_calling_recursive.ts new file mode 100644 index 0000000..168c344 --- /dev/null +++ b/test/features/llm/chatgpt/test_chatgpt_function_calling_recursive.ts @@ -0,0 +1,96 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { ChatGptFunctionCaller } from "../../../utils/ChatGptFunctionCaller"; + +export const test_chatgpt_function_calling_recursive = () => + ChatGptFunctionCaller.test({ + config: { + constraint: false, + reference: true, + }, + name: "composeCategories", + description: "Compose categories from the input.", + collection: typia.json.schemas<[{ input: IShoppingCategory[] }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.recursive.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface IShoppingCategory { + /** + * Identifier code of the category. + */ + code: string & tags.Pattern<"^[a-z0-9_]+$">; + + /** + * Name of the category. + */ + name: string; + + /** + * Children categories belong to this category. + */ + children: IShoppingCategory[]; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = ` + I'll insert a shopping category tree here. + + - electronics + - desktops + - laptops + - ultrabooks + - macbooks + - desknotes + - 2 in 1 laptops + - tablets + - ipads + - android tablets + - windows tablets + - smart phones + - mini smartphones + - phablets + - gaming smartphones + - rugged smartphones + - foldable smartphones + - smart watches + - smart glasses + - cameras + - televisions + - furnitures + - accessories + - jewelry + - clothing + - shoes + - clothes + - others +`; diff --git a/test/features/llm/chatgpt/test_chatgpt_function_calling_sale.ts b/test/features/llm/chatgpt/test_chatgpt_function_calling_sale.ts new file mode 100644 index 0000000..28e2f2f --- /dev/null +++ b/test/features/llm/chatgpt/test_chatgpt_function_calling_sale.ts @@ -0,0 +1,34 @@ +import fs from "fs"; +import typia from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { IShoppingSale } from "../../../structures/IShoppingSale"; +import { ChatGptFunctionCaller } from "../../../utils/ChatGptFunctionCaller"; +import { ShoppingSalePrompt } from "../../../utils/ShoppingSalePrompt"; + +export const test_chatgpt_function_calling_sale = async (): Promise => + ChatGptFunctionCaller.test({ + config: { + reference: process.argv.includes("--reference"), + constraint: process.argv.includes("--constraint"), + }, + ...ShoppingSalePrompt.schema(), + texts: await ShoppingSalePrompt.texts(), + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.sale.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.sale.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); diff --git a/test/features/llm/chatgpt/test_chatgpt_function_calling_tags.ts b/test/features/llm/chatgpt/test_chatgpt_function_calling_tags.ts new file mode 100644 index 0000000..3507271 --- /dev/null +++ b/test/features/llm/chatgpt/test_chatgpt_function_calling_tags.ts @@ -0,0 +1,53 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { ChatGptFunctionCaller } from "../../../utils/ChatGptFunctionCaller"; + +export const test_chatgpt_function_calling_tags = (): Promise => + ChatGptFunctionCaller.test({ + config: { + constraint: false, + reference: false, + }, + name: "reserve", + description: "Reserve some opening time.", + collection: typia.json.schemas<[{ input: OpeningTime }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: (parameters) => + fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.tags.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ), + handleCompletion: async (input) => { + typia.assert(input); + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.tags.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface OpeningTime { + reasons: Array & tags.MinItems<1>; + temporary: boolean; + time: (string & tags.Format<"date-time">) | null; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = ` + Reserve current date-time permenantely as the reason of marketing sales. +`; diff --git a/test/features/llm/claude/test_claude_function_calling_example.ts b/test/features/llm/claude/test_claude_function_calling_example.ts new file mode 100644 index 0000000..76e784a --- /dev/null +++ b/test/features/llm/claude/test_claude_function_calling_example.ts @@ -0,0 +1,54 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { ClaudeFunctionCaller } from "../../../utils/ClaudeFunctionCaller"; + +export const test_claude_function_calling_example = () => + ClaudeFunctionCaller.test({ + model: "claude", + config: { + reference: true, + }, + name: "enrollPerson", + description: "Enroll a person to the restaurant reservation list.", + collection: typia.json.schemas<[{ input: IPerson }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/claude.example.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.example.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface IPerson { + name: string & tags.Example<"John Doe">; + age: number & tags.Example<42>; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = + "Just enroll a person whose name and age values exactly same with the example values."; diff --git a/test/features/llm/claude/test_claude_function_calling_recursive.ts b/test/features/llm/claude/test_claude_function_calling_recursive.ts new file mode 100644 index 0000000..9faf69d --- /dev/null +++ b/test/features/llm/claude/test_claude_function_calling_recursive.ts @@ -0,0 +1,96 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { ClaudeFunctionCaller } from "../../../utils/ClaudeFunctionCaller"; + +export const test_claude_function_calling_recursive = () => + ClaudeFunctionCaller.test({ + model: "claude", + config: { + reference: true, + }, + name: "composeCategories", + description: "Compose categories from the input.", + collection: typia.json.schemas<[{ input: IShoppingCategory[] }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/claude.recursive.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.recursive.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface IShoppingCategory { + /** + * Identifier code of the category. + */ + code: string & tags.Pattern<"^[a-z0-9_]+$">; + + /** + * Name of the category. + */ + name: string; + + /** + * Children categories belong to this category. + */ + children: IShoppingCategory[]; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = ` + I'll insert a shopping category tree here. + + - electronics + - desktops + - laptops + - ultrabooks + - macbooks + - desknotes + - 2 in 1 laptops + - tablets + - ipads + - android tablets + - windows tablets + - smart phones + - mini smartphones + - phablets + - gaming smartphones + - rugged smartphones + - foldable smartphones + - smart watches + - smart glasses + - cameras + - televisions + - furnitures + - accessories + - jewelry + - clothing + - shoes + - clothes + - others +`; diff --git a/test/features/llm/claude/test_claude_function_calling_sale.ts b/test/features/llm/claude/test_claude_function_calling_sale.ts new file mode 100644 index 0000000..e012c65 --- /dev/null +++ b/test/features/llm/claude/test_claude_function_calling_sale.ts @@ -0,0 +1,31 @@ +import fs from "fs"; +import typia from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { IShoppingSale } from "../../../structures/IShoppingSale"; +import { ClaudeFunctionCaller } from "../../../utils/ClaudeFunctionCaller"; +import { ShoppingSalePrompt } from "../../../utils/ShoppingSalePrompt"; + +export const test_claude_function_calling_sale = async (): Promise => + ClaudeFunctionCaller.test({ + model: "claude", + config: { + reference: process.argv.includes("--reference"), + }, + ...ShoppingSalePrompt.schema(), + texts: await ShoppingSalePrompt.texts(), + handleParameters: (parameters) => + fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/claude.sale.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ), + handleCompletion: async (input) => { + typia.assert(input); + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.sale.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); diff --git a/test/features/llm/claude/test_claude_function_calling_tags.ts b/test/features/llm/claude/test_claude_function_calling_tags.ts new file mode 100644 index 0000000..cbd1a8c --- /dev/null +++ b/test/features/llm/claude/test_claude_function_calling_tags.ts @@ -0,0 +1,56 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { ClaudeFunctionCaller } from "../../../utils/ClaudeFunctionCaller"; + +export const test_claude_function_calling_tags = (): Promise => + ClaudeFunctionCaller.test({ + model: "claude", + config: { + reference: true, + }, + name: "reserve", + description: "Reserve some opening time.", + collection: typia.json.schemas<[{ input: OpeningTime }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/claude.tags.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.tags.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface OpeningTime { + reasons: Array & tags.MinItems<1>; + temporary: boolean; + time: (string & tags.Format<"date-time">) | null; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = ` + Reserve current date-time permenantely as the reason of marketing sales. +`; diff --git a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_example.ts b/test/features/llm/function-calling/test_llm_function_calling_chatgpt_example.ts deleted file mode 100644 index bd0f410..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_example.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IChatGptSchema, OpenApi } from "@samchon/openapi"; -import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter"; -import fs from "fs"; -import OpenAI from "openai"; -import { ChatCompletion } from "openai/resources"; -import typia, { IJsonSchemaCollection, tags } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; - -export const test_llm_function_calling_chatgpt_example = - async (): Promise => { - if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IPerson }]>(); - const parameters: IChatGptSchema.IParameters | null = - ChatGptConverter.parameters({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - reference: true, - constraint: true, - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the ChatGPT schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.example.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const client: OpenAI = new OpenAI({ - apiKey: TestGlobal.env.CHATGPT_API_KEY, - }); - const completion: ChatCompletion = await client.chat.completions.create({ - model: "gpt-4o", - messages: [ - { - role: "system", - content: SYSTEM_MESSAGE, - }, - { - role: "user", - content: USER_MESSAGE, - }, - ], - tools: [ - { - type: "function", - function: { - name: "enrollPerson", - description: "Enroll a person to the restaurant reservation list.", - parameters: parameters as any, - strict: true, - }, - }, - ], - }); - await ArrayUtil.asyncMap(completion.choices[0].message.tool_calls ?? [])( - async (call) => { - TestValidator.equals("name")(call.function.name)("enrollPerson"); - const { input } = typia.assert<{ - input: IPerson; - }>(JSON.parse(call.function.arguments)); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.example.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }, - ); - }; - -interface IPerson { - name: string & tags.Example<"John Doe">; - age: number & tags.Example<42>; -} - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; - -const USER_MESSAGE = - "Just enroll a person whose name and age values exactly same with the example values."; diff --git a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_recursive.ts b/test/features/llm/function-calling/test_llm_function_calling_chatgpt_recursive.ts deleted file mode 100644 index 49e3196..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_recursive.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IChatGptSchema, OpenApi } from "@samchon/openapi"; -import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter"; -import fs from "fs"; -import OpenAI from "openai"; -import { ChatCompletion } from "openai/resources"; -import typia, { IJsonSchemaCollection, tags } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; - -export const test_llm_function_calling_chatgpt_recursive = - async (): Promise => { - if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingCategory[] }]>(); - const parameters: IChatGptSchema.IParameters | null = - ChatGptConverter.parameters({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - reference: true, - constraint: false, - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the ChatGPT schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.recursive.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const client: OpenAI = new OpenAI({ - apiKey: TestGlobal.env.CHATGPT_API_KEY, - }); - const completion: ChatCompletion = await client.chat.completions.create({ - model: "gpt-4o", - messages: [ - { - role: "system", - content: SYSTEM_MESSAGE, - }, - { - role: "user", - content: USER_MESSAGE, - }, - ], - tools: [ - { - type: "function", - function: { - name: "composeCategories", - description: "Compose categories from the input.", - parameters: parameters as any, - strict: true, - }, - }, - ], - }); - await ArrayUtil.asyncMap(completion.choices[0].message.tool_calls ?? [])( - async (call) => { - TestValidator.equals("name")(call.function.name)("composeCategories"); - const { input } = typia.assert<{ - input: IShoppingCategory[]; - }>(JSON.parse(call.function.arguments)); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }, - ); - }; - -interface IShoppingCategory { - /** - * Identifier code of the category. - */ - code: string & tags.Pattern<"^[a-z0-9_]+$">; - - /** - * Name of the category. - */ - name: string; - - /** - * Children categories belong to this category. - */ - children: IShoppingCategory[]; -} - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; -const USER_MESSAGE = ` - I'll insert a shopping category tree here. - - - electronics - - desktops - - laptops - - ultrabooks - - macbooks - - desknotes - - 2 in 1 laptops - - tablets - - ipads - - android tablets - - windows tablets - - smart phones - - mini smartphones - - phablets - - gaming smartphones - - rugged smartphones - - foldable smartphones - - smart watches - - smart glasses - - cameras - - televisions - - furnitures - - accessories - - jewelry - - clothing - - shoes - - clothes - - others -`; diff --git a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_sale.ts b/test/features/llm/function-calling/test_llm_function_calling_chatgpt_sale.ts deleted file mode 100644 index b26bdac..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_sale.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IChatGptSchema, OpenApi } from "@samchon/openapi"; -import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter"; -import fs from "fs"; -import OpenAI from "openai"; -import { - ChatCompletion, - ChatCompletionMessageToolCall, -} from "openai/resources"; -import typia, { IJsonSchemaCollection } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; -import { IShoppingSale } from "../../../structures/IShoppingSale"; - -export const test_llm_function_calling_chatgpt_sale = - async (): Promise => { - if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingSale.ICreate }, IShoppingSale]>(); - const parameters: IChatGptSchema.IParameters | null = - ChatGptConverter.parameters({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - reference: process.argv.includes("--reference"), - constraint: process.argv.includes("--constraint"), - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the ChatGPT schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.sale.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const client: OpenAI = new OpenAI({ - apiKey: TestGlobal.env.CHATGPT_API_KEY, - }); - const completion: ChatCompletion = await client.chat.completions.create({ - model: "gpt-4o", - messages: [ - { - role: "system", - content: SYSTEM_MESSAGE, - }, - { - role: "assistant", - content: [ - "Here is the list of categories belonged to the samchon channel", - "", - "```json", - await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - "utf8", - ), - "```", - ].join("\n"), - }, - { - role: "user", - content: await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/microsoft-surface-pro-9.md`, - "utf8", - ), - }, - ], - tools: [ - { - type: "function", - function: { - name: "createSale", - description: "Create a sale and returns the detailed information.", - parameters: parameters as any, - strict: true, - }, - }, - ], - }); - - const toolCalls: ChatCompletionMessageToolCall[] = - completion.choices[0].message.tool_calls ?? []; - if (toolCalls.length === 0) - throw new Error("LLM has not called any function."); - await ArrayUtil.asyncForEach(toolCalls)(async (call) => { - TestValidator.equals("name")(call.function.name)("createSale"); - const { input } = typia.assert<{ - input: IShoppingSale.ICreate; - }>(JSON.parse(call.function.arguments)); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.sale.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }); - }; - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; diff --git a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_tags.ts b/test/features/llm/function-calling/test_llm_function_calling_chatgpt_tags.ts deleted file mode 100644 index aa2d320..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_tags.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IChatGptSchema, OpenApi } from "@samchon/openapi"; -import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter"; -import fs from "fs"; -import OpenAI from "openai"; -import { ChatCompletion } from "openai/resources"; -import typia, { IJsonSchemaCollection, tags } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; - -export const test_llm_function_calling_chatgpt_tags = - async (): Promise => { - if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: OpeningTime }]>(); - const parameters: IChatGptSchema.IParameters | null = - ChatGptConverter.parameters({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - reference: true, - constraint: true, - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the ChatGPT schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.tags.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const client: OpenAI = new OpenAI({ - apiKey: TestGlobal.env.CHATGPT_API_KEY, - }); - const completion: ChatCompletion = await client.chat.completions.create({ - model: "gpt-4o", - messages: [ - { - role: "system", - content: SYSTEM_MESSAGE, - }, - { - role: "user", - content: USER_MESSAGE, - }, - ], - tools: [ - { - type: "function", - function: { - name: "reserve", - description: "Reserve some opening time.", - parameters: parameters as any, - }, - }, - ], - }); - await ArrayUtil.asyncMap(completion.choices[0].message.tool_calls ?? [])( - async (call) => { - TestValidator.equals("name")(call.function.name)("reserve"); - const { input } = typia.assert<{ - input: OpeningTime; - }>(JSON.parse(call.function.arguments)); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.tags.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }, - ); - }; - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; -const USER_MESSAGE = ` - Reserve current date-time permenantely as the reason of marketing sales. -`; - -interface OpeningTime { - reasons: Array & tags.MinItems<1>; - temporary: boolean; - time: (string & tags.Format<"date-time">) | null; -} diff --git a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_tuple.ts b/test/features/llm/function-calling/test_llm_function_calling_chatgpt_tuple.ts deleted file mode 100644 index 4ada94d..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_chatgpt_tuple.ts +++ /dev/null @@ -1,83 +0,0 @@ -//---------------------------------- -// TUPLE TYPE NOT SUPPORTED -//---------------------------------- -// import { ArrayUtil, TestValidator } from "@nestia/e2e"; -// import { IChatGptSchema, OpenApi } from "@samchon/openapi"; -// import { ChatGptConverter } from "@samchon/openapi/lib/converters/ChatGptConverter"; -// import fs from "fs"; -// import OpenAI from "openai"; -// import { ChatCompletion } from "openai/resources"; -// import typia, { IJsonSchemaCollection } from "typia"; - -// import { TestGlobal } from "../../../TestGlobal"; - -// export const test_llm_function_calling_chatgpt_tuple = -// async (): Promise => { -// if (TestGlobal.env.OPENAI_API_KEY === undefined) return; - -// const collection: IJsonSchemaCollection = -// typia.json.schemas<[{ input: [number, number, number] }]>(); -// const parameters: IChatGptSchema.IParameters | null = -// ChatGptConverter.parameters({ -// components: collection.components, -// schema: typia.assert( -// collection.schemas[0], -// ), -// escape: false, -// }); -// if (parameters === null) -// throw new Error( -// "Failed to convert the JSON schema to the ChatGPT schema.", -// ); -// await fs.promises.writeFile( -// `${TestGlobal.ROOT}/examples/function-calling/tuple.schema.json`, -// JSON.stringify(parameters, null, 2), -// "utf8", -// ); - -// const client: OpenAI = new OpenAI({ -// apiKey: TestGlobal.env.OPENAI_API_KEY, -// }); -// const completion: ChatCompletion = await client.chat.completions.create({ -// model: "gpt-4o", -// messages: [ -// { -// role: "system", -// content: SYSTEM_MESSAGE, -// }, -// { -// role: "user", -// content: USER_MESSAGE, -// }, -// ], -// tools: [ -// { -// type: "function", -// function: { -// name: "pushNumericValues", -// description: "Push three numeric values.", -// parameters: parameters as any, -// strict: true, -// }, -// }, -// ], -// }); -// await ArrayUtil.asyncMap(completion.choices[0].message.tool_calls ?? [])( -// async (call) => { -// TestValidator.equals("name")(call.function.name)("pushNumericValue"); -// const { input } = typia.assert<{ -// input: [number, number, number]; -// }>(JSON.parse(call.function.arguments)); -// await fs.promises.writeFile( -// `${TestGlobal.ROOT}/examples/function-calling/tuple.input.json`, -// JSON.stringify(input, null, 2), -// "utf8", -// ); -// }, -// ); -// }; - -// const SYSTEM_MESSAGE = -// "You are a helpful customer support assistant. Use the supplied tools to assist the user."; - -// const USER_MESSAGE = "Push three numbers, 1, 2 and 3."; diff --git a/test/features/llm/function-calling/test_llm_function_calling_claude_sale.ts b/test/features/llm/function-calling/test_llm_function_calling_claude_sale.ts deleted file mode 100644 index 31055d3..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_claude_sale.ts +++ /dev/null @@ -1,98 +0,0 @@ -import Anthropic from "@anthropic-ai/sdk"; -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { OpenApi } from "@samchon/openapi"; -import { LlmSchemaConverter } from "@samchon/openapi/lib/converters/LlmSchemaConverter"; -import { IClaudeSchema } from "@samchon/openapi/lib/structures/IClaudeSchema"; -import fs from "fs"; -import typia, { IJsonSchemaCollection } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; -import { IShoppingSale } from "../../../structures/IShoppingSale"; - -export const test_llm_function_calling_claude_sale = - async (): Promise => { - if (TestGlobal.env.CLAUDE_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingSale.ICreate }, IShoppingSale]>(); - const parameters: IClaudeSchema.IParameters | null = - LlmSchemaConverter.parameters("claude")({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - reference: true, - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the ChatGPT schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/claude.sale.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const client: Anthropic = new Anthropic({ - apiKey: TestGlobal.env.CLAUDE_API_KEY, - }); - const completion: Anthropic.Message = await client.messages.create({ - model: "claude-3-5-sonnet-latest", - max_tokens: 8_192, - messages: [ - { - role: "assistant", - content: SYSTEM_MESSAGE, - }, - { - role: "assistant", - content: [ - "Here is the list of categories belonged to the samchon channel", - "", - "```json", - await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - "utf8", - ), - "```", - ].join("\n"), - }, - { - role: "user", - content: await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/microsoft-surface-pro-9.md`, - "utf8", - ), - }, - ], - tools: [ - { - name: "createSale", - description: "Create a sale and returns the detailed information.", - input_schema: parameters as any, - }, - ], - }); - - const toolCalls: Anthropic.ToolUseBlock[] = completion.content.filter( - (c) => c.type === "tool_use", - ); - if (toolCalls.length === 0) - throw new Error("LLM has not called any function."); - await ArrayUtil.asyncForEach(toolCalls)(async (call) => { - TestValidator.equals("name")(call.name)("createSale"); - const { input } = typia.assert<{ - input: IShoppingSale.ICreate; - }>(call.input); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.sale.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }); - }; - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; diff --git a/test/features/llm/function-calling/test_llm_function_calling_gemini_example.ts b/test/features/llm/function-calling/test_llm_function_calling_gemini_example.ts deleted file mode 100644 index 5641d46..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_gemini_example.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { - FunctionCall, - FunctionCallingMode, - GenerateContentResult, - GenerativeModel, - GoogleGenerativeAI, -} from "@google/generative-ai"; -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IGeminiSchema, OpenApi } from "@samchon/openapi"; -import { GeminiConverter } from "@samchon/openapi/lib/converters/GeminiConverter"; -import fs from "fs"; -import typia, { IJsonSchemaCollection, tags } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; - -export const test_llm_function_calling_gemini_example = - async (): Promise => { - if (TestGlobal.env.GEMINI_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IPerson }]>(); - const parameters: IGeminiSchema.IParameters | null = - GeminiConverter.parameters({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - recursive: false, - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the ChatGPT schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/gemini.example.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const model: GenerativeModel = new GoogleGenerativeAI( - TestGlobal.env.GEMINI_API_KEY, - ).getGenerativeModel({ - model: "gemini-1.5-pro", - }); - const result: GenerateContentResult = await model.generateContent({ - contents: [ - { - role: "model", - parts: [ - { - text: SYSTEM_MESSAGE, - }, - ], - }, - { - role: "user", - parts: [ - { - text: USER_MESSAGE, - }, - ], - }, - ], - tools: [ - { - functionDeclarations: [ - { - name: "enrollPerson", - description: - "Enroll a person to the restaurant reservation list.", - parameters: parameters as any, - }, - ], - }, - ], - toolConfig: { - functionCallingConfig: { - mode: FunctionCallingMode.ANY, - allowedFunctionNames: ["enrollPerson"], - }, - }, - }); - - await ArrayUtil.asyncMap(result.response.functionCalls() ?? [])( - async (call: FunctionCall) => { - TestValidator.equals("name")(call.name)("enrollPerson"); - const { input } = typia.assert<{ - input: IPerson; - }>(call.args); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.example.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }, - ); - }; - -interface IPerson { - name: string & tags.Example<"John Doe">; - age: number & tags.Example<42>; -} - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; - -const USER_MESSAGE = - "Just enroll a person whose name and age values exactly same with the example values."; diff --git a/test/features/llm/function-calling/test_llm_function_calling_gemini_sale.ts b/test/features/llm/function-calling/test_llm_function_calling_gemini_sale.ts deleted file mode 100644 index d0474f3..0000000 --- a/test/features/llm/function-calling/test_llm_function_calling_gemini_sale.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { - FunctionCall, - FunctionCallingMode, - GenerateContentResult, - GenerativeModel, - GoogleGenerativeAI, -} from "@google/generative-ai"; -import { ArrayUtil, TestValidator } from "@nestia/e2e"; -import { IGeminiSchema, OpenApi } from "@samchon/openapi"; -import { GeminiConverter } from "@samchon/openapi/lib/converters/GeminiConverter"; -import fs from "fs"; -import typia, { IJsonSchemaCollection } from "typia"; - -import { TestGlobal } from "../../../TestGlobal"; -import { IShoppingSale } from "../../../structures/IShoppingSale"; - -export const test_llm_function_calling_gemini_sale = - async (): Promise => { - if (TestGlobal.env.GEMINI_API_KEY === undefined) return; - - const collection: IJsonSchemaCollection = - typia.json.schemas<[{ input: IShoppingSale.ICreate }]>(); - const parameters: IGeminiSchema.IParameters | null = - GeminiConverter.parameters({ - components: collection.components, - schema: typia.assert( - collection.schemas[0], - ), - config: { - recursive: 3, - }, - }); - if (parameters === null) - throw new Error( - "Failed to convert the JSON schema to the Gemini schema.", - ); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/schemas/gemini.sale.schema.json`, - JSON.stringify(parameters, null, 2), - "utf8", - ); - - const model: GenerativeModel = new GoogleGenerativeAI( - TestGlobal.env.GEMINI_API_KEY, - ).getGenerativeModel({ - model: "gemini-1.5-pro", - }); - const result: GenerateContentResult = await model.generateContent({ - contents: [ - { - role: "model", - parts: [ - { - text: SYSTEM_MESSAGE, - }, - ], - }, - { - role: "model", - parts: [ - { - text: [ - "Here is the list of categories belonged to the samchon channel", - "", - "```json", - await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, - "utf8", - ), - "```", - ].join("\n"), - }, - ], - }, - { - role: "model", - parts: [ - { - text: await fs.promises.readFile( - `${TestGlobal.ROOT}/examples/function-calling/prompts/microsoft-surface-pro-9.md`, - "utf8", - ), - }, - ], - }, - ], - tools: [ - { - functionDeclarations: [ - { - name: "createSale", - description: - "Create a sale and returns the detailed information.", - parameters: parameters as any, - }, - ], - }, - ], - toolConfig: { - functionCallingConfig: { - mode: FunctionCallingMode.ANY, - allowedFunctionNames: ["createSale"], - }, - }, - }); - await ArrayUtil.asyncMap(result.response.functionCalls() ?? [])( - async (call: FunctionCall) => { - TestValidator.equals("name")(call.name)("createSale"); - const { input } = typia.assert<{ - input: IShoppingSale.ICreate; - }>(call.args); - await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.sale.input.json`, - JSON.stringify(input, null, 2), - "utf8", - ); - }, - ); - }; - -const SYSTEM_MESSAGE = - "You are a helpful customer support assistant. Use the supplied tools to assist the user."; diff --git a/test/features/llm/gemini/test_gemini_function_calling_example.ts b/test/features/llm/gemini/test_gemini_function_calling_example.ts new file mode 100644 index 0000000..bff2546 --- /dev/null +++ b/test/features/llm/gemini/test_gemini_function_calling_example.ts @@ -0,0 +1,53 @@ +import fs from "fs"; +import typia, { tags } from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { GeminiFunctionCaller } from "../../../utils/GeminiFunctionCaller"; + +export const test_gemini_function_calling_example = (): Promise => + GeminiFunctionCaller.test({ + config: { + recursive: 3, + }, + name: "enrollPerson", + description: "Enroll a person to the restaurant reservation list.", + collection: typia.json.schemas<[{ input: IPerson }]>(), + texts: [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "user", + content: USER_MESSAGE, + }, + ], + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/gemini.example.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.example.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); + +interface IPerson { + name: string & tags.Example<"John Doe">; + age: number & tags.Example<42>; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; + +const USER_MESSAGE = + "Just enroll a person whose name and age values exactly same with the example values."; diff --git a/test/features/llm/gemini/test_gemini_function_calling_sale.ts b/test/features/llm/gemini/test_gemini_function_calling_sale.ts new file mode 100644 index 0000000..736ed43 --- /dev/null +++ b/test/features/llm/gemini/test_gemini_function_calling_sale.ts @@ -0,0 +1,33 @@ +import fs from "fs"; +import typia from "typia"; + +import { TestGlobal } from "../../../TestGlobal"; +import { IShoppingSale } from "../../../structures/IShoppingSale"; +import { GeminiFunctionCaller } from "../../../utils/GeminiFunctionCaller"; +import { ShoppingSalePrompt } from "../../../utils/ShoppingSalePrompt"; + +export const test_gemini_function_calling_sale = async (): Promise => + await GeminiFunctionCaller.test({ + config: { + recursive: 3, + }, + ...ShoppingSalePrompt.schema(), + texts: await ShoppingSalePrompt.texts(), + handleParameters: async (parameters) => { + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/schemas/gemini.sale.schema.json`, + JSON.stringify(parameters, null, 2), + "utf8", + ); + }, + handleCompletion: async (input) => { + typia.assert(input); + if (process.argv.includes("--file")) + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/gemini.sale.input.json`, + JSON.stringify(input, null, 2), + "utf8", + ); + }, + }); diff --git a/test/structures/ILlmTextPrompt.ts b/test/structures/ILlmTextPrompt.ts new file mode 100644 index 0000000..22250df --- /dev/null +++ b/test/structures/ILlmTextPrompt.ts @@ -0,0 +1,4 @@ +export interface ILlmTextPrompt { + role: "assistant" | "user"; + content: string; +} diff --git a/test/structures/IShoppingSaleUnitOption.ts b/test/structures/IShoppingSaleUnitOption.ts index ae96ab2..eec1229 100644 --- a/test/structures/IShoppingSaleUnitOption.ts +++ b/test/structures/IShoppingSaleUnitOption.ts @@ -39,21 +39,18 @@ import { IShoppingSaleUnitSelectableOption } from "./IShoppingSaleUnitSelectable * * @author Samchon */ -export type IShoppingSaleUnitOption = - | IShoppingSaleUnitSelectableOption - | IShoppingSaleUnitDescriptiveOption; +export type IShoppingSaleUnitOption = IShoppingSaleUnitSelectableOption; +// | IShoppingSaleUnitDescriptiveOption; export namespace IShoppingSaleUnitOption { /** * Inversely referenced information of the option. */ - export type IInvert = - | IShoppingSaleUnitSelectableOption.IInvert - | IShoppingSaleUnitDescriptiveOption; + export type IInvert = IShoppingSaleUnitSelectableOption.IInvert; + // | IShoppingSaleUnitDescriptiveOption; /** * Creation information of the option. */ - export type ICreate = - | IShoppingSaleUnitSelectableOption.ICreate - | IShoppingSaleUnitDescriptiveOption.ICreate; + export type ICreate = IShoppingSaleUnitSelectableOption.ICreate; + // | IShoppingSaleUnitDescriptiveOption.ICreate; } diff --git a/test/utils/ChatGptFunctionCaller.ts b/test/utils/ChatGptFunctionCaller.ts new file mode 100644 index 0000000..7b95a90 --- /dev/null +++ b/test/utils/ChatGptFunctionCaller.ts @@ -0,0 +1,76 @@ +import { ArrayUtil, TestValidator } from "@nestia/e2e"; +import { IChatGptSchema, OpenApi } from "@samchon/openapi"; +import { LlmSchemaConverter } from "@samchon/openapi/lib/converters/LlmSchemaConverter"; +import OpenAI from "openai"; +import { + ChatCompletion, + ChatCompletionMessageToolCall, +} from "openai/resources"; +import typia, { IJsonSchemaCollection } from "typia"; + +import { TestGlobal } from "../TestGlobal"; +import { ILlmTextPrompt } from "../structures/ILlmTextPrompt"; + +export namespace ChatGptFunctionCaller { + export const test = async (props: { + name: string; + description: string; + collection: IJsonSchemaCollection; + texts: ILlmTextPrompt[]; + handleCompletion: (input: any) => Promise; + handleParameters?: ( + parameters: IChatGptSchema.IParameters, + ) => Promise; + config?: Partial; + }): Promise => { + if (TestGlobal.env.CHATGPT_API_KEY === undefined) return; + + const parameters: IChatGptSchema.IParameters | null = + LlmSchemaConverter.parameters("chatgpt")({ + components: props.collection.components, + schema: typia.assert( + props.collection.schemas[0], + ), + config: { + ...LlmSchemaConverter.defaultConfig("chatgpt"), + ...(props.config ?? {}), + }, + }); + if (parameters === null) + throw new Error( + "Failed to convert the JSON schema to the ChatGPT schema.", + ); + else if (props.handleParameters) await props.handleParameters(parameters); + + const client: OpenAI = new OpenAI({ + apiKey: TestGlobal.env.CHATGPT_API_KEY, + }); + const completion: ChatCompletion = await client.chat.completions.create({ + model: "gpt-4o", + messages: props.texts, + tools: [ + { + type: "function", + function: { + name: props.name, + description: props.description, + parameters: parameters as any, + strict: true, + }, + }, + ], + }); + + const toolCalls: ChatCompletionMessageToolCall[] = + completion.choices[0].message.tool_calls ?? []; + if (toolCalls.length === 0) + throw new Error("ChatGPT has not called any function."); + await ArrayUtil.asyncForEach(toolCalls)(async (call) => { + TestValidator.equals("name")(call.function.name)(props.name); + const { input } = typia.assert<{ input: any }>( + JSON.parse(call.function.arguments), + ); + await props.handleCompletion(input); + }); + }; +} diff --git a/test/utils/ClaudeFunctionCaller.ts b/test/utils/ClaudeFunctionCaller.ts new file mode 100644 index 0000000..04fabb6 --- /dev/null +++ b/test/utils/ClaudeFunctionCaller.ts @@ -0,0 +1,71 @@ +import Anthropic from "@anthropic-ai/sdk"; +import { ArrayUtil, TestValidator } from "@nestia/e2e"; +import { ILlmApplication, OpenApi } from "@samchon/openapi"; +import { LlmSchemaConverter } from "@samchon/openapi/lib/converters/LlmSchemaConverter"; +import typia, { IJsonSchemaCollection } from "typia"; + +import { TestGlobal } from "../TestGlobal"; +import { ILlmTextPrompt } from "../structures/ILlmTextPrompt"; + +export namespace ClaudeFunctionCaller { + export const test = async < + Model extends "chatgpt" | "claude" | "gemini", + >(props: { + model: Model; + config: Partial; + name: string; + description: string; + collection: IJsonSchemaCollection; + texts: ILlmTextPrompt[]; + handleCompletion: (input: any) => Promise; + handleParameters?: ( + parameters: ILlmApplication.ModelParameters[Model], + ) => Promise; + }): Promise => { + if (TestGlobal.env.CLAUDE_API_KEY === undefined) return; + + const parameters: ILlmApplication.ModelParameters[Model] | null = + LlmSchemaConverter.parameters(props.model)({ + components: props.collection.components, + schema: typia.assert( + props.collection.schemas[0], + ), + config: { + ...LlmSchemaConverter.defaultConfig(props.model), + ...(props.config ?? {}), + } satisfies ILlmApplication.ModelConfig[Model] as any, + }) as ILlmApplication.ModelParameters[Model] | null; + if (parameters === null) + throw new Error( + "Failed to convert the JSON schema to the Claude schema.", + ); + else if (props.handleParameters) await props.handleParameters(parameters); + + const client: Anthropic = new Anthropic({ + apiKey: TestGlobal.env.CLAUDE_API_KEY, + }); + const completion: Anthropic.Message = await client.messages.create({ + model: "claude-3-5-sonnet-latest", + max_tokens: 8_192, + messages: props.texts, + tools: [ + { + name: props.name, + description: props.description, + input_schema: parameters as any, + }, + ], + }); + + const toolCalls: Anthropic.ToolUseBlock[] = completion.content.filter( + (c) => c.type === "tool_use", + ); + if (toolCalls.length === 0) + throw new Error("Claude has not called any function."); + await ArrayUtil.asyncForEach(toolCalls)(async (call) => { + TestValidator.equals("name")(call.name)(props.name); + const { input } = typia.assert<{ input: any }>(call.input); + await props.handleCompletion(input); + }); + }; +} diff --git a/test/utils/GeminiFunctionCaller.ts b/test/utils/GeminiFunctionCaller.ts new file mode 100644 index 0000000..57d29ef --- /dev/null +++ b/test/utils/GeminiFunctionCaller.ts @@ -0,0 +1,86 @@ +import { + FunctionCall, + FunctionCallingMode, + GenerateContentResult, + GenerativeModel, + GoogleGenerativeAI, +} from "@google/generative-ai"; +import { ArrayUtil, TestValidator } from "@nestia/e2e"; +import { IGeminiSchema, OpenApi } from "@samchon/openapi"; +import { LlmSchemaConverter } from "@samchon/openapi/lib/converters/LlmSchemaConverter"; +import typia, { IJsonSchemaCollection } from "typia"; + +import { TestGlobal } from "../TestGlobal"; +import { ILlmTextPrompt } from "../structures/ILlmTextPrompt"; + +export namespace GeminiFunctionCaller { + export const test = async (props: { + name: string; + description: string; + collection: IJsonSchemaCollection; + texts: ILlmTextPrompt[]; + handleCompletion: (input: any) => Promise; + handleParameters?: (parameters: IGeminiSchema.IParameters) => Promise; + config?: Partial; + }): Promise => { + if (TestGlobal.env.GEMINI_API_KEY === undefined) return; + + const parameters: IGeminiSchema.IParameters | null = + LlmSchemaConverter.parameters("gemini")({ + components: props.collection.components, + schema: typia.assert( + props.collection.schemas[0], + ), + config: { + recursive: props.config?.recursive ?? 3, + }, + }); + if (parameters === null) + throw new Error( + "Failed to convert the JSON schema to the Gemini schema.", + ); + if (props.handleParameters) await props.handleParameters(parameters); + + const model: GenerativeModel = new GoogleGenerativeAI( + TestGlobal.env.GEMINI_API_KEY, + ).getGenerativeModel({ + model: "gemini-1.5-pro", + }); + const result: GenerateContentResult = await model.generateContent({ + contents: props.texts.map((p) => ({ + role: p.role === "assistant" ? "model" : p.role, + parts: [ + { + text: p.content, + }, + ], + })), + tools: [ + { + functionDeclarations: [ + { + name: props.name, + description: props.description, + parameters: parameters as any, + }, + ], + }, + ], + toolConfig: { + functionCallingConfig: { + mode: FunctionCallingMode.ANY, + allowedFunctionNames: [props.name], + }, + }, + }); + + const toolCalls: FunctionCall[] = result.response.functionCalls() ?? []; + if (toolCalls.length === 0) + throw new Error("Gemini has not called any function."); + await ArrayUtil.asyncForEach(toolCalls)(async (call) => { + TestValidator.equals("name")(call.name)(props.name); + const { input } = typia.assert<{ input: any }>(call.args); + await props.handleCompletion(input); + }); + }; +} diff --git a/test/utils/ShoppingSalePrompt.ts b/test/utils/ShoppingSalePrompt.ts new file mode 100644 index 0000000..c8aa069 --- /dev/null +++ b/test/utils/ShoppingSalePrompt.ts @@ -0,0 +1,56 @@ +import fs from "fs"; +import typia from "typia"; + +import { TestGlobal } from "../TestGlobal"; +import { ILlmTextPrompt } from "../structures/ILlmTextPrompt"; +import { IShoppingSale } from "../structures/IShoppingSale"; + +export namespace ShoppingSalePrompt { + export const documents = async (): Promise => { + const directory: string[] = await fs.promises.readdir( + `${TestGlobal.ROOT}/examples/function-calling/prompts`, + ); + return directory + .filter((file) => file.endsWith(".md")) + .map((file) => file.substring(0, file.length - 3)); + }; + + export const schema = () => ({ + name: "createSale", + description: "Create a sale and returns the detailed information.", + collection: + typia.json.schemas<[{ input: IShoppingSale.ICreate }, IShoppingSale]>(), + }); + + export const texts = async ( + product: string = "microsoft-surface-pro-9", + ): Promise => [ + { + role: "assistant", + content: SYSTEM_MESSAGE, + }, + { + role: "assistant", + content: [ + "Here is the list of categories belonged to the samchon channel", + "", + "```json", + await fs.promises.readFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/claude.recursive.input.json`, + "utf8", + ), + "```", + ].join("\n"), + }, + { + role: "user", + content: await fs.promises.readFile( + `${TestGlobal.ROOT}/examples/function-calling/prompts/${product}.md`, + "utf8", + ), + }, + ]; +} + +const SYSTEM_MESSAGE = + "You are a helpful customer support assistant. Use the supplied tools to assist the user."; diff --git a/test/utils/StopWatch.ts b/test/utils/StopWatch.ts new file mode 100644 index 0000000..d70c0d5 --- /dev/null +++ b/test/utils/StopWatch.ts @@ -0,0 +1,38 @@ +/** + * Elapsed time measurement utility. + * + * @author Sachon + */ +export namespace StopWatch { + /** + * Type of task. + */ + export type Task = () => Promise; + + /** + * + * @param task + * @returns + */ + export const measure = async (task: Task): Promise<[T, number]> => { + const time: number = Date.now(); + const output: T = await task(); + return [output, Date.now() - time]; + }; + + /** + * + * @param title + * @param task + * @returns + */ + export const trace = + (title: string) => + async (task: Task): Promise<[T, number]> => { + process.stdout.write(` - ${title}: `); + const res: [T, number] = await measure(task); + + console.log(`${res[1].toLocaleString()} ms`); + return res; + }; +}