diff --git a/README.md b/README.md index 7faa5bd..039006d 100644 --- a/README.md +++ b/README.md @@ -252,9 +252,9 @@ In `@samchon/openapi`, you can execute the LLM function calling by `HttpLlm.exec ```typescript import { HttpLlm, + IChatGptSchema, IHttpLlmApplication, IHttpLlmFunction, - ILlmSchemaV3_1, OpenApi, OpenApiV3, OpenApiV3_1, @@ -277,16 +277,17 @@ const main = async (): Promise => { // convert to emended OpenAPI document, // and compose LLM function calling application const document: OpenApi.IDocument = OpenApi.convert(swagger); - const application: IHttpLlmApplication<"3.1"> = HttpLlm.application({ - model: "3.1", + const application: IHttpLlmApplication<"chatgpt"> = HttpLlm.application({ + model: "chatgpt", document, }); // Let's imagine that LLM has selected a function to call - const func: IHttpLlmFunction | undefined = application.functions.find( - // (f) => f.name === "llm_selected_fuction_name" - (f) => f.path === "/bbs/{section}/articles/{id}" && f.method === "put", - ); + const func: IHttpLlmFunction | undefined = + application.functions.find( + // (f) => f.name === "llm_selected_fuction_name" + (f) => f.path === "/bbs/{section}/articles/{id}" && f.method === "put", + ); if (func === undefined) throw new Error("No matched function exists."); // actual execution is by yourself @@ -296,94 +297,19 @@ const main = async (): Promise => { }, application, function: func, - arguments: [ - "general", - v4(), - { + input: { + section: "general", + id: v4(), + query: { + language: "en-US", + format: "markdown", + }, + body: { title: "Hello, world!", body: "Let's imagine that this argument is composed by LLM.", thumbnail: null, }, - ], - }); - console.log("article", article); -}; -main().catch(console.error); -``` - -### Keyword Parameter -Combine parameters into single object. - -If you configure `keyword` option when composing the LLM (Large Language Model) function calling appliation, every parameters of OpenAPI operations would be combined to a single object type in the LLM funtion calling schema. This strategy is loved in many A.I. Chatbot developers, because LLM tends to a little professional in the single parameter function case. - -Also, do not worry about the function call execution case. You don't need to resolve the keyworded parameter manually. The `HttpLlm.execute()` and `HttpLlm.propagate()` functions will resolve the keyworded parameter automatically by analyzing the `IHttpLlmApplication.options` property. - -```typescript -import { - HttpLlm, - IHttpLlmApplication, - IHttpLlmFunction, - ILlmSchemaV3_1, - OpenApi, - OpenApiV3, - OpenApiV3_1, - SwaggerV2, -} from "@samchon/openapi"; -import fs from "fs"; -import typia from "typia"; -import { v4 } from "uuid"; - -const main = async (): Promise => { - // read swagger document and validate it - const swagger: - | SwaggerV2.IDocument - | OpenApiV3.IDocument - | OpenApiV3_1.IDocument = JSON.parse( - await fs.promises.readFile("swagger.json", "utf8"), - ); - typia.assert(swagger); // recommended - - // convert to emended OpenAPI document, - // and compose LLM function calling application - const document: OpenApi.IDocument = OpenApi.convert(swagger); - const application: IHttpLlmApplication<"3.1"> = HttpLlm.application({ - model: "3.1", - document, - options: { - keyword: true, - }, - }); - - // Let's imagine that LLM has selected a function to call - const func: IHttpLlmFunction | undefined = application.functions.find( - // (f) => f.name === "llm_selected_fuction_name" - (f) => f.path === "/bbs/{section}/articles/{id}" && f.method === "put", - ); - if (func === undefined) throw new Error("No matched function exists."); - - // actual execution is by yourself - const article = await HttpLlm.execute({ - connection: { - host: "http://localhost:3000", }, - application, - function: func, - arguments: [ - // one single object with key-value paired - { - section: "general", - id: v4(), - query: { - language: "en-US", - format: "markdown", - }, - body: { - title: "Hello, world!", - body: "Let's imagine that this argument is composed by LLM.", - thumbnail: null, - }, - }, - ], }); console.log("article", article); }; @@ -402,10 +328,10 @@ Here is the example code separating the file uploading feature from the LLM func ```typescript import { HttpLlm, + ChatGptTypeChecker, + IChatGptSchema, IHttpLlmApplication, IHttpLlmFunction, - ILlmSchemaV3_1, - LlmTypeCheckerV3_1, OpenApi, OpenApiV3, OpenApiV3_1, @@ -428,21 +354,22 @@ const main = async (): Promise => { // convert to emended OpenAPI document, // and compose LLM function calling application const document: OpenApi.IDocument = OpenApi.convert(swagger); - const application: IHttpLlmApplication<"3.1"> = HttpLlm.application({ - model: "3.1", + const application: IHttpLlmApplication<"chatgpt"> = HttpLlm.application({ + model: "chatgpt", document, options: { keyword: false, separate: (schema) => - LlmTypeCheckerV3_1.isString(schema) && schema.contentMediaType !== undefined, + ChatGptTypeChecker.isString(schema) && schema.contentMediaType !== undefined, }, }); // Let's imagine that LLM has selected a function to call - const func: IHttpLlmFunction | undefined = application.functions.find( - // (f) => f.name === "llm_selected_fuction_name" - (f) => f.path === "/bbs/articles/{id}" && f.method === "put", - ); + const func: IHttpLlmFunction | undefined = + application.functions.find( + // (f) => f.name === "llm_selected_fuction_name" + (f) => f.path === "/bbs/articles/{id}" && f.method === "put", + ); if (func === undefined) throw new Error("No matched function exists."); // actual execution is by yourself @@ -454,23 +381,25 @@ const main = async (): Promise => { function: func, arguments: HttpLlm.mergeParameters({ function: func, - llm: [ + llm: { // LLM composed parameter values - "general", - v4(), - { + section: "general", + id: v4(), + query: { language: "en-US", format: "markdown", }, - { + body: { title: "Hello, world!", content: "Let's imagine that this argument is composed by LLM.", }, - ], - human: [ + }, + human: { // Human composed parameter values - { thumbnail: "https://example.com/thumbnail.jpg" }, - ], + body: { + thumbnail: "https://example.com/thumbnail.jpg", + }, + }, }), }); console.log("article", article); diff --git a/examples/function-calling/example.input.json b/examples/function-calling/arguments/chatgpt.example.input.json similarity index 66% rename from examples/function-calling/example.input.json rename to examples/function-calling/arguments/chatgpt.example.input.json index 112a250..75f0aac 100644 --- a/examples/function-calling/example.input.json +++ b/examples/function-calling/arguments/chatgpt.example.input.json @@ -1,4 +1,4 @@ { "name": "example", - "age": 42 + "age": 25 } \ No newline at end of file diff --git a/examples/function-calling/recursive.input.json b/examples/function-calling/arguments/chatgpt.recursive.input.json similarity index 79% rename from examples/function-calling/recursive.input.json rename to examples/function-calling/arguments/chatgpt.recursive.input.json index d1ebec8..b790d31 100644 --- a/examples/function-calling/recursive.input.json +++ b/examples/function-calling/arguments/chatgpt.recursive.input.json @@ -4,121 +4,121 @@ "name": "electronics", "children": [ { - "id": "2", + "id": "11", "name": "desktops", "children": [] }, { - "id": "3", + "id": "12", "name": "laptops", "children": [ { - "id": "4", + "id": "121", "name": "ultrabooks", "children": [] }, { - "id": "5", + "id": "122", "name": "macbooks", "children": [] }, { - "id": "6", + "id": "123", "name": "desknotes", "children": [] }, { - "id": "7", + "id": "124", "name": "2 in 1 laptops", "children": [] } ] }, { - "id": "8", + "id": "13", "name": "tablets", "children": [ { - "id": "9", + "id": "131", "name": "ipads", "children": [] }, { - "id": "10", + "id": "132", "name": "android tablets", "children": [] }, { - "id": "11", + "id": "133", "name": "windows tablets", "children": [] } ] }, { - "id": "12", + "id": "14", "name": "smartphones", "children": [ { - "id": "13", + "id": "141", "name": "mini smartphones", "children": [] }, { - "id": "14", + "id": "142", "name": "phablets", "children": [] }, { - "id": "15", + "id": "143", "name": "gaming smartphones", "children": [] }, { - "id": "16", + "id": "144", "name": "rugged smartphones", "children": [] }, { - "id": "17", + "id": "145", "name": "foldable smartphones", "children": [] } ] }, { - "id": "18", + "id": "15", "name": "cameras", "children": [] }, { - "id": "19", + "id": "16", "name": "televisions", "children": [] } ] }, { - "id": "20", + "id": "2", "name": "furnitures", "children": [] }, { - "id": "21", + "id": "3", "name": "accessories", "children": [ { - "id": "22", + "id": "31", "name": "jewelry", "children": [] }, { - "id": "23", + "id": "32", "name": "clothing", "children": [] }, { - "id": "24", + "id": "33", "name": "shoes", "children": [] } diff --git a/examples/function-calling/arguments/chatgpt.sale.input.apple-iphone.json b/examples/function-calling/arguments/chatgpt.sale.input.apple-iphone.json new file mode 100644 index 0000000..16d82ea --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.apple-iphone.json @@ -0,0 +1,1063 @@ +{ + "section_code": "MBP_Pro", + "status": null, + "opened_at": null, + "closed_at": null, + "content": { + "title": "Apple MacBook Pro", + "format": "md", + "body": "**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.**", + "files": [], + "thumbnails": [ + { + "name": "mbp14-spaceblack-gallery1-202410", + "extension": null, + "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" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Color", + "variable": true, + "candidates": [ + { + "name": "Sliver" + }, + { + "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": 100, + "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": 100, + "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": 100, + "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": "Silver/16GB/1TB/Korean", + "price": { + "nominal": 2300000, + "real": 2070000 + }, + "quantity": 100, + "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": "Silver/16GB/2TB/English", + "price": { + "nominal": 2900000, + "real": 2610000 + }, + "quantity": 100, + "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": "Silver/16GB/2TB/Korean", + "price": { + "nominal": 2900000, + "real": 2610000 + }, + "quantity": 100, + "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": "Silver/32GB/512GB/English", + "price": { + "nominal": 2600000, + "real": 2340000 + }, + "quantity": 100, + "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": "Silver/32GB/512GB/Korean", + "price": { + "nominal": 2600000, + "real": 2340000 + }, + "quantity": 100, + "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": "Silver/32GB/1TB/English", + "price": { + "nominal": 2900000, + "real": 2610000 + }, + "quantity": 100, + "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": "Silver/32GB/1TB/Korean", + "price": { + "nominal": 2900000, + "real": 2610000 + }, + "quantity": 100, + "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": "Silver/32GB/2TB/English", + "price": { + "nominal": 3500000, + "real": 3150000 + }, + "quantity": 100, + "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": "Silver/32GB/2TB/Korean", + "price": { + "nominal": 3500000, + "real": 3150000 + }, + "quantity": 100, + "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": "Silver/64GB/512GB/English", + "price": { + "nominal": 3200000, + "real": 2880000 + }, + "quantity": 100, + "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": "Silver/64GB/512GB/Korean", + "price": { + "nominal": 3200000, + "real": 2880000 + }, + "quantity": 100, + "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": "Silver/64GB/1TB/English", + "price": { + "nominal": 3500000, + "real": 3150000 + }, + "quantity": 100, + "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": "Silver/64GB/1TB/Korean", + "price": { + "nominal": 3500000, + "real": 3150000 + }, + "quantity": 100, + "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": "Silver/64GB/2TB/English", + "price": { + "nominal": 4100000, + "real": 3690000 + }, + "quantity": 100, + "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": "Silver/64GB/2TB/Korean", + "price": { + "nominal": 4100000, + "real": 3690000 + }, + "quantity": 100, + "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": "Space Gray/16GB/512GB/English", + "price": { + "nominal": 2050000, + "real": 1845000 + }, + "quantity": 100, + "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": "Space Gray/16GB/512GB/Korean", + "price": { + "nominal": 2050000, + "real": 1845000 + }, + "quantity": 100, + "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": "Space Gray/16GB/1TB/English", + "price": { + "nominal": 2350000, + "real": 2115000 + }, + "quantity": 100, + "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": "Space Gray/16GB/1TB/Korean", + "price": { + "nominal": 2350000, + "real": 2115000 + }, + "quantity": 100, + "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": "Space Gray/16GB/2TB/English", + "price": { + "nominal": 2950000, + "real": 2655000 + }, + "quantity": 100, + "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/Korean", + "price": { + "nominal": 2950000, + "real": 2655000 + }, + "quantity": 100, + "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": "Space Gray/32GB/512GB/English", + "price": { + "nominal": 2650000, + "real": 2385000 + }, + "quantity": 100, + "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": "Space Gray/32GB/512GB/Korean", + "price": { + "nominal": 2650000, + "real": 2385000 + }, + "quantity": 100, + "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": "Space Gray/32GB/1TB/English", + "price": { + "nominal": 2950000, + "real": 2655000 + }, + "quantity": 100, + "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": "Space Gray/32GB/1TB/Korean", + "price": { + "nominal": 2950000, + "real": 2655000 + }, + "quantity": 100, + "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/2TB/English", + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "quantity": 100, + "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": "Space Gray/32GB/2TB/Korean", + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "quantity": 100, + "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/64GB/512GB/English", + "price": { + "nominal": 3250000, + "real": 2925000 + }, + "quantity": 100, + "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": "Space Gray/64GB/512GB/Korean", + "price": { + "nominal": 3250000, + "real": 2925000 + }, + "quantity": 100, + "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": "Space Gray/64GB/1TB/English", + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "quantity": 100, + "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": "Space Gray/64GB/1TB/Korean", + "price": { + "nominal": 3550000, + "real": 3195000 + }, + "quantity": 100, + "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": "Space Gray/64GB/2TB/English", + "price": { + "nominal": 4150000, + "real": 3735000 + }, + "quantity": 100, + "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": "Space Gray/64GB/2TB/Korean", + "price": { + "nominal": 4150000, + "real": 3735000 + }, + "quantity": 100, + "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": true + }, + { + "options": [], + "stocks": [ + { + "name": "Warranty Program", + "price": { + "nominal": 100000, + "real": 90000 + }, + "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": [ + "MacBook", + "Apple", + "Laptop" + ] +} \ 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 new file mode 100644 index 0000000..11e3c1c --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.apple-macbook-pro.json @@ -0,0 +1,1065 @@ +{ + "section_code": "macbook_pro_sale", + "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.**", + "files": [], + "thumbnails": [ + { + "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" + } + ] + }, + "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": false, + "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": true + }, + { + "options": [], + "stocks": [ + { + "name": "Warranty Program", + "price": { + "nominal": 100000, + "real": 90000 + }, + "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": [ + "MacBook Pro", + "Electronics", + "Laptops", + "Apple", + "Computers" + ] +} \ 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/chatgpt.sale.input.apple-vision-pro.json new file mode 100644 index 0000000..f18d967 --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.apple-vision-pro.json @@ -0,0 +1,88 @@ +{ + "section_code": "electronics", + "status": null, + "opened_at": null, + "closed_at": null, + "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\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- **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": [] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Storage Capacity", + "variable": true, + "candidates": [ + { + "name": "256GB" + }, + { + "name": "512GB" + }, + { + "name": "1TB" + } + ] + } + ], + "stocks": [ + { + "name": "256GB Model", + "price": { + "nominal": 2990000, + "real": 2990000 + }, + "quantity": 100, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + } + ] + }, + { + "name": "512GB Model", + "price": { + "nominal": 3490000, + "real": 3490000 + }, + "quantity": 100, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + } + ] + }, + { + "name": "1TB Model", + "price": { + "nominal": 3990000, + "real": 3990000 + }, + "quantity": 100, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + } + ] + } + ], + "name": "Apple Vision Air", + "required": true, + "primary": true + } + ], + "tags": [ + "Apple", + "Augmented Reality", + "Technology", + "Innovation" + ] +} \ 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.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json new file mode 100644 index 0000000..0f9f625 --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.drawfit-women-soft-cashmere-oversized-half-coat.json @@ -0,0 +1,241 @@ +{ + "section_code": "fashion", + "status": null, + "opened_at": null, + "closed_at": null, + "content": { + "title": "Drawfit Women Soft Cashmere Oversized Half Coat", + "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.\n", + "files": [], + "thumbnails": [ + { + "name": "4472993_17274236009691_big", + "extension": "jpg", + "url": "https://image.msscdn.net/thumbnails/images/goods_img/20240927/4472993/4472993_17274236009691_big.jpg?w=1200" + }, + { + "name": "3552514_17276848381488_big", + "extension": "jpg", + "url": "https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552514/3552514_17276848381488_big.jpg?w=1200" + }, + { + "name": "3552513_17276848899638_big", + "extension": "jpg", + "url": "https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552513/3552513_17276848899638_big.jpg?w=1200" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Size", + "variable": true, + "candidates": [ + { + "name": "XS" + }, + { + "name": "S" + }, + { + "name": "M" + } + ] + }, + { + "type": "select", + "name": "Color", + "variable": true, + "candidates": [ + { + "name": "GREY" + }, + { + "name": "NAVY" + }, + { + "name": "BUTTER" + } + ] + } + ], + "stocks": [ + { + "name": "XS-GREY", + "price": { + "nominal": 220000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "XS-NAVY", + "price": { + "nominal": 220000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "XS-BUTTER", + "price": { + "nominal": 220000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + }, + { + "name": "S-GREY", + "price": { + "nominal": 240000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "S-NAVY", + "price": { + "nominal": 240000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "S-BUTTER", + "price": { + "nominal": 240000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + }, + { + "name": "M-GREY", + "price": { + "nominal": 260000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "M-NAVY", + "price": { + "nominal": 260000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "M-BUTTER", + "price": { + "nominal": 260000, + "real": 198000 + }, + "quantity": 300, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + } + ], + "name": "Drawfit Coat Variants", + "required": true, + "primary": true + } + ], + "tags": [ + "winter", + "Women", + "Coat", + "fashion", + "soft cashmere" + ] +} \ 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.sale.input.herman-miller-chair.json new file mode 100644 index 0000000..88722e9 --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.herman-miller-chair.json @@ -0,0 +1,209 @@ +{ + "section_code": "furniture", + "status": null, + "opened_at": null, + "closed_at": null, + "content": { + "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. \"Timeless Design\": Combining aesthetics with functionality, this chair fits seamlessly into any environment, adding a touch of elegance to your space. \"Adjustable Comfort\": With customizable settings, the Herman Miller chair adapts to your body, promoting better posture and reducing fatigue. \"Built to Last\": Made from durable materials, this chair is designed for longevity, making it a worthwhile investment for anyone seeking quality seating. In 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": "", + "extension": null, + "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRaJWHEnwGGg-8rHni_2hN8HKUSkEBdU3X4w&s" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Model", + "variable": true, + "candidates": [ + { + "name": "Aeron" + }, + { + "name": "Embody" + } + ] + }, + { + "type": "select", + "name": "Color", + "variable": true, + "candidates": [ + { + "name": "Black" + }, + { + "name": "Gray" + }, + { + "name": "White" + } + ] + } + ], + "stocks": [ + { + "name": "Aeron Black", + "price": { + "nominal": 1200000, + "real": 1099000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "Aeron Gray", + "price": { + "nominal": 1200000, + "real": 1099000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "Aeron White", + "price": { + "nominal": 1200000, + "real": 1099000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + }, + { + "name": "Embody Black", + "price": { + "nominal": 1800000, + "real": 1599000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "Embody Gray", + "price": { + "nominal": 1800000, + "real": 1599000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "Embody White", + "price": { + "nominal": 1800000, + "real": 1599000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + } + ], + "name": "Herman Miller Chair", + "required": true, + "primary": true + }, + { + "options": [], + "stocks": [ + { + "name": "Single", + "price": { + "nominal": 100000, + "real": 89000 + }, + "quantity": 10000, + "choices": [] + } + ], + "name": "Warranty Program", + "required": false, + "primary": false + }, + { + "options": [], + "stocks": [ + { + "name": "Single", + "price": { + "nominal": 50000, + "real": 39000 + }, + "quantity": 5000, + "choices": [] + } + ], + "name": "Replacement Cushion", + "required": false, + "primary": false + } + ], + "tags": [ + "HermanMiller", + "Furniture", + "Chair", + "Ergonomic", + "Office", + "Comfort" + ] +} \ No newline at end of file diff --git a/examples/function-calling/sale.input.json b/examples/function-calling/arguments/chatgpt.sale.input.json similarity index 56% rename from examples/function-calling/sale.input.json rename to examples/function-calling/arguments/chatgpt.sale.input.json index 2689014..f88825c 100644 --- a/examples/function-calling/sale.input.json +++ b/examples/function-calling/arguments/chatgpt.sale.input.json @@ -1,14 +1,30 @@ { - "section_code": "default", + "section_code": "SP9-Sale", "status": null, "opened_at": null, "closed_at": null, "content": { - "title": "Surface Pro 8", + "title": "Surface Pro 9", "format": "md", - "body": "The best laptop for your daily needs.", + "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": [] + "thumbnails": [ + { + "name": "thumbnail1", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg" + }, + { + "name": "thumbnail2", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg" + }, + { + "name": "thumbnail3", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg" + } + ] }, "units": [ { @@ -64,10 +80,10 @@ ], "stocks": [ { - "name": "Intel Core i3 / 8 GB RAM / 128 GB Storage", + "name": "i3, 8 GB, 128 GB", "price": { - "nominal": 999, - "real": 899 + "nominal": 1000000, + "real": 899000 }, "quantity": 1000, "choices": [ @@ -86,10 +102,10 @@ ] }, { - "name": "Intel Core i3 / 16 GB RAM / 256 GB Storage", + "name": "i3, 16 GB, 256 GB", "price": { - "nominal": 1199, - "real": 1099 + "nominal": 1200000, + "real": 1099000 }, "quantity": 1000, "choices": [ @@ -108,10 +124,10 @@ ] }, { - "name": "Intel Core i3 / 16 GB RAM / 512 GB Storage", + "name": "i3, 16 GB, 512 GB", "price": { - "nominal": 1399, - "real": 1299 + "nominal": 1400000, + "real": 1299000 }, "quantity": 1000, "choices": [ @@ -130,10 +146,10 @@ ] }, { - "name": "Intel Core i5 / 16 GB RAM / 256 GB Storage", + "name": "i5, 16 GB, 256 GB", "price": { - "nominal": 1499, - "real": 1399 + "nominal": 1500000, + "real": 1399000 }, "quantity": 1000, "choices": [ @@ -152,10 +168,10 @@ ] }, { - "name": "Intel Core i5 / 32 GB RAM / 512 GB Storage", + "name": "i5, 32 GB, 512 GB", "price": { - "nominal": 1799, - "real": 1699 + "nominal": 1800000, + "real": 1699000 }, "quantity": 1000, "choices": [ @@ -174,10 +190,10 @@ ] }, { - "name": "Intel Core i7 / 16 GB RAM / 512 GB Storage", + "name": "i7, 16 GB, 512 GB", "price": { - "nominal": 1799, - "real": 1699 + "nominal": 1800000, + "real": 1699000 }, "quantity": 1000, "choices": [ @@ -196,10 +212,10 @@ ] }, { - "name": "Intel Core i7 / 32 GB RAM / 512 GB Storage", + "name": "i7, 32 GB, 512 GB", "price": { - "nominal": 1999, - "real": 1899 + "nominal": 2000000, + "real": 1899000 }, "quantity": 1000, "choices": [ @@ -219,26 +235,49 @@ } ], "required": true, - "name": "Surface Pro 8 Entity", + "name": "Surface Pro 9 Entity", "primary": true }, { "options": [], "stocks": [ { - "name": "Standard Warranty", + "name": "Warranty Program", "price": { - "nominal": 99, - "real": 89 + "nominal": 100000, + "real": 89000 }, - "quantity": 1000, + "quantity": 10000, "choices": [] } ], "required": false, "name": "Warranty Program", "primary": false + }, + { + "options": [], + "stocks": [ + { + "name": "Magnetic Keyboard", + "price": { + "nominal": 200000, + "real": 169000 + }, + "quantity": 8000, + "choices": [] + } + ], + "required": false, + "name": "Magnetic Keyboard", + "primary": false } ], - "tags": [] + "tags": [ + "surface", + "laptop", + "tablet", + "2-in-1", + "tech" + ] } \ 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.sale.input.leica-m6.json new file mode 100644 index 0000000..0231304 --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.leica-m6.json @@ -0,0 +1,99 @@ +{ + "section_code": "Cameras&Photography", + "status": null, + "opened_at": null, + "closed_at": null, + "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.", + "files": [], + "thumbnails": [ + { + "name": "pm-84724-10557_leica_m6_black_front_1", + "extension": "png", + "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_packaging_ambient_3840x2160", + "extension": "jpg.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" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Finish", + "variable": true, + "candidates": [ + { + "name": "Black Paint Finish" + }, + { + "name": "Silver Chrome Finish" + } + ] + } + ], + "stocks": [ + { + "name": "Black Paint Finish", + "price": { + "nominal": 7200000, + "real": 6899000 + }, + "quantity": 500, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + } + ] + }, + { + "name": "Silver Chrome Finish", + "price": { + "nominal": 7200000, + "real": 6899000 + }, + "quantity": 500, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + } + ] + } + ], + "name": "Leica M6 Body (2022 Reissue)", + "required": true, + "primary": true + }, + { + "options": [], + "stocks": [ + { + "name": "50mm Summilux Lens", + "price": { + "nominal": 5200000, + "real": 4999000 + }, + "quantity": 1000, + "choices": [] + } + ], + "name": "50mm Summilux Lens", + "required": false, + "primary": false + } + ], + "tags": [ + "Leica", + "Camera", + "Film Photography", + "Classic" + ] +} \ 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/chatgpt.sale.input.microsoft-surface-pro-9.json new file mode 100644 index 0000000..8f46f60 --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.microsoft-surface-pro-9.json @@ -0,0 +1,286 @@ +{ + "section_code": "tech-gadgets", + "status": null, + "opened_at": null, + "closed_at": null, + "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": "surfpro9a", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg" + }, + { + "name": "surfpro9b", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg" + }, + { + "name": "surfpro9c", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "CPU", + "variable": true, + "candidates": [ + { + "name": "Intel Core i3" + }, + { + "name": "Intel Core i5" + }, + { + "name": "Intel Core i7" + } + ] + }, + { + "type": "select", + "name": "RAM", + "variable": true, + "candidates": [ + { + "name": "8 GB" + }, + { + "name": "16 GB" + }, + { + "name": "32 GB" + } + ] + }, + { + "type": "select", + "name": "Storage", + "variable": true, + "candidates": [ + { + "name": "128 GB" + }, + { + "name": "256 GB" + }, + { + "name": "512 GB" + } + ] + } + ], + "stocks": [ + { + "name": "Entry Model", + "price": { + "nominal": 1000000, + "real": 899000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + }, + { + "option_index": 2, + "candidate_index": 0 + } + ] + }, + { + "name": "i3 Enhanced", + "price": { + "nominal": 1200000, + "real": 1099000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + } + ] + }, + { + "name": "i3 Premium", + "price": { + "nominal": 1400000, + "real": 1299000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + } + ] + }, + { + "name": "i5 Standard", + "price": { + "nominal": 1500000, + "real": 1399000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 1 + } + ] + }, + { + "name": "i5 High Performance", + "price": { + "nominal": 1800000, + "real": 1699000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 2 + }, + { + "option_index": 2, + "candidate_index": 2 + } + ] + }, + { + "name": "i7 Standard", + "price": { + "nominal": 1800000, + "real": 1699000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + }, + { + "option_index": 1, + "candidate_index": 1 + }, + { + "option_index": 2, + "candidate_index": 2 + } + ] + }, + { + "name": "i7 Ultimate", + "price": { + "nominal": 2000000, + "real": 1899000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + }, + { + "option_index": 1, + "candidate_index": 2 + }, + { + "option_index": 2, + "candidate_index": 2 + } + ] + } + ], + "name": "Surface Pro 9 Entity", + "required": true, + "primary": true + }, + { + "options": [], + "stocks": [ + { + "name": "Extended Warranty", + "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": [ + "SurfacePro9", + "laptop", + "tablet", + "2-in-1", + "Microsoft", + "portable", + "tech", + "electronics" + ] +} \ 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.sale.input.samsung-galaxy-watch-7.json new file mode 100644 index 0000000..d3d30bf --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.samsung-galaxy-watch-7.json @@ -0,0 +1,208 @@ +{ + "section_code": "galaxy_watch", + "status": null, + "opened_at": null, + "closed_at": null, + "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", + "extension": "png", + "url": "https://images.samsung.com/kdp/goods/2024/07/07/597615f6-b6f9-4ae4-a93d-cbba6bdde2c6.png?$944_550_PNG$" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Model", + "variable": true, + "candidates": [ + { + "name": "Standard" + }, + { + "name": "Ultra" + } + ] + }, + { + "type": "select", + "name": "Color", + "variable": true, + "candidates": [ + { + "name": "Green" + }, + { + "name": "Silver" + }, + { + "name": "Cream" + } + ] + } + ], + "stocks": [ + { + "name": "Standard, Green", + "price": { + "nominal": 400000, + "real": 359000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "Standard, Silver", + "price": { + "nominal": 400000, + "real": 359000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "Standard, Cream", + "price": { + "nominal": 400000, + "real": 359000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + }, + { + "name": "Ultra, Green", + "price": { + "nominal": 600000, + "real": 549000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "Ultra, Silver", + "price": { + "nominal": 600000, + "real": 549000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "Ultra, Cream", + "price": { + "nominal": 600000, + "real": 549000 + }, + "quantity": 1000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + } + ], + "name": "Galaxy Watch 7", + "required": true, + "primary": true + }, + { + "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 + } + ], + "tags": [ + "smartwatch", + "Galaxy Watch", + "Samsung", + "technology", + "wearable" + ] +} \ No newline at end of file diff --git a/examples/function-calling/arguments/chatgpt.sale.input.stanley-tumbler-collection.json b/examples/function-calling/arguments/chatgpt.sale.input.stanley-tumbler-collection.json new file mode 100644 index 0000000..b55a8f1 --- /dev/null +++ b/examples/function-calling/arguments/chatgpt.sale.input.stanley-tumbler-collection.json @@ -0,0 +1,157 @@ +{ + "section_code": "stanley_tumbler_collection", + "status": null, + "opened_at": null, + "closed_at": null, + "content": { + "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\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.", + "files": [], + "thumbnails": [ + { + "name": "stanley_tumbler", + "extension": "jpeg", + "url": "https://serpapi.com/searches/673d71322c566d56d9c20ceb/images/ce9a07f2aa831dbec8bb1c287299706e24a52a8e0c119fa162041805038957a7.jpeg" + } + ] + }, + "units": [ + { + "options": [ + { + "type": "select", + "name": "Capacity", + "variable": true, + "candidates": [ + { + "name": "16 oz" + }, + { + "name": "20 oz" + }, + { + "name": "24 oz" + } + ] + }, + { + "type": "select", + "name": "Color Options", + "variable": true, + "candidates": [ + { + "name": "Matte Black" + }, + { + "name": "Hammertone Green" + }, + { + "name": "Polar White" + } + ] + } + ], + "stocks": [ + { + "name": "16 oz, Matte Black", + "price": { + "nominal": 40000, + "real": 35000 + }, + "quantity": 2000, + "choices": [ + { + "option_index": 0, + "candidate_index": 0 + }, + { + "option_index": 1, + "candidate_index": 0 + } + ] + }, + { + "name": "20 oz, Hammertone Green", + "price": { + "nominal": 50000, + "real": 44000 + }, + "quantity": 2000, + "choices": [ + { + "option_index": 0, + "candidate_index": 1 + }, + { + "option_index": 1, + "candidate_index": 1 + } + ] + }, + { + "name": "24 oz, Polar White", + "price": { + "nominal": 60000, + "real": 54000 + }, + "quantity": 2000, + "choices": [ + { + "option_index": 0, + "candidate_index": 2 + }, + { + "option_index": 1, + "candidate_index": 2 + } + ] + } + ], + "name": "Classic Tumbler", + "required": true, + "primary": true + }, + { + "options": [], + "stocks": [ + { + "name": "Adventure Quencher Tumbler", + "price": { + "nominal": 70000, + "real": 64000 + }, + "quantity": 5000, + "choices": [] + } + ], + "name": "Adventure Quencher Tumbler", + "required": false, + "primary": false + }, + { + "options": [], + "stocks": [ + { + "name": "Accessories Set", + "price": { + "nominal": 20000, + "real": 18000 + }, + "quantity": 10000, + "choices": [] + } + ], + "name": "Accessories Set", + "required": false, + "primary": false + } + ], + "tags": [ + "Tumblers", + "Stanley", + "Drinkware", + "Eco-friendly", + "Hydration" + ] +} \ No newline at end of file diff --git a/examples/function-calling/tags.input.json b/examples/function-calling/arguments/chatgpt.tags.input.json similarity index 100% rename from examples/function-calling/tags.input.json rename to examples/function-calling/arguments/chatgpt.tags.input.json diff --git a/examples/function-calling/prompts/apple-iphone.md b/examples/function-calling/prompts/apple-iphone.md new file mode 100644 index 0000000..6e0cc9a --- /dev/null +++ b/examples/function-calling/prompts/apple-iphone.md @@ -0,0 +1,75 @@ +### Preface + +I will create a sale with the following details. + +### Content + +At First, title of the sale is “Apple MacBook Pro”. + +Below is the content body of the sale. + +> MacBook Pro +> +> +> **The Ultimate Tool for Professionals** +> +> MacBook 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. +> +> - **Remarkable Performance** +> +> Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency. +> +> - **Outstanding Display** +> +> 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. +> +> - **All-Day Battery Life** +> +> 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. +> +> - **Sleek Yet Powerful Design** +> +> A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go. +> +> - **Smart Connectivity** +> +> Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment. +> +> +> With MacBook Pro, your potential knows no bounds. **It’s time to rediscover what you’re capable of.** +> + +The base price starts from KRW 2_000_000, and the price may be added depending on the options. However, the final price should always be marked with a 10% discount. + +About the thumbnail images, please fill from the below image URL addresses. + +- 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 + +### SKU + +Also, it has only three unit, the "MacBook M3 Pro 14inch Entity", "Warranty Program" and "Magnetic Keyboard". + +About the "Warranty Program" unit, it is not essential to the sale, and there is no option to select. Its nominal price is ₩100_000 and the real price is ₩89_000, and its initial quantity is 10_000. + +About the "Magnetic Keyboard" unit, it is not essential to the sale, and there is no option to selet either. Its nominal price is ₩200_000, and the real price is ₩169_000. Its initial quantity is 8_000. + +About the "MacBook Pro Entity", it is essential to the sale, and there are many options like below. Its list start from the option name, and their nested lists are formed with candidate and and its additional price. + +Compose the SKU records by cartesian product with below option list. Note that, you must multiply every selectable option candidate values of below, and sum of every additional price of selected options and add the starting price KRW 2_000_000. + +For reference, as number of SKU from the below list is (`2 * 3 * 3 * 2 = 36`), you have to compose entirely 36 stock records. If an user selects a stock of { Silver (+0) / 32GB (+600_000) / 1TB (+300_000) / English (+0) = 900_000 KRW } options, its nominal price must be 2_900_000 KRW including the starting price 2_000_000 KRW. + +- Color + - Sliver (+0₩) + - Space Gray (+50_000₩) +- RAM + - 16GB (+0₩) + - 32GB (+600_000₩) + - 64GB (+1_200_000₩) +- SSD + - 512GB (+0₩) + - 1TB (+300_000₩) + - 2TB (+900_000₩) +- Keyboard Language + - English (+0₩) + - Korean (+0₩) \ No newline at end of file diff --git a/examples/function-calling/prompts/apple-macbook-pro.md b/examples/function-calling/prompts/apple-macbook-pro.md new file mode 100644 index 0000000..5829244 --- /dev/null +++ b/examples/function-calling/prompts/apple-macbook-pro.md @@ -0,0 +1,114 @@ +### Preface + +I will create a sale with the following details. + +### Content + +At First, title of the sale is “Apple MacBook Pro”. + +Below is the content body of the sale. + +> MacBook Pro +> +> +> **The Ultimate Tool for Professionals** +> +> MacBook 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. +> +> - **Remarkable Performance** +> +> Powered by the next-generation chip, it handles demanding tasks and complex projects effortlessly, delivering unmatched speed and efficiency. +> +> - **Outstanding Display** +> +> 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. +> +> - **All-Day Battery Life** +> +> 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. +> +> - **Sleek Yet Powerful Design** +> +> A precision aluminum body that’s lightweight yet durable, paired with a minimalist design that stands out on your desk and on the go. +> +> - **Smart Connectivity** +> +> Versatile ports for high-speed data transfer and seamless compatibility ensure you're ready for any work environment. +> +> +> With MacBook Pro, your potential knows no bounds. **It’s time to rediscover what you’re capable of.** +> + +The base price starts from KRW 2_000_000, and the price may be added depending on the options. However, the final price should always be marked with a 10% discount. + +About the thumbnail images, please fill from the below image URL addresses. + +- 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 + +### SKU + +Also, it has only three unit, the "MacBook M3 Pro 14inch Entity", "Warranty Program" and "Magnetic Keyboard". + +About the "Warranty Program" unit, it is not essential to the sale, and there is no option to select. Its nominal price is ₩100_000 and the real price is ₩89_000, and its initial quantity is 10_000. + +About the "Magnetic Keyboard" unit, it is not essential to the sale, and there is no option to selet either. Its nominal price is ₩200_000, and the real price is ₩169_000. Its initial quantity is 8_000. + +About the "MacBook Pro Entity", it is essential to the sale, and there are many options like below. Its list start from the option name, and their nested lists are formed with candidate and and its additional price. And every stocks of it has 10,000 initial quantity. + +Compose the SKU records by cartesian product with below option list. Note that, you must multiply every selectable option candidate values of below, and sum of every additional price of selected options and add the starting price KRW 2_000_000. + +For reference, as number of SKU from the below list is (`2 * 3 * 3 * 2 = 36`), you have to compose entirely 36 stock records. If an user selects a stock of { Silver (+0) / 32GB (+600_000) / 1TB (+300_000) / English (+0) = 900_000 KRW } options, its nominal price must be 2_900_000 KRW including the starting price 2_000_000 KRW. + +- Color + - Sliver (+0₩) + - Space Gray (+50_000₩) +- RAM + - 16GB (+0₩) + - 32GB (+600_000₩) + - 64GB (+1_200_000₩) +- SSD + - 512GB (+0₩) + - 1TB (+300_000₩) + - 2TB (+900_000₩) +- Keyboard Language + - English (+0₩) + - Korean (+0₩) + +The final stocks combinated by options are like below. + +1. **Silver | 16GB | 512GB | English** | 2,000,000₩ +2. **Silver | 16GB | 512GB | Korean** | 2,000,000₩ +3. **Silver | 16GB | 1TB | English** | 2,300,000₩ +4. **Silver | 16GB | 1TB | Korean** | 2,300,000₩ +5. **Silver | 16GB | 2TB | English** | 2,900,000₩ +6. **Silver | 16GB | 2TB | Korean** | 2,900,000₩ +7. **Silver | 32GB | 512GB | English** | 2,600,000₩ +8. **Silver | 32GB | 512GB | Korean** | 2,600,000₩ +9. **Silver | 32GB | 1TB | English** | 2,900,000₩ +10. **Silver | 32GB | 1TB | Korean** | 2,900,000₩ +11. **Silver | 32GB | 2TB | English** | 3,500,000₩ +12. **Silver | 32GB | 2TB | Korean** | 3,500,000₩ +13. **Silver | 64GB | 512GB | English** | 3,200,000₩ +14. **Silver | 64GB | 512GB | Korean** | 3,200,000₩ +15. **Silver | 64GB | 1TB | English** | 3,500,000₩ +16. **Silver | 64GB | 1TB | Korean** | 3,500,000₩ +17. **Silver | 64GB | 2TB | English** | 4,100,000₩ +18. **Silver | 64GB | 2TB | Korean** | 4,100,000₩ +19. **Space Gray | 16GB | 512GB | English** | 2,050,000₩ +20. **Space Gray | 16GB | 512GB | Korean** | 2,050,000₩ +21. **Space Gray | 16GB | 1TB | English** | 2,350,000₩ +22. **Space Gray | 16GB | 1TB | Korean** | 2,350,000₩ +23. **Space Gray | 16GB | 2TB | English** | 2,950,000₩ +24. **Space Gray | 16GB | 2TB | Korean** | 2,950,000₩ +25. **Space Gray | 32GB | 512GB | English** | 2,650,000₩ +26. **Space Gray | 32GB | 512GB | Korean** | 2,650,000₩ +27. **Space Gray | 32GB | 1TB | English** | 2,950,000₩ +28. **Space Gray | 32GB | 1TB | Korean** | 2,950,000₩ +29. **Space Gray | 32GB | 2TB | English** | 3,550,000₩ +30. **Space Gray | 32GB | 2TB | Korean** | 3,550,000₩ +31. **Space Gray | 64GB | 512GB | English** | 3,250,000₩ +32. **Space Gray | 64GB | 512GB | Korean** | 3,250,000₩ +33. **Space Gray | 64GB | 1TB | English** | 3,550,000₩ +34. **Space Gray | 64GB | 1TB | Korean** | 3,550,000₩ +35. **Space Gray | 64GB | 2TB | English** | 4,150,000₩ +36. **Space Gray | 64GB | 2TB | Korean** | 4,150,000₩ \ No newline at end of file diff --git a/examples/function-calling/prompts/apple-vision-pro.md b/examples/function-calling/prompts/apple-vision-pro.md new file mode 100644 index 0000000..a2f1718 --- /dev/null +++ b/examples/function-calling/prompts/apple-vision-pro.md @@ -0,0 +1,32 @@ +### Product Introduction + +Apple Vision Air + +### Preface + +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. + +### Content + +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. + +The 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. + +### Key Features + +Augmented Reality Capabilities: Experience a new dimension of interaction with AR applications that enhance everyday tasks and entertainment. + +High-Resolution Display: Enjoy vibrant and crisp visuals, making every detail come to life. +Intuitive Controls: Navigate effortlessly with gesture controls and voice commands, designed for user convenience. + +Seamless Integration: Connect with other Apple devices for a unified ecosystem that enhances productivity and creativity. + +Durability and Comfort: Built with premium materials, the Vision Air ensures longevity and comfort during prolonged use. + +### SKU + +AVA-2023-001 | 256GB | ₩2,990,000 + +AVA-2023-002 | 512GB | ₩3,490,000 + +AVA-2023-003 | 1TB | ₩3,990,000 \ No newline at end of file diff --git a/examples/function-calling/prompts/drawfit-women-soft-cashmere-oversized-half-coat.md b/examples/function-calling/prompts/drawfit-women-soft-cashmere-oversized-half-coat.md new file mode 100644 index 0000000..753191f --- /dev/null +++ b/examples/function-calling/prompts/drawfit-women-soft-cashmere-oversized-half-coat.md @@ -0,0 +1,44 @@ +### Preface + +I will create a sale with the following details. + +### Content + +The title of the sale is "Drawfit Women Soft Cashmere Oversized Half Coat." + +Below is the content for the coat. + +> 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. +> +> - "Comfortable Fit": Made from soft materials, it can be worn comfortably without irritating the skin. +> - "Stylish Oversized Design": The relaxed fit allows for easy layering, suitable for both casual daily looks and formal occasions. +> - Luxurious Design": With classic colors and minimal details, it easily matches with any outfit. +> - "Warmth and Elegance": A perfect choice to stay warm in winter while maintaining a stylish appearance. +> +> In 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. +> + +Please fill in the thumbnail images with the following URLs. + +- https://image.msscdn.net/thumbnails/images/goods_img/20240927/4472993/4472993_17274236009691_big.jpg?w=1200 +- https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552514/3552514_17276848381488_big.jpg?w=1200 +- https://image.msscdn.net/thumbnails/images/goods_img/20230912/3552513/3552513_17276848899638_big.jpg?w=1200 + +### SKU + +The coat is available in various sizes. Here are the details for each product. + +- Sizes: XS, S, M +- Colors: GREY, NAVY, BUTTER + +The initial stock for each size and color combination is set to 300 units. + +- (XS, GREY): (₩220,000 / ₩198,000) +- (XS, NAVY): (₩220,000 / ₩198,000) +- (XS, BUTTER): (₩220,000 / ₩198,000) +- (S, GREY): (₩240,000 / ₩198,000) +- (S, NAVY): (₩240,000 / ₩198,000) +- (S, BUTTER): (₩240,000 / ₩198,000) +- (M, GREY): (₩260,000 / ₩198,000) +- (M, NAVY): (₩260,000 / ₩198,000) +- (M, BUTTER): (₩260,000 / ₩198,000) \ No newline at end of file diff --git a/examples/function-calling/prompts/herman-miller-chair.md b/examples/function-calling/prompts/herman-miller-chair.md new file mode 100644 index 0000000..8912381 --- /dev/null +++ b/examples/function-calling/prompts/herman-miller-chair.md @@ -0,0 +1,50 @@ +## Preface + +I will create a sale with the following details. + +## Content + +The title of the sale is "Herman Miller Chair". + +Below is the content body of the sale. + +> 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. +> + +> "Elevate Your Workspace": The Herman Miller chair enhances your productivity with its ergonomic features, ensuring you stay comfortable during long hours of work. +"Timeless Design": Combining aesthetics with functionality, this chair fits seamlessly into any environment, adding a touch of elegance to your space. +"Adjustable Comfort": With customizable settings, the Herman Miller chair adapts to your body, promoting better posture and reducing fatigue. +"Built to Last": Made from durable materials, this chair is designed for longevity, making it a worthwhile investment for anyone seeking quality seating. +In 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. +> + +About the thumbnail images, please fill from the below image URL addresses. + + - https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRaJWHEnwGGg-8rHni_2hN8HKUSkEBdU3X4w&s + +## SKU + +Also, it has only three units: the "Herman Miller Chair", "Warranty Program", and "Replacement Cushion". + +About the "Warranty Program" unit, it is not essential to the sale, and there is no option to select. Its nominal price is ₩100,000 and the real price is ₩89,000, and its initial quantity is 10,000. + +About the "Replacement Cushion" unit, it is not essential to the sale, and there is no option to select either. Its nominal price is ₩50,000, and the real price is ₩39,000. Its initial quantity is 5,000. + +About the "Herman Miller Chair", it is essential to the sale, and there are two options to select like below. + +- Model + - Aeron + - Embody +- Color + - Black + - Gray + - White + +The final stocks combined by the options are like below. The sequence of selected options are {(Model, Color): (nominal price / real price)}. Also, the initial quantity of them is fixed to 1,000 value. + +- (Aeron, Black): (₩1,200,000 / ₩1,099,000) +- (Aeron, Gray): (₩1,200,000 / ₩1,099,000) +- (Aeron, White): (₩1,200,000 / ₩1,099,000) +- (Embody, Black): (₩1,800,000 / ₩1,599,000) +- (Embody, Gray): (₩1,800,000 / ₩1,599,000) +- (Embody, White): (₩1,800,000 / ₩1,599,000) \ No newline at end of file diff --git a/examples/function-calling/prompts/leica-m6.md b/examples/function-calling/prompts/leica-m6.md new file mode 100644 index 0000000..63c8f0c --- /dev/null +++ b/examples/function-calling/prompts/leica-m6.md @@ -0,0 +1,38 @@ +### Preface + +I will create a sale with the following details. + +### Content + +At first, the title of the sale is **"Leica M6 (2022 Reissue): The Return of a Legend"**. + +Below is the content body of the sale. + +> 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. +> +> - **"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. +> - **"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. +> - **"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. +> - **"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. +> +> 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. +> + +About the thumbnail images, please fill from the below image URL addresses. + +- hhttps://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 +- https://leica-camera.com/sites/default/files/styles/r_media_fullscreen/public/2022-09/leica_m6_packaging_ambient_3840x2160.jpg.webp?itok=lig4kkiB + +### SKU + +This sale includes two main items: **Leica M6 Body (2022 Reissue)** and **50mm Summilux Lens**. + +**Leica M6 Body (2022 Reissue)** is essential to the sale and available in two finishes: + +- **Black Paint Finish** (Nominal Price: ₩7,200,000 / Real Price: ₩6,899,000) +- **Silver Chrome Finish** (Nominal Price: ₩7,200,000 / Real Price: ₩6,899,000)Initial quantity for each finish: **500 units**. + +**50mm Summilux Lens** is optional with the following details: + +- Nominal Price: ₩5,200,000 +- Real Price: ₩4,999,000Initial quantity: **1,000 units**. \ No newline at end of file diff --git a/examples/function-calling/prompts/microsoft-surface-pro-9.md b/examples/function-calling/prompts/microsoft-surface-pro-9.md new file mode 100644 index 0000000..882da1c --- /dev/null +++ b/examples/function-calling/prompts/microsoft-surface-pro-9.md @@ -0,0 +1,54 @@ +### Preface +I will create a sale with the following details. + +### Content +At first, title of the sale is "Surface Pro 9". + +Below is the content body of the sale. + +> 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. +> +> - "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. +> - "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. +> - "Stay Connected with 5G": Experience lightning-fast internet speeds and seamless connectivity, no matter where you are. +> - "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. +> +> In 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. + +About the thumbnail images, please fill from the below image URL addresses. + + - https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7509f1af89c326cb41749301b94375eb5680b9bddcdf88fabcb.jpeg + - https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb750d6c1bc749467f5aba0340886f4f4943fe72302c5e658b15a.jpeg + - https://serpapi.com/searches/673d3a37e45f3316ecd8ab3e/images/1be25e6e2b1fb7505946d975aac683f8826bcb8c509672de4a5f8c71f149fdef.jpeg + +### SKU +Also, it has only three unit, the "Surface Pro 9 Entity", "Warranty Program" and "Magnetic Keyboard". + +About the "Warranty Program" unit, it is not essential to the sale, and there is no option to select. Its nominal price is ₩100_000 and the real price is ₩89_000, and its initial quantity is 10_000. + +About the "Magnetic Keyboard" unit, it is not essential to the sale, and there is no option to selet either. Its nominal price is ₩200_000, and the real price is ₩169_000. Its initial quantity is 8_000. + +About the "Surface Pro 8 Entity", it is essential to the sale, and there are three options to select like below. + + - CPU + - Intel Core i3 + - Intel Core i5 + - Intel Core i7 + - RAM + - 8 GB + - 16 GB + - 32 GB + - Storage + - 128 GB + - 256 GB + - 512 GB + +The final stocks combinated by the options are like below. The sequence of selected options are {(CPU, RAM, Storage): (nominal price / real price)}. Also, initial quantity of them are fixed to 1,000 value. + + - (i3, 8 GB, 128 GB): (₩1_000_000 / ₩899_000) + - (i3, 16 GB, 256 GB): (₩1_200_000 / ₩1_099_000) + - (i3, 16 GB, 512 GB): (₩1_400_000 / ₩1_299_000) + - (i5, 16 GB, 256 GB): (₩1_500_000 / ₩1_399_000) + - (i5, 32 GB, 512 GB): (₩1_800_000 / ₩1_699_000) + - (i7, 16 GB, 512 GB): (₩1_800_000 / ₩1_699_000) + - (i7, 32 GB, 512 GB): (₩2_000_000 / ₩1_899_000) \ No newline at end of file diff --git a/examples/function-calling/prompts/samsung-galaxy-watch-7.md b/examples/function-calling/prompts/samsung-galaxy-watch-7.md new file mode 100644 index 0000000..6086d66 --- /dev/null +++ b/examples/function-calling/prompts/samsung-galaxy-watch-7.md @@ -0,0 +1,50 @@ +## **Preface** + +I will create a sale with the following details. + +## **Content** + +The title of the sale is “Galaxy Watch 7.” + +Below is the content body of the sale. + +> 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/)) +> +> “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. +> +> “Enhanced Workout Tracking”: Supports a wide range of workout modes and provides detailed data such as heart rate and calorie burn. +> +> “Powerful Performance”: Equipped with the latest processor and long battery life, it offers stable performance for everything from daily use to high-intensity workouts. +> +> In 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. + +About the thumbnail images, please fill them from the below image URL addresses. + +![galaxy-watch-7.png](https://images.samsung.com/kdp/goods/2024/07/07/597615f6-b6f9-4ae4-a93d-cbba6bdde2c6.png?$944_550_PNG$) + +## **SKU** + +This sale includes three units: the “Galaxy Watch 7,” “Warranty Program,” and “Replacement Strap.” + +- **Warranty Program**: It is not an essential unit for the sale and has no selectable options. Its nominal price is ₩100,000, with a discounted price of ₩89,000. The initial quantity is 10,000. +- **Replacement Strap**: It is also not an essential unit for the sale and has no selectable options. Its nominal price is ₩50,000, with a discounted price of ₩39,000. The initial quantity is 5,000. +- **Galaxy Watch 7**: This is an essential unit for the sale, and it comes with the following selectable options: + - **Model** + - Standard + - Ultra + - **Color** + - Green + - Silver + - Cream + +The "Galaxy Watch 7" unit's final stock for each combination of options is as follows. The sequence of selected options is represented as {(Model, Color): (nominal price / discounted price)}. The initial quantity for each combination is fixed at 1,000 units. + +- (Standard, Green): (₩400,000 / ₩359,000) +- (Standard, Silver): (₩400,000 / ₩359,000) +- (Standard, Cream): (₩400,000 / ₩359,000) +- (Ultra, Green): (₩600,000 / ₩549,000) +- (Ultra, Silver): (₩600,000 / ₩549,000) +- (Ultra, Cream): (₩600,000 / ₩549,000) + +Please use the above details to prepare the sale. \ No newline at end of file diff --git a/examples/function-calling/prompts/stanley-tumbler-collection.md b/examples/function-calling/prompts/stanley-tumbler-collection.md new file mode 100644 index 0000000..e679935 --- /dev/null +++ b/examples/function-calling/prompts/stanley-tumbler-collection.md @@ -0,0 +1,63 @@ +### Preface + +I will create a sale with the following details. + +### Stanley Tumbler Collection + +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! + +### Product Description + +> 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. +> +> - **"Built for Adventure"**: The Stanley Tumbler features rugged construction, making it ideal for outdoor enthusiasts and urban adventurers alike. +> - **"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. +> - **"Leakproof and Spillproof"**: Designed for ease of use, these tumblers are 100% leakproof, ensuring your drink stays exactly where it belongs. +> - **"Eco-Friendly and Sustainable"**: Made with 18/8 stainless steel, Stanley Tumblers are BPA-free and built to last, reducing waste from disposable cups. +> +> 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. +> + +### Thumbnail Images + +Please use the this for thumbnail images: + +![image.png](https://serpapi.com/searches/673d71322c566d56d9c20ceb/images/ce9a07f2aa831dbec8bb1c287299706e24a52a8e0c119fa162041805038957a7.jpeg) + +### SKU + +The sale includes three units: the "Classic Tumbler", the "Adventure Quencher Tumbler", and the "Accessories Set". + +### 1. **Classic Tumbler** + +- **Essential:** Yes, this item is required. +- **Options:** + - **Capacity:** + - 16 oz + - 20 oz + - 24 oz + - **Color Options:** + - Matte Black + - Hammertone Green + - Polar White +- **Pricing and Quantity:** + - (16 oz, Matte Black): (₩40,000 / ₩35,000) - Quantity: 2,000 + - (20 oz, Hammertone Green): (₩50,000 / ₩44,000) - Quantity: 2,000 + - (24 oz, Polar White): (₩60,000 / ₩54,000) - Quantity: 2,000 + +### 2. **Adventure Quencher Tumbler** + +- **Essential:** No, this item is optional. +- **Price:** + - Nominal Price: ₩70,000 + - Real Price: ₩64,000 +- **Quantity:** 5,000 + +### 3. **Accessories Set** + +- **Essential:** No, this item is optional. +- **Price:** + - Nominal Price: ₩20,000 + - Real Price: ₩18,000 +- **Quantity:** 10,000 +- **Contents:** Includes a cleaning brush and a silicone lid. \ No newline at end of file diff --git a/examples/function-calling/example.schema.json b/examples/function-calling/schemas/chatgpt.example.schema.json similarity index 100% rename from examples/function-calling/example.schema.json rename to examples/function-calling/schemas/chatgpt.example.schema.json diff --git a/examples/function-calling/recursive.schema.json b/examples/function-calling/schemas/chatgpt.recursive.schema.json similarity index 100% rename from examples/function-calling/recursive.schema.json rename to examples/function-calling/schemas/chatgpt.recursive.schema.json diff --git a/examples/function-calling/sale.schema.tagged.json b/examples/function-calling/schemas/chatgpt.sale.schema.contraint.json similarity index 100% rename from examples/function-calling/sale.schema.tagged.json rename to examples/function-calling/schemas/chatgpt.sale.schema.contraint.json diff --git a/examples/function-calling/sale.schema.json b/examples/function-calling/schemas/chatgpt.sale.schema.json similarity index 100% rename from examples/function-calling/sale.schema.json rename to examples/function-calling/schemas/chatgpt.sale.schema.json index da367f1..25c64ab 100644 --- a/examples/function-calling/sale.schema.json +++ b/examples/function-calling/schemas/chatgpt.sale.schema.json @@ -162,32 +162,6 @@ "type": "array", "items": { "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "title": "Type of descriptive option", - "description": "Type of descriptive option.\n\nWhich typed value should be written when purchasing.", - "type": "string", - "enum": [ - "string", - "number", - "boolean" - ] - }, - "name": { - "title": "Readable name of the option", - "description": "Readable name of the option.", - "type": "string" - } - }, - "required": [ - "type", - "name" - ], - "description": "Creation information of the descriptive option.", - "additionalProperties": false - }, { "type": "object", "properties": { @@ -237,6 +211,32 @@ ], "description": "Creation information of the selectable option.", "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "title": "Type of descriptive option", + "description": "Type of descriptive option.\n\nWhich typed value should be written when purchasing.", + "type": "string", + "enum": [ + "string", + "number", + "boolean" + ] + }, + "name": { + "title": "Readable name of the option", + "description": "Readable name of the option.", + "type": "string" + } + }, + "required": [ + "type", + "name" + ], + "description": "Creation information of the descriptive option.", + "additionalProperties": false } ] } diff --git a/examples/function-calling/sale.schema.reference.json b/examples/function-calling/schemas/chatgpt.sale.schema.reference.json similarity index 100% rename from examples/function-calling/sale.schema.reference.json rename to examples/function-calling/schemas/chatgpt.sale.schema.reference.json diff --git a/examples/function-calling/tags.schema.json b/examples/function-calling/schemas/chatgpt.tags.schema.json similarity index 100% rename from examples/function-calling/tags.schema.json rename to examples/function-calling/schemas/chatgpt.tags.schema.json diff --git a/examples/function-calling/tuple.schema.json b/examples/function-calling/schemas/chatgpt.tuple.schema.json similarity index 100% rename from examples/function-calling/tuple.schema.json rename to examples/function-calling/schemas/chatgpt.tuple.schema.json diff --git a/package.json b/package.json index fc8275b..3561c18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@samchon/openapi", - "version": "2.0.0-dev.20241120", + "version": "2.0.0-dev.20241120-3", "description": "OpenAPI definitions and converters for 'typia' and 'nestia'.", "main": "./lib/index.js", "module": "./lib/index.mjs", diff --git a/src/converters/ChatGptConverter.ts b/src/converters/ChatGptConverter.ts index bb9ed6e..13545e5 100644 --- a/src/converters/ChatGptConverter.ts +++ b/src/converters/ChatGptConverter.ts @@ -150,6 +150,7 @@ export namespace ChatGptConverter { : { maxItems: undefined, minItems: undefined, + uniqueItems: undefined, }), }, tags: props.options.constraint ? [] : getArrayTags(input), diff --git a/src/structures/IGeminiSchema.ts b/src/structures/IGeminiSchema.ts index cdf42d2..241e6bf 100644 --- a/src/structures/IGeminiSchema.ts +++ b/src/structures/IGeminiSchema.ts @@ -16,12 +16,12 @@ * - {@link OpenApi.IJsonSchema.IOneOf} * - {@link OpenApi.IJsonSchema.ITuple} * - * Also, by the documents of Gemini, these additional properties are not - * supported, either. However, I can't sure that these additional properties + * Also, by the documents of Gemini, these constraint properties are not + * supported, either. However, I can't sure that these constraint properties * are really not supported in the Geimni, because the Gemini seems like * understanding them. Therefore, I've decided to keep them alive. * - * - ex) additional properties + * - ex) constraint properties * - {@link IGeminiSchema.IString.default} * - {@link IGeminiSchema.__IAttribute.example} * - {@link IGeminiSchema.__IAttribute.examples} diff --git a/test/examples/chatgpt-function-calling.ts b/test/examples/chatgpt-function-calling.ts new file mode 100644 index 0000000..318d1e1 --- /dev/null +++ b/test/examples/chatgpt-function-calling.ts @@ -0,0 +1,105 @@ +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"; +import { IShoppingSale } from "../structures/IShoppingSale"; + +const main = async (): Promise => { + if (TestGlobal.env.OPENAI_API_KEY === undefined) return; + + const collection: IJsonSchemaCollection = + typia.json.schemas<[{ input: IShoppingSale.ICreate }]>(); + const parameters: IChatGptSchema.IParameters | null = + ChatGptConverter.parameters({ + components: collection.components, + schema: typia.assert(collection.schemas[0]), + options: { + 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.OPENAI_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); + 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: "assistant", + content, + }, + { + role: "user", + content: await fs.promises.readFile( + `${TestGlobal.ROOT}/examples/function-calling/prompts/${file}`, + "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) { + await fs.promises.writeFile( + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.sale.error.${title}.json`, + JSON.stringify(typia.is(error) ? { ...error } : error, null, 2), + "utf8", + ); + } + } +}; +main().catch((error) => { + console.log(error); + process.exit(-1); +}); 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 index d8d928d..51ea952 100644 --- 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 @@ -30,7 +30,7 @@ export const test_llm_function_calling_chatgpt_example = "Failed to convert the JSON schema to the ChatGPT schema.", ); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/example.schema.json`, + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.example.schema.json`, JSON.stringify(parameters, null, 2), "utf8", ); @@ -69,7 +69,7 @@ export const test_llm_function_calling_chatgpt_example = input: IPerson; }>(JSON.parse(call.function.arguments)); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/example.input.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.example.input.json`, JSON.stringify(input, null, 2), "utf8", ); 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 index 5b06d8f..9b50825 100644 --- 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 @@ -30,7 +30,7 @@ export const test_llm_function_calling_chatgpt_recursive = "Failed to convert the JSON schema to the ChatGPT schema.", ); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/recursive.schema.json`, + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.recursive.schema.json`, JSON.stringify(parameters, null, 2), "utf8", ); @@ -69,7 +69,7 @@ export const test_llm_function_calling_chatgpt_recursive = input: IShoppingCategory[]; }>(JSON.parse(call.function.arguments)); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/recursive.input.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.recursive.input.json`, JSON.stringify(input, null, 2), "utf8", ); 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 index dd9b946..45891bf 100644 --- 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 @@ -31,7 +31,7 @@ export const test_llm_function_calling_chatgpt_sale = "Failed to convert the JSON schema to the ChatGPT schema.", ); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/sale.schema.json`, + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.sale.schema.json`, JSON.stringify(parameters, null, 2), "utf8", ); @@ -48,7 +48,10 @@ export const test_llm_function_calling_chatgpt_sale = }, { role: "user", - content: USER_MESSAGE, + content: await fs.promises.readFile( + `${TestGlobal.ROOT}/examples/function-calling/prompts/microsoft-surface-pro-9.md`, + "utf8", + ), }, ], tools: [ @@ -71,7 +74,7 @@ export const test_llm_function_calling_chatgpt_sale = input: IShoppingSale.ICreate; }>(JSON.parse(call.function.arguments)); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/sale.input.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.sale.input.json`, JSON.stringify(input, null, 2), "utf8", ); @@ -80,42 +83,3 @@ export const test_llm_function_calling_chatgpt_sale = const SYSTEM_MESSAGE = "You are a helpful customer support assistant. Use the supplied tools to assist the user."; -const USER_MESSAGE = ` - I will create a sale with the following details. - At first, title of the sale is "Surface Pro 8". - Then, the sale has a description "The best laptop for your daily needs.". - - Also, it has only two unit, the "Surface Pro 8 Entity" and "Warranty Program". - - About the "Warranty Program" unit, it is not essential to the sale, - and there is no option to select. Its nominal price is $99, and - the real price is $89. - - About the "Surface Pro 8 Entity", it is essential to the sale, and - there are two options to select like below. - - - CPU - - Intel Core i3 - - Intel Core i5 - - Intel Core i7 - - RAM - - 8 GB - - 16 GB - - 32 GB - - Storage - - 128 GB - - 256 GB - - 512 GB - - The final stocks combinated by the options are like below. - The sequence of selected options are {(CPU, RAM, Storage): (nominal price / real price)}. - Also, quantity of them are fixed to 1,000 value. - - - (i3, 8 GB, 128 GB): ($999 / $899) - - (i3, 16 GB, 256 GB): ($1,199 / $1,099) - - (i3, 16 GB, 512 GB): ($1,399 / $1,299) - - (i5, 16 GB, 256 GB): ($1,499 / $1,399) - - (i5, 32 GB, 512 GB): ($1,799 / $1,699) - - (i7, 16 GB, 512 GB): ($1,799 / $1,699) - - (i7, 32 GB, 512 GB): ($1,999 / $1,899) -`; 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 index c442589..5735b23 100644 --- 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 @@ -30,7 +30,7 @@ export const test_llm_function_calling_chatgpt_tags = "Failed to convert the JSON schema to the ChatGPT schema.", ); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/tags.schema.json`, + `${TestGlobal.ROOT}/examples/function-calling/schemas/chatgpt.tags.schema.json`, JSON.stringify(parameters, null, 2), "utf8", ); @@ -68,7 +68,7 @@ export const test_llm_function_calling_chatgpt_tags = input: OpeningTime; }>(JSON.parse(call.function.arguments)); await fs.promises.writeFile( - `${TestGlobal.ROOT}/examples/function-calling/tags.input.json`, + `${TestGlobal.ROOT}/examples/function-calling/arguments/chatgpt.tags.input.json`, JSON.stringify(input, null, 2), "utf8", );