Skip to main content Startseite Ersteller skeeper75 widget.creator innojini-huni-nlp-builder
innojini-huni-nlp-builder HuniPrinting GLM-powered Natural Language Rule Builder skill. Provides GLM prompt templates, printing domain knowledge, and extensive few-shot examples for converting Korean natural language into structured ECA constraints, quantity discount tiers, price mode recommendations, WowPress req_*/rst_* style option dependency rules, and multi-domain composite rules. Covers: single-domain rules, multi-domain composite rules, chain rules (AโBโC), option dependency chains (WowPress pattern), price+constraint combinations, and TypeScript/Drizzle script generation output. Use when building or testing the NL rule builder feature (SPEC-WB-007).
Zur Installation springen Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fรผgen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prรผfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl รผberspringt den Prรผf-Prompt. Prรผfen Sie die Quelle, bevor Sie ihn ausfรผhren.
npx skills add https://github.com/skeeper75/widget.creator --skill innojini-huni-nlp-builderDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollstรคndig zu prรผfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Mehr aus diesem Repository innojini-edicus-integration Edicus ํ๋ซํผ(๋ชจ์
์) ์ฐ๋ ์ ๋ฌธ ์คํฌ. ์จ๋ผ์ธ ํธ์ง๊ธฐ ๊ธฐ๋ฐ ๋ง์ถคํ ์ธ์๋ฌผ(ํฌํ ๋ถ, ๋ช
ํจ, ์คํฐ์ปค ๋ฑ) ์ฃผ๋ฌธ ์์คํ
๊ตฌํ ์ ์ฌ์ฉ. JS SDK ์ด๊ธฐํ, Server API ํธ์ถ, ์ฃผ๋ฌธ workflow ์ฐ๋, ๋ ๋๋ง ์ฒ๋ฆฌ ํ์ ์ ์๋ ํ์ฑํ.
Comprehensive Figma development toolkit for Plugins, Widgets, Code Connect, and MCP Server integration.
๐น ํ๋ฌ๊ทธ์ธ: "Figma plugin", "ํ๋ฌ๊ทธ์ธ ๊ฐ๋ฐ", "Figma ํ์ฅ", "Plugin API" ๐น ์์ ฏ: "Figma widget", "FigJam ์์ ฏ", "์ธํฐ๋ํฐ๋ธ ํ์
", "Widget API" ๐น Code Connect: "Code Connect", "๋์์ธ-์ฝ๋ ์ฐ๊ฒฐ", "Dev Mode ์ฝ๋", "์ปดํฌ๋ํธ ๋งคํ" ๐น MCP Server: "Figma MCP", "Cursor Figma", "AI ์ฝ๋ฉ Figma", "๋์์ธโ์ฝ๋ AI" ๐น REST API: "Figma API", "Variables API", "๋์์ธ ํ ํฐ", "design tokens"
Use when building Figma extensions, connecting design systems to code, or integrating Figma with AI coding tools.
innojini-huni-data-import HuniPrinting master data Excel-to-DB import workflow using ExcelJS + TOON format. Extracts Excel with full formatting metadata (cell colors, fonts, merged cells) for tacit knowledge preservation, then converts to TOON format for 93% token savings. Supports product master, pricing tables, and MES item management data. Use when importing huni seed data, analyzing ์ํ๋ง์คํฐ or ๊ฐ๊ฒฉํ, working with xlsx files, running excel extract/convert scripts, or mapping toon files to DB tables.
Verwandte Berufe SOC
Basierend auf der SOC-Berufsklassifikation
name innojini-huni-nlp-builder description HuniPrinting GLM-powered Natural Language Rule Builder skill. Provides GLM prompt templates, printing domain knowledge, and extensive few-shot examples for converting Korean natural language into structured ECA constraints, quantity discount tiers, price mode recommendations, WowPress req_*/rst_* style option dependency rules, and multi-domain composite rules. Covers: single-domain rules, multi-domain composite rules, chain rules (AโBโC), option dependency chains (WowPress pattern), price+constraint combinations, and TypeScript/Drizzle script generation output. Use when building or testing the NL rule builder feature (SPEC-WB-007).
license Apache-2.0 compatibility Designed for Claude Code allowed-tools Read Grep Glob Bash user-invocable false metadata {"version":"2.0.0","category":"domain","status":"active","updated":"2026-02-27","modularized":"false","tags":"printing, glm, nlp, eca, price-rules, huni, wowpress, req-rst, composite-rules","related-skills":"innojini-printing-foundation,innojini-huni-printing-estimator,innojini-huni-db-schema,innojini-wowpress","context7-libraries":"openai,drizzle-orm,trpc,zod"} progressive_disclosure {"enabled":true,"level1_tokens":130,"level2_tokens":12000} triggers {"keywords":["glm","z.ai","์์ฐ์ด","nlp","nl-rule","convertConstraint","convertPriceRule","price_nl_history","nlp-builder","constraint-transformer","req_","rst_","๋ณตํฉ๊ท์น","์ฐ์๊ท์น","wowpress"],"agents":["expert-backend","expert-frontend","manager-tdd","manager-ddd"],"phases":["run"]}
innojini-huni-nlp-builder v2.0
ํ๋ํ๋ฆฐํ
GLM ์์ฐ์ด ๊ท์น ๋น๋ โ ๋๋ฉ์ธ ์ง์, ํ๋กฌํํธ ํ
ํ๋ฆฟ, ๋ณตํฉ ๊ท์น ๋ณํ ๊ฐ์ด๋.
1. ์์คํ
๊ฐ์
1.1 ํต์ฌ ์ค๊ณ ์์น
์ธ์๋ ์ฃผ๋ฌธ์ ์กฐ โ ์๋ฆฌ์ ๊ฐ๋ค:
์ํ์ ์ฌ์ด์ฆยท์ฉ์งยท์ธ์ยทํ๊ฐ๊ณต ๋ฑ ์ฌ๋ฃ๋ฅผ ์กฐํฉํด ๋ง๋ ๋ค.
GLM์ ๊ด๋ฆฌ์์ ์์ฐ์ด ์๋๋ฅผ ๊ตฌ์กฐํ๋ ๊ท์น(ECA ์ ์ฝ, ์๋ํ ์ธ)์ผ๋ก ๋ณํํ๋ ๋ฒ์ญ๊ธฐ๋ค.
WowPress req_/rst_ ํจํด ์๋ฆฌ:
req_* = "A๋ฅผ ์ ํํ๋ฉด B๋ ๋ฐ๋์ ์ ํํด์ผ ํ๋ค" (ํ์ ์ฐ๊ณ)
rst_* = "A๋ฅผ ์ ํํ๋ฉด B๋ ์ ํ ๋ถ๊ฐ" (๋ถ๊ฐ ์ ์ฝ)
WowPress์ ์ด ๋ ํจํด์ด ํ๋ํ๋ฆฐํ
ECA ์์คํ
์ require_option / exclude_options์ ๋์๋ฉ๋๋ค.
์์ฐ์ด ๋ณํ์ 3๊ฐ์ง ์ถ๋ ฅ ๋ ๋ฒจ:
ํ๋ฆฌ๋ทฐ JSON โ GLM์ด ๋ฐํํ๋ ๊ตฌ์กฐํ ๋ฐ์ดํฐ (ํ์ธ์ฉ)
ํ์ธ ํ DB ์ ์ฅ โ recipe_constraints + constraint_nl_history์ ํธ๋์ญ์
์ ์ฅ
Drizzle ์คํฌ๋ฆฝํธ โ ๋ณต์กํ ๋ณตํฉ ๊ท์น์ ๊ฒฝ์ฐ TypeScript ๋ง์ด๊ทธ๋ ์ด์
์คํฌ๋ฆฝํธ ์์ฑ
1.2 GLM API ์ค์
const response = await client.chat .completions .create ({
model : process.env .GLM_MODEL ?? 'glm-5.0' ,
messages : [
{ role : 'system' , content : DOMAIN_SYSTEM_PROMPT },
{ role : 'user' , content : nlText },
],
response_format : { type : 'json_object' },
temperature : 0.1 ,
: ,
});
max_tokens
2000
2. ์ธ์ ๋๋ฉ์ธ ์ฉ์ด ์ฌ์
2.1 ์ต์
ํ์
๋งคํ (WowPress โ ํ๋ํ๋ฆฐํ
) ํ๋ ํ์
์ฝ๋ WowPress ๋์ ํ๊ตญ์ด ํ์ฉ๊ฐ ์์ PAPER paperinfo ์ฉ์ง/์ง์ง ์ํธ์ง, ์ค๋
ธ์ฐ์ง, ํฌ๋ผํํธ์ง, ํฌ๋ช
PVC, OPP, ์PET, ๊ธPET PRINT colorinfo ์ธ์/๋์ ๋จ๋ฉด์นผ๋ผ, ์๋ฉด์นผ๋ผ, ๋จ๋ฉดํ๋ฐฑ, ํ์ดํธ์ํฌ COATING awkjobinfo (์ฝํ
) ์ฝํ
์์, ๋ฌด๊ดPP, ์ ๊ดPP, UV์ฝํ
, ์ํญ์ SIZE sizeinfo ์ฌ์ด์ฆ/๊ท๊ฒฉ 90ร50, A4, A5, free(์์ ํ) PROCESS awkjobinfo ํ๊ฐ๊ณต ๋ฐ๊ฐ๊ณต, ๋๋ฌด์ก, ์ค์, ๋ฏธ์ฑ, ๋ชจ์๋ฆฌ, ์ ์ง BINDING awkjobinfo (์ ๋ณธ) ์ ๋ณธ ์ค์ฒ , ๋ฌด์ , PUR, ํธ์๋ง PAGES coverinfo pagecnt ํ์ด์ง์ 4์ ๋ฐฐ์ QTY ordqty ์๋ ์ซ์ PRINT_METHOD prsjobinfo ์ธ์๋ฐฉ์ ์คํ์
, ๋์งํธ, ํฉํ, ๋
ํ
2.2 WowPress ์ ์ฝ ํจํด โ ECA ์ก์
๋งคํ WowPress ํจํด ์๋ฏธ ECA ์ก์
req_awkjobํด๋น ์ง์ง ์ ํ ์ ํ๊ฐ๊ณต ํ์ require_optionreq_colorํด๋น ์ง์ง์ ํน์ ๋์๋ง ๊ฐ๋ฅ filter_optionsreq_width/height๋น๊ท๊ฒฉ ์ ์น์ ์
๋ ฅ ํ์ require_optionrst_prsjobํด๋น ์ง์ง์ ํน์ ์ธ์๊ธฐ ๋ถ๊ฐ exclude_optionsrst_awkjobํ๊ฐ๊ณต ์ํธ ๋ฐฐ์ exclude_optionsrst_colorํด๋น ์ง์ง์ ํน์ ๋์ ๋ถ๊ฐ exclude_optionsaddtype: select/checkbox์ถ๊ฐ ๋์ ์ ํ ๋ฐฉ์ show_addon_list
2.3 ์ธ์ ์ฉ์ด ํด์ค ์ฉ์ด ์ค๋ช
๋๋ฌด์ก ์นผ๊ธํ์ผ๋ก ์ํ๋ ๋ชจ์ ์ฌ๋จ ๋ฐ๊ฐ๊ณต ๊ธ๋ฐยท์๋ฐ ์ด์ ์ฌ ์ธ์ (๋ํ๋น ํ์) ์ค์ ์ ์ง์ฉ ๋๋ฆผ์ (์ฑ
์ ํ์ง ํ์) ๋ฏธ์ฑ ๋ฏ๊ธฐ ์ฝ๋๋ก ์ ์ ๊ตฌ๋ฉ ๋ํ๋น ๋ฐ๊ฐ๊ณต์ฉ ๊ธํ ์ ์๋น (๋ณ๋ ์ํ) ์นผ์ ์ฌ๋จ ๊ฒฝ๊ณ์ (๋๋ฌด์ก/์์ ํ ํ์) ํฉํ ์ฌ๋ฌ ์์
์ ํ ํ์ ๋ฐฐ์น (๋น์ฉ ์ ๊ฐ) ๋
ํ ๋จ์ผ ์์
๋ง ์ธ์ (ํ์ง ์ฐ์ ) ํฌ๋ฆฝ ์ค์ฒ ์ฑ
์ ๋ด์ง ์ฌ๋จ ๋ณด์ ๊ฐ ์ฑ
๋ฑ ๋ฌด์ ์ฑ
์ ๋ฑ ๋๊ป
3. 8์ข
ECA ์ก์
ํ์
์ ์ type ConstraintAction =
| { type : "exclude_options" ; targetOption : string ; excludeValues : string [] }
| { type : "filter_options" ; targetOption : string ; allowedValues : string [] }
| { type : "show_addon_list" ; addonGroupId : number }
| { type : "auto_add" ; productId : number ; qty : number }
| { type : "require_option" ; targetOption : string }
| { type : "show_message" ; level : "info" | "warn" | "error" ; message : string }
| { type : "change_price_mode" ; newMode : "LOOKUP" | "AREA" | "PAGE" | "COMPOSITE" }
| { type : "set_default" ; targetOption : string ; defaultValue : string };
4. GLM ์ถ๋ ฅ ํ์ (4๊ฐ์ง)
4.1 ๋จ์ผ ECA ๊ท์น interface SingleConstraintOutput {
outputType : "single_constraint" ;
constraintName : string ;
triggerOptionType : string ;
triggerOperator : "in" | "equals" | "gte" | "lte" | "not_in" ;
triggerValues : string [];
extraConditions ?: object ;
actions : ConstraintAction [];
confidence : number ;
explanationKo : string ;
alternativeInterpretations ?: SingleConstraintOutput [];
}
4.2 ๋ณตํฉ ECA ๊ท์น ๋ฌถ์ (ํ ์์ฐ์ด ์
๋ ฅ โ ์ฌ๋ฌ ๊ท์น) interface CompositeConstraintOutput {
outputType : "composite_constraints" ;
totalRules : number ;
rules : SingleConstraintOutput [];
executionOrder : number [];
sharedTrigger ?: string ;
confidence : number ;
explanationKo : string ;
}
4.3 ์๋ํ ์ธ ๊ฐ๊ฒฉ๋ฃฐ interface QtyDiscountOutput {
outputType : "qty_discount" ;
qtyDiscountTiers : {
qtyMin : number ;
qtyMax : number | null ;
discountRate : number ;
discountLabel : string ;
}[];
confidence : number ;
explanationKo : string ;
}
4.4 ๋ณตํฉ ๊ฐ๊ฒฉ+์ ์ฝ ๊ท์น (ํ ์์ฐ์ด โ ๊ฐ๊ฒฉ๋ฃฐ + ECA ๋์) interface MixedRuleOutput {
outputType : "mixed_rules" ;
constraints : SingleConstraintOutput [];
priceRules : QtyDiscountOutput | PriceModeOutput | null ;
totalActions : number ;
confidence : number ;
explanationKo : string ;
implementationScript ?: string ;
}
5. GLM ํ๋กฌํํธ ํ
ํ๋ฆฟ
5.1 ๋ง์คํฐ ์์คํ
ํ๋กฌํํธ (๋ชจ๋ ๋ณํ ๊ณตํต) ๋น์ ์ ํ๊ตญ ์ธ์์
ECA ๊ท์น ์ค๊ณ ์ ๋ฌธ๊ฐ์
๋๋ค.
๊ด๋ฆฌ์์ ์์ฐ์ด ์ค๋ช
์ ๊ตฌ์กฐํ๋ ์ธ์ ๊ท์น(ECA ์ ์ฝ์กฐ๊ฑด + ๊ฐ๊ฒฉ๋ฃฐ)์ผ๋ก ๋ณํํฉ๋๋ค.
๋ฐ๋์ JSON ํ์์ผ๋ก๋ง ์๋ตํ์ธ์.
=== ํต์ฌ ์์น ===
1. ํ ๋ฌธ์ฅ์ ์ฌ๋ฌ ๊ท์น์ด ์์ผ๋ฉด outputType์ "composite_constraints" ๋๋ "mixed_rules"๋ก ์ฌ์ฉํ์ธ์
2. ๊ฐ๊ฒฉ ๋ณ๊ฒฝ + ์ ์ฝ์กฐ๊ฑด์ด ๋์์ ๋์ค๋ฉด "mixed_rules"๋ก ์ฒ๋ฆฌํ์ธ์
3. AโBโC ์ฐ์ ๊ท์น์ executionOrder๋ก ์์๋ฅผ ๋ช
์ํ์ธ์
4. ํ์ ๋(confidence)๊ฐ ๋ฎ์ ๋๋ alternativeInterpretations๋ฅผ 1~2๊ฐ ์ ๊ณตํ์ธ์
=== ์ต์
ํ์
์ฝ๋ ===
PAPER(์ฉ์ง), PRINT(์ธ์/๋์), COATING(์ฝํ
), SIZE(์ฌ์ด์ฆ), PROCESS(ํ๊ฐ๊ณต),
BINDING(์ ๋ณธ), PAGES(ํ์ด์ง์), QTY(์๋), PRINT_METHOD(์ธ์๋ฐฉ์)
=== WowPress req_*/rst_* ํจํด โ ECA ๋ณํ ๊ท์น ===
req_awkjob โ require_option (ํ๊ฐ๊ณต ํ์ ์ฐ๊ณ)
req_color โ filter_options (๋์ ๋ฒ์ ์ ํ)
rst_prsjob โ exclude_options (์ธ์๋ฐฉ์ ๋ถ๊ฐ)
rst_awkjob โ exclude_options (ํ๊ฐ๊ณต ์ํธ ๋ฐฐ์ )
5.2 ECA ๋ณํ ํ๋กฌํํธ (๋จ์ผ/๋ณตํฉ ์๋ ํ๋จ) === 8์ข
์ก์
ํ์
===
exclude_options, filter_options, show_addon_list, auto_add,
require_option, show_message, change_price_mode, set_default
=== ์ถ๋ ฅ Schema ์ ํ ๊ธฐ์ค ===
- ๋จ์ 1๊ฐ ๊ท์น โ outputType: "single_constraint"
- ์ฌ๋ฌ ๋
๋ฆฝ ๊ท์น โ outputType: "composite_constraints"
- ๊ฐ๊ฒฉ+์ ์ฝ ๋์ โ outputType: "mixed_rules"
- ์๋ํ ์ธ๋ง โ outputType: "qty_discount"
5.3 ์๋ํ ์ธ ๋ณํ ํ๋กฌํํธ === ์ถ๋ ฅ Schema ===
{
"outputType": "qty_discount",
"qtyDiscountTiers": [
{"qtyMin": number, "qtyMax": number|null, "discountRate": number, "discountLabel": "string"}
],
"confidence": 0.0~1.0,
"explanationKo": "string"
}
์ฃผ์: qtyMax๊ฐ null์ด๋ฉด "์ด์(์ํ ์์)"์ ์๋ฏธํฉ๋๋ค.
discountRate๋ 0.0~1.0 ๋ฒ์์
๋๋ค. (0.05 = 5%)
6. Few-shot ์์ โ ๋จ์ผ ๊ท์น (8๊ฐ์ง ๊ธฐ๋ณธ ํจํด)
6.1 exclude_options (WowPress rst_awkjob ํจํด)
{
"outputType" : "single_constraint" ,
"constraintName" : "ํฌ๋ช
PVCโPP์ฝํ
์ ์ธ" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "ํฌ๋ช
PVC" , "OPP" ] ,
"actions" : [ { "type" : "exclude_options" , "targetOption" : "COATING" , "excludeValues" : [ "๋ฌด๊ดPP" , "์ ๊ดPP" ] } ] ,
"confidence" : 0.98 ,
"explanationKo" : "ํฌ๋ช
์์ฌ๋ PP์ฝํ
์ด ๋ถ๊ฐํฉ๋๋ค (์ ์ฐฉ๋ ฅ ๋ถ์กฑ)"
}
6.2 auto_add (WowPress ๋๋ฐ ํ์ ์ํ ํจํด)
{
"outputType" : "single_constraint" ,
"constraintName" : "๋ฐ๊ฐ๊ณตโ๋ํ๋น ์๋์ถ๊ฐ" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๊ธ๋ฐ" , "์๋ฐ" , "ํ๋ก๊ทธ๋จ" ] ,
"actions" : [ { "type" : "auto_add" , "productId" : 244 , "qty" : 1 } ] ,
"confidence" : 0.95 ,
"explanationKo" : "๋ฐ๊ฐ๊ณต(๊ธ๋ฐ/์๋ฐ/ํ๋ก๊ทธ๋จ) ์ ํ ์ ๋ํ๋น ์ํ์ ์๋์ผ๋ก ์ถ๊ฐํฉ๋๋ค"
}
6.3 show_addon_list (WowPress addtype ํจํด)
{
"outputType" : "single_constraint" ,
"constraintName" : "ํ์๋งโ์ค์น๋ถ์ํ ํ์" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "ํ์๋ง์ฒ" , "๋ฉ์ฌ" , "ํฐํด๋ฆฐ" ] ,
"actions" : [ { "type" : "show_addon_list" , "addonGroupId" : 12 } ] ,
"confidence" : 0.92 ,
"explanationKo" : "ํ์๋ง ์์ฌ ์ ํ ์ ์ค์น๋ถ์ํ(๊ทธ๋ก๋ฐ, ๊ณ ๋ฆฌ, ๋ด ๋ฑ) ๋ชฉ๋ก์ ํ์ํฉ๋๋ค"
}
6.4 filter_options (WowPress req_color ํจํด)
{
"outputType" : "single_constraint" ,
"constraintName" : "์ค์ฒ โํ์ด์ง์ 4๋ฐฐ์ ์ ํ" ,
"triggerOptionType" : "BINDING" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "์ค์ฒ " ] ,
"actions" : [ { "type" : "filter_options" , "targetOption" : "PAGES" , "allowedValues" : [ "4" , "8" , "12" , "16" , "20" , "24" , "28" , "32" , "36" , "40" , "44" , "48" ] } ] ,
"confidence" : 0.99 ,
"explanationKo" : "์ค์ฒ ์ ๋ณธ์ ํ์ด์ง์๊ฐ ๋ฐ๋์ 4์ ๋ฐฐ์์ฌ์ผ ํฉ๋๋ค"
}
6.5 require_option (WowPress req_awkjob ํจํด)
{
"outputType" : "single_constraint" ,
"constraintName" : "๋๋ฌด์กโ์นผ์ ํ์ผ ํ์" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๋๋ฌด์ก" , "์์ ํ์ปท" ] ,
"actions" : [ { "type" : "require_option" , "targetOption" : "CUT_LINE_FILE" } ] ,
"confidence" : 0.97 ,
"explanationKo" : "๋๋ฌด์ก/์์ ํ ์ปท ์ ํ ์ ์นผ์ ํ์ผ ์
๋ก๋๊ฐ ํ์์
๋๋ค"
}
6.6 show_message (์๋ด/๊ฒฝ๊ณ )
{
"outputType" : "single_constraint" ,
"constraintName" : "ํฌ๋ช
์งโํ์ดํธ์ํฌ ๊ฒฝ๊ณ " ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "ํฌ๋ช
PVC" , "OPP" , "ํฌ๋ช
PET" ] ,
"actions" : [ { "type" : "show_message" , "level" : "warn" , "message" : "ํฌ๋ช
์์ฌ๋ ํ์ดํธ์ํฌ ์ธ์๋ฅผ ๊ถ์ฅํฉ๋๋ค. ํฐ์ ์์ญ์ด ์๋ ๊ฒฝ์ฐ ๋ฐ๋์ ํ์ดํธ์ํฌ๋ฅผ ์ ํํ์ธ์." } ] ,
"confidence" : 0.96 ,
"explanationKo" : "ํฌ๋ช
์์ฌ ์ ํ ์ ํ์ดํธ์ํฌ ์ฌ์ฉ ์๋ด ๊ฒฝ๊ณ ๋ฅผ ํ์ํฉ๋๋ค"
}
6.7 change_price_mode (๊ฐ๊ฒฉ ๋ชจ๋ ์ ํ)
{
"outputType" : "single_constraint" ,
"constraintName" : "์์ ํโ๋ฉด์ ํ ๊ฐ๊ฒฉ๊ณ์ฐ" ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "free" , "์์ ํ" ] ,
"actions" : [ { "type" : "change_price_mode" , "newMode" : "AREA" } ] ,
"confidence" : 0.94 ,
"explanationKo" : "์์ ํ(๋น๊ท๊ฒฉ) ์ฌ์ด์ฆ ์ ํ ์ ๊ฐ๊ฒฉ ๊ณ์ฐ์ ๋ฉด์ ํ(ใก๋น ๋จ๊ฐ)์ผ๋ก ์ ํํฉ๋๋ค"
}
6.8 set_default (๊ธฐ๋ณธ๊ฐ ๋ณ๊ฒฝ)
{
"outputType" : "single_constraint" ,
"constraintName" : "ํฌ๋ผํํธ์งโ์ฝํ
๊ธฐ๋ณธ๊ฐ ์์" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "ํฌ๋ผํํธ์ง" ] ,
"actions" : [ { "type" : "set_default" , "targetOption" : "COATING" , "defaultValue" : "์์" } ] ,
"confidence" : 0.91 ,
"explanationKo" : "ํฌ๋ผํํธ์ง ํน์ ์ ์ง๊ฐ ์ ์ง๋ฅผ ์ํด ์ฝํ
๊ธฐ๋ณธ๊ฐ์ '์์'์ผ๋ก ์ค์ ํฉ๋๋ค"
}
7. Few-shot ์์ โ ๋ณตํฉ ๊ท์น (composite_constraints)
7.1 ๋ฐ๊ฐ๊ณต โ ๋ํ๋น + ์ฝํ
์ ํ + ์๋ด (3๊ฐ์ง ๋์)
{
"outputType" : "composite_constraints" ,
"totalRules" : 3 ,
"sharedTrigger" : "PROCESS in [๊ธ๋ฐ, ์๋ฐ, ํ๋ก๊ทธ๋จ]" ,
"rules" : [
{
"constraintName" : "๋ฐ๊ฐ๊ณตโ๋ํ๋น ์๋์ถ๊ฐ" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๊ธ๋ฐ" , "์๋ฐ" , "ํ๋ก๊ทธ๋จ" ] ,
"actions" : [ { "type" : "auto_add" , "productId" : 244 , "qty" : 1 } ] ,
"confidence" : 0.97
} ,
{
"constraintName" : "๋ฐ๊ฐ๊ณตโ์ํญ์ ์ฝํ
์ ์ธ" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๊ธ๋ฐ" , "์๋ฐ" , "ํ๋ก๊ทธ๋จ" ] ,
"actions" : [ { "type" : "exclude_options" , "targetOption" : "COATING" , "excludeValues" : [ "์ํญ์" ] } ] ,
"confidence" : 0.93
} ,
{
"constraintName" : "๋ฐ๊ฐ๊ณตโ์ฃผ์์ฌํญ ์๋ด" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๊ธ๋ฐ" , "์๋ฐ" , "ํ๋ก๊ทธ๋จ" ] ,
"actions" : [ { "type" : "show_message" , "level" : "info" , "message" : "๋ฐ๊ฐ๊ณต์ ๋ณ๋ ๋ํ(๊ธํ) ์ ์์ด ํ์ํฉ๋๋ค. ์ด๋ ์ฃผ๋ฌธ ์ ๋ํ๋น๊ฐ ์๋์ผ๋ก ์ถ๊ฐ๋ฉ๋๋ค." } ] ,
"confidence" : 0.98
}
] ,
"executionOrder" : [ 2 , 1 , 0 ] ,
"confidence" : 0.94 ,
"explanationKo" : "๋ฐ๊ฐ๊ณต ์ ํ ์ 3๊ฐ์ง ๊ท์น์ด ๋์์ ์ ์ฉ๋ฉ๋๋ค: ๋ํ๋น ์๋์ถ๊ฐ, ์ํญ์ ์ฝํ
์ ์ธ, ์ฃผ์์ฌํญ ์๋ด"
}
7.2 ๋ฌด์ ์ฑ
์ ์ต์
์์กด์ฑ ์ฒด์ธ (WowPress ์ ํ ์์ ํจํด)
{
"outputType" : "composite_constraints" ,
"totalRules" : 3 ,
"rules" : [
{
"constraintName" : "๋ฌด์ ์ฑ
์โํ์ง UV์ฝํ
๋ง" ,
"triggerOptionType" : "BINDING" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "๋ฌด์ " ] ,
"extraConditions" : { "coverType" : "COVER" } ,
"actions" : [ { "type" : "filter_options" , "targetOption" : "COATING" , "allowedValues" : [ "์์" , "UV์ฝํ
" , "๋ฌด๊ดPP" , "์ ๊ดPP" ] } ] ,
"confidence" : 0.85
} ,
{
"constraintName" : "๋ฌด์ ์ฑ
์โ๋ด์ง ์ฝํ
์ ์ธ" ,
"triggerOptionType" : "BINDING" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "๋ฌด์ " ] ,
"extraConditions" : { "coverType" : "INNER" } ,
"actions" : [ { "type" : "exclude_options" , "targetOption" : "COATING" , "excludeValues" : [ "๋ฌด๊ดPP" , "์ ๊ดPP" , "UV์ฝํ
" , "์ํญ์" ] } ] ,
"confidence" : 0.92
} ,
{
"constraintName" : "๋ฌด์ ์ฑ
์โ100P+ PUR ๊ถ์ฅ" ,
"triggerOptionType" : "PAGES" ,
"triggerOperator" : "gte" ,
"triggerValues" : [ "100" ] ,
"extraConditions" : { "binding" : "๋ฌด์ " } ,
"actions" : [ { "type" : "show_message" , "level" : "info" , "message" : "100ํ์ด์ง ์ด์ ๋ฌด์ ์ฑ
์๋ PUR์ ๋ณธ์ ๊ถ์ฅํฉ๋๋ค. PUR์ ๋ณธ์ ๋ด๊ตฌ์ฑ์ด ๋ ๊ฐํฉ๋๋ค." } ] ,
"confidence" : 0.88
}
] ,
"executionOrder" : [ 0 , 1 , 2 ] ,
"confidence" : 0.88 ,
"explanationKo" : "๋ฌด์ ์ฑ
์ ๊ด๋ จ 3๊ฐ์ง ๊ท์น: ํ์ง ์ฝํ
์ ํ, ๋ด์ง ์ฝํ
๊ธ์ง, 100P ์ด์ PUR ๊ถ์ฅ"
}
7.3 WowPress rst_* ๋ค์ค ๋ฐฐ์ ํจํด (์ฉ์ง + ์ธ์๊ธฐ + ํ๊ฐ๊ณต ๋์ ์ ์ฝ)
{
"outputType" : "composite_constraints" ,
"totalRules" : 4 ,
"sharedTrigger" : "PAPER in [์PET, ๊ธPET]" ,
"rules" : [
{
"constraintName" : "์/๊ธPETโUV์ฝํ
๋ง ํ์ฉ" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "์PET" , "๊ธPET" ] ,
"actions" : [ { "type" : "filter_options" , "targetOption" : "COATING" , "allowedValues" : [ "์์" , "UV์ฝํ
" ] } ] ,
"confidence" : 0.93
} ,
{
"constraintName" : "์/๊ธPETโ์คํ์
๋ถ๊ฐ" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "์PET" , "๊ธPET" ] ,
"actions" : [ { "type" : "exclude_options" , "targetOption" : "PRINT_METHOD" , "excludeValues" : [ "์คํ์
" , "์คํ์
ํฉํ" ] } ] ,
"confidence" : 0.96
} ,
{
"constraintName" : "์/๊ธPETโ์์ฑ์ฝํ
๋ถ๊ฐ" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "์PET" , "๊ธPET" ] ,
"actions" : [ { "type" : "exclude_options" , "targetOption" : "COATING" , "excludeValues" : [ "์์ฑ์ฝํ
" ] } ] ,
"confidence" : 0.94
} ,
{
"constraintName" : "์/๊ธPETโํน์์์ฌ ์๋ด" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "์PET" , "๊ธPET" ] ,
"actions" : [ { "type" : "show_message" , "level" : "info" , "message" : "๋ฉํ๋ฆญ ์์ฌ๋ ๋
ํ(๋จ๋
) ์ธ์๋ก๋ง ์ฒ๋ฆฌ๋ฉ๋๋ค. ํฉํ ์งํ์ด ๋ถ๊ฐํฉ๋๋ค." } ] ,
"confidence" : 0.90
}
] ,
"executionOrder" : [ 0 , 1 , 2 , 3 ] ,
"confidence" : 0.93 ,
"explanationKo" : "์/๊ธPET ๋ฉํ๋ฆญ ์์ฌ์ 4๊ฐ์ง ์ ์ฝ: UV์ฝํ
๋ง ํ์ฉ, ์คํ์
๋ถ๊ฐ, ์์ฑ์ฝํ
๋ถ๊ฐ, ๋
ํ ์๋ด"
}
8. Few-shot ์์ โ ๋ณตํฉ ๊ฐ๊ฒฉ+์ ์ฝ ํผํฉ (mixed_rules)
8.1 ์คํฐ์ปค ์์ ํ ์ฌ์ด์ฆ โ ๋ฉด์ ๊ฐ๊ฒฉ + ์นผ์ ํ์ + ํ ์ฆ ์๋ด
{
"outputType" : "mixed_rules" ,
"constraints" : [
{
"constraintName" : "์์ ํโ๋ฉด์ ํ ๊ฐ๊ฒฉ๊ณ์ฐ" ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "free" , "์์ ํ" ] ,
"actions" : [ { "type" : "change_price_mode" , "newMode" : "AREA" } ] ,
"confidence" : 0.95
} ,
{
"constraintName" : "์์ ํโ์นผ์ ํ์ผ ํ์" ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "free" , "์์ ํ" ] ,
"actions" : [ { "type" : "require_option" , "targetOption" : "CUT_LINE_FILE" } ] ,
"confidence" : 0.97
} ,
{
"constraintName" : "์์ ํโ๋น๊ท๊ฒฉ ํ ์ฆ ์๋ด" ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "free" , "์์ ํ" ] ,
"actions" : [ { "type" : "show_message" , "level" : "warn" , "message" : "๋น๊ท๊ฒฉ(์์ ํ) ์คํฐ์ปค๋ ๋ฉด์ ๋จ๊ฐ์ 20% ๋น๊ท๊ฒฉ ํ ์ฆ์ด ์ ์ฉ๋ฉ๋๋ค." } ] ,
"confidence" : 0.89
}
] ,
"priceRules" : null ,
"totalActions" : 3 ,
"confidence" : 0.93 ,
"explanationKo" : "์์ ํ ์คํฐ์ปค: ๋ฉด์ ํ ๊ฐ๊ฒฉ ์ ํ + ์นผ์ ํ์ผ ํ์ + ํ ์ฆ ์๋ด (3๊ฐ์ง ๋์)"
}
8.2 ์๋ํ ์ธ + ์คํ์
์ธ์ ์ ํ ์ธ ์ถ๊ฐ (๊ฐ๊ฒฉ+์ ์ฝ ํผํฉ)
{
"outputType" : "mixed_rules" ,
"constraints" : [
{
"constraintName" : "ํฉํ์ธ์โ์ถ๊ฐํ ์ธ ์๋ด" ,
"triggerOptionType" : "PRINT_METHOD" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "์คํ์
ํฉํ" , "๋์งํธํฉํ" ] ,
"actions" : [ { "type" : "show_message" , "level" : "info" , "message" : "ํฉํ ์ธ์ ์ ํ ์ ์๋ํ ์ธ์ ์ถ๊ฐ 5% ํ ์ธ์ด ์ ์ฉ๋ฉ๋๋ค." } ] ,
"confidence" : 0.87
}
] ,
"priceRules" : {
"outputType" : "qty_discount" ,
"qtyDiscountTiers" : [
{ "qtyMin" : 1 , "qtyMax" : 99 , "discountRate" : 0 , "discountLabel" : "๊ธฐ๋ณธ๊ฐ" } ,
{ "qtyMin" : 100 , "qtyMax" : 499 , "discountRate" : 0.05 , "discountLabel" : "์๋ํ ์ธ" } ,
{ "qtyMin" : 500 , "qtyMax" : null , "discountRate" : 0.10 , "discountLabel" : "์ค๋ํ ์ธ" }
] ,
"confidence" : 0.97 ,
"explanationKo" : "100~499์ฅ 5%, 500์ฅ ์ด์ 10% ์๋ํ ์ธ"
} ,
"totalActions" : 4 ,
"confidence" : 0.91 ,
"explanationKo" : "์๋ํ ์ธ 2๊ตฌ๊ฐ + ํฉํ ์ ํ ์ ์ถ๊ฐ ํ ์ธ ์๋ด ํผํฉ ๊ท์น"
}
8.3 ์ฑ
์ ํ์ด์งํ ๊ฐ๊ฒฉ + ํ์ง ์ต์
+ ์ค์ ํ์ (3๋๋ฉ์ธ ํผํฉ)
{
"outputType" : "mixed_rules" ,
"constraints" : [
{
"constraintName" : "์ฑ
์โ200g์ด์ ํ์ง๋ง" ,
"triggerOptionType" : "BINDING" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๋ฌด์ " , "PUR" , "์ค์ฒ " ] ,
"extraConditions" : { "coverType" : "COVER" } ,
"actions" : [ { "type" : "filter_options" , "targetOption" : "PAPER" , "allowedValues" : [ "์ํธ์ง200g" , "์ค๋
ธ์ฐ์ง200g" , "๋๋ฐ๋ทฐ200g" , "ํฌ๋ผ์ด์ง250g" ] } ] ,
"confidence" : 0.86
} ,
{
"constraintName" : "์ฑ
์ํ์งโ์ค์ ์๋์ค์ " ,
"triggerOptionType" : "BINDING" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๋ฌด์ " , "PUR" ] ,
"actions" : [ { "type" : "set_default" , "targetOption" : "PROCESS" , "defaultValue" : "์ค์" } ] ,
"confidence" : 0.91
} ,
{
"constraintName" : "200P์ด์โPUR ๊ถ์ฅ" ,
"triggerOptionType" : "PAGES" ,
"triggerOperator" : "gte" ,
"triggerValues" : [ "200" ] ,
"actions" : [ { "type" : "show_message" , "level" : "warn" , "message" : "200ํ์ด์ง ์ด์ ์ฑ
์๋ ๋ด๊ตฌ์ฑ์ ์ํด PUR์ ๋ณธ์ ๊ฐ๋ ฅ ๊ถ์ฅํฉ๋๋ค. ๋ฌด์ ์ ๋ณธ ์ ๋ฒ์ด์ง ์ํ์ด ์์ต๋๋ค." } ] ,
"confidence" : 0.93
}
] ,
"priceRules" : {
"outputType" : "price_mode_suggestion" ,
"priceModeRecommendation" : {
"mode" : "PAGE" ,
"reasoning" : "์ฑ
์๋ ํ์ด์ง์์ ์ธ์๋ฐฉ์(ํ์ง/๋ด์ง ๊ตฌ๋ถ)์ผ๋ก ์๊ฐ๊ฐ ๊ฒฐ์ ๋ฉ๋๋ค. PAGE ๋ชจ๋๊ฐ ๊ฐ์ฅ ์ ํฉํฉ๋๋ค."
} ,
"confidence" : 0.96 ,
"explanationKo" : "์ฑ
์ โ PAGE ๋ชจ๋(ํ์ด์งํ) ๊ฐ๊ฒฉ ๊ณ์ฐ ๊ถ์ฅ"
} ,
"totalActions" : 4 ,
"confidence" : 0.90 ,
"explanationKo" : "์ฑ
์ 4๊ฐ์ง ๋ณตํฉ ๊ท์น: ํ์ด์งํ ๊ฐ๊ฒฉ๋ชจ๋ + ํ์ง ์ฉ์ง ์ ํ + ์ค์ ๊ธฐ๋ณธ๊ฐ + 200P PUR ๊ถ์ฅ"
}
9. Few-shot ์์ โ ์ฐ์ ๊ท์น (AโBโC ์ฒด์ธ)
9.1 ๋น๊ท๊ฒฉ โ ๋ฉด์ ๊ฐ๊ฒฉ โ ์ต์๋ฉด์ ๊ฒฝ๊ณ ์ฒด์ธ
{
"outputType" : "composite_constraints" ,
"totalRules" : 2 ,
"rules" : [
{
"constraintName" : "์์ ํโ๋ฉด์ ๊ฐ๊ฒฉ ์ ํ" ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "free" ] ,
"actions" : [ { "type" : "change_price_mode" , "newMode" : "AREA" } ] ,
"confidence" : 0.95 ,
"ruleOrder" : 1
} ,
{
"constraintName" : "์๋ฉด์ โ์ต์์ฃผ๋ฌธ ๊ฒฝ๊ณ " ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "lte" ,
"triggerValues" : [ "0.05" ] ,
"extraConditions" : { "unit" : "sqm" , "priceMode" : "AREA" } ,
"actions" : [ { "type" : "show_message" , "level" : "error" , "message" : "์ต์ ์ฃผ๋ฌธ ๋ฉด์ ์ 0.05ใก(500ใ )์
๋๋ค. ์ฌ์ด์ฆ๋ฅผ ๋ค์ ํ์ธํด์ฃผ์ธ์." } ] ,
"confidence" : 0.88 ,
"ruleOrder" : 2 ,
"dependsOn" : "์์ ํโ๋ฉด์ ๊ฐ๊ฒฉ ์ ํ"
}
] ,
"executionOrder" : [ 0 , 1 ] ,
"confidence" : 0.91 ,
"explanationKo" : "์์ ํ ์ ํ โ ๋ฉด์ ๊ฐ๊ฒฉ ๋ชจ๋ ์ ํ โ ์ต์ ๋ฉด์ ๋ฏธ๋ง์ด๋ฉด ์ค๋ฅ ์๋ด (2๋จ๊ณ ์ฒด์ธ)"
}
9.2 ์ค์ฒ ์ ๋ณธ โ ํ์ด์ง์ 4๋ฐฐ์ โ ์ง์ ํ์ธ ์ฒด์ธ
{
"outputType" : "composite_constraints" ,
"totalRules" : 2 ,
"rules" : [
{
"constraintName" : "์ค์ฒ โ4๋ฐฐ์ ํ์ด์ง๋ง" ,
"triggerOptionType" : "BINDING" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "์ค์ฒ " ] ,
"actions" : [ { "type" : "filter_options" , "targetOption" : "PAGES" , "allowedValues" : [ "4" , "8" , "12" , "16" , "20" , "24" , "28" , "32" , "36" , "40" , "44" , "48" , "52" , "56" , "60" , "64" ] } ] ,
"confidence" : 0.99 ,
"ruleOrder" : 1
} ,
{
"constraintName" : "์ค์ฒ 40P์ด์โํฌ๋ฆฝ๋ณด์ ์๋ด" ,
"triggerOptionType" : "PAGES" ,
"triggerOperator" : "gte" ,
"triggerValues" : [ "40" ] ,
"extraConditions" : { "binding" : "์ค์ฒ " } ,
"actions" : [ { "type" : "show_message" , "level" : "info" , "message" : "์ค์ฒ ์ ๋ณธ 40ํ์ด์ง ์ด์์ ํฌ๋ฆฝ(creep) ๋ณด์ ์ด ํ์ํฉ๋๋ค. ๋ด์ง ๋ฐ๊นฅ์ชฝ ๋ด์ฉ์ด ์๋ฆฌ์ง ์๋๋ก ์ฌ๋ฐฑ์ ์ฌ์ ์๊ฒ ์ก์์ฃผ์ธ์." } ] ,
"confidence" : 0.92 ,
"ruleOrder" : 2
}
] ,
"executionOrder" : [ 0 , 1 ] ,
"confidence" : 0.95 ,
"explanationKo" : "์ค์ฒ โ 4๋ฐฐ์ ํ์ด์ง ์ ํ โ 40P ์ด์์ด๋ฉด ํฌ๋ฆฝ ๋ณด์ ์๋ด"
}
10. Few-shot ์์ โ TypeScript ์คํฌ๋ฆฝํธ ์์ฑ (๋ณต์ก ๊ท์น) ๋ณต์ก๋๊ฐ ๋์ ๋ณตํฉ ๊ท์น์ ๊ฒฝ์ฐ GLM์ด ์ง์ ์คํ ๊ฐ๋ฅํ TypeScript ์ฝ๋๋ฅผ ์์ฑํฉ๋๋ค.
10.1 NL โ Drizzle ์ฝ์
์คํฌ๋ฆฝํธ
{
"outputType" : "mixed_rules" ,
"constraints" : [
{
"constraintName" : "์์ ํโ์นผ์ ํ์ผ ํ์" ,
"triggerOptionType" : "SIZE" ,
"triggerOperator" : "equals" ,
"triggerValues" : [ "free" ] ,
"actions" : [ { "type" : "require_option" , "targetOption" : "CUT_LINE_FILE" } ] ,
"confidence" : 0.97
} ,
{
"constraintName" : "ํฌ๋ช
PVCโPP์ฝํ
์ ์ธ" ,
"triggerOptionType" : "PAPER" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "ํฌ๋ช
PVC" , "OPP" ] ,
"actions" : [ { "type" : "exclude_options" , "targetOption" : "COATING" , "excludeValues" : [ "๋ฌด๊ดPP" , "์ ๊ดPP" ] } ] ,
"confidence" : 0.98
} ,
{
"constraintName" : "๋ฐ๊ฐ๊ณตโ๋ํ๋น ์๋์ถ๊ฐ" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๊ธ๋ฐ" , "์๋ฐ" , "ํ๋ก๊ทธ๋จ" ] ,
"actions" : [ { "type" : "auto_add" , "productId" : 244 , "qty" : 1 } ] ,
"confidence" : 0.95
}
] ,
"priceRules" : {
"outputType" : "qty_discount" ,
"qtyDiscountTiers" : [
{ "qtyMin" : 1 , "qtyMax" : 99 , "discountRate" : 0 , "discountLabel" : "๊ธฐ๋ณธ๊ฐ" } ,
{ "qtyMin" : 100 , "qtyMax" : 499 , "discountRate" : 0.05 , "discountLabel" : "์๋ํ ์ธ" } ,
{ "qtyMin" : 500 , "qtyMax" : null , "discountRate" : 0.10 , "discountLabel" : "๋๋ํ ์ธ" }
] ,
"confidence" : 0.97 ,
"explanationKo" : "100~499์ฅ 5%, 500์ฅ ์ด์ 10% ์๋ํ ์ธ"
} ,
"totalActions" : 4 ,
"confidence" : 0.96 ,
"explanationKo" : "๋๋ฌด์ก ์คํฐ์ปค 4๊ฐ์ง ๋ณตํฉ ๊ท์น" ,
"implementationScript" : "// Auto-generated by GLM NL Builder\n// ์คํ ์ recipeId์ productId๋ฅผ ์ค์ ๊ฐ์ผ๋ก ๊ต์ฒดํ์ธ์\n\nimport { db } from '@/packages/db';\nimport { recipeConstraints, qtyDiscount } from '@/packages/db/schema';\n\nasync function applyRules(recipeId: number, productId: number) {\n await db.transaction(async (tx) => {\n // Rule 1: ์์ ํโ์นผ์ ํ์ผ ํ์\n await tx.insert(recipeConstraints).values({\n recipeId,\n inputMode: 'nl',\n constraintName: '์์ ํโ์นผ์ ํ์ผ ํ์',\n triggerOptionType: 'SIZE',\n triggerOperator: 'equals',\n triggerValues: JSON.stringify(['free']),\n actions: JSON.stringify([{type: 'require_option', targetOption: 'CUT_LINE_FILE'}]),\n isActive: true,\n });\n\n // Rule 2: ํฌ๋ช
PVCโPP์ฝํ
์ ์ธ\n await tx.insert(recipeConstraints).values({\n recipeId,\n inputMode: 'nl',\n constraintName: 'ํฌ๋ช
PVCโPP์ฝํ
์ ์ธ',\n triggerOptionType: 'PAPER',\n triggerOperator: 'in',\n triggerValues: JSON.stringify(['ํฌ๋ช
PVC', 'OPP']),\n actions: JSON.stringify([{type: 'exclude_options', targetOption: 'COATING', excludeValues: ['๋ฌด๊ดPP', '์ ๊ดPP']}]),\n isActive: true,\n });\n\n // Rule 3: ๋ฐ๊ฐ๊ณตโ๋ํ๋น ์๋์ถ๊ฐ\n await tx.insert(recipeConstraints).values({\n recipeId,\n inputMode: 'nl',\n constraintName: '๋ฐ๊ฐ๊ณตโ๋ํ๋น ์๋์ถ๊ฐ',\n triggerOptionType: 'PROCESS',\n triggerOperator: 'in',\n triggerValues: JSON.stringify(['๊ธ๋ฐ', '์๋ฐ', 'ํ๋ก๊ทธ๋จ']),\n actions: JSON.stringify([{type: 'auto_add', productId: 244, qty: 1}]),\n isActive: true,\n });\n\n // Rule 4: ์๋ํ ์ธ ๊ตฌ๊ฐ\n await tx.insert(qtyDiscount).values([\n { productId, qtyMin: 1, qtyMax: 99, discountRate: '0.00', label: '๊ธฐ๋ณธ๊ฐ' },\n { productId, qtyMin: 100, qtyMax: 499, discountRate: '0.05', label: '์๋ํ ์ธ' },\n { productId, qtyMin: 500, qtyMax: null, discountRate: '0.10', label: '๋๋ํ ์ธ' },\n ]);\n });\n}"
}
10.2 ์คํฌ๋ฆฝํธ ์ถ์ถ ๋ฐ ์คํ ํจํด
async function handleMixedRuleWithScript (
output : MixedRuleOutput ,
recipeId : number ,
productId : number
): Promise <void > {
if (output.implementationScript ) {
const scriptPath = `scripts/generated/rule-${Date .now()} .ts` ;
await fs.writeFile (scriptPath, output.implementationScript );
console .log (`Generated script saved to: ${scriptPath} ` );
}
await confirmRules (output.constraints , output.priceRules , recipeId, productId);
}
11. Few-shot ์์ โ ์๋ํ ์ธ (๋ค์ํ ํจํด)
11.1 ๊ธฐ๋ณธ 3๊ตฌ๊ฐ ํ ์ธ
{
"outputType" : "qty_discount" ,
"qtyDiscountTiers" : [
{ "qtyMin" : 1 , "qtyMax" : 99 , "discountRate" : 0 , "discountLabel" : "๊ธฐ๋ณธ๊ฐ" } ,
{ "qtyMin" : 100 , "qtyMax" : 499 , "discountRate" : 0.05 , "discountLabel" : "์๋ํ ์ธ" } ,
{ "qtyMin" : 500 , "qtyMax" : 999 , "discountRate" : 0.10 , "discountLabel" : "์ค๋ํ ์ธ" } ,
{ "qtyMin" : 1000 , "qtyMax" : null , "discountRate" : 0.15 , "discountLabel" : "๋๋ํน๊ฐ" }
] ,
"confidence" : 0.97 ,
"explanationKo" : "4๊ตฌ๊ฐ ์๋ํ ์ธ: ๊ธฐ๋ณธ/์๋/์ค๋/๋๋"
}
11.2 ๋จ์ 2๊ตฌ๊ฐ
{
"outputType" : "qty_discount" ,
"qtyDiscountTiers" : [
{ "qtyMin" : 1 , "qtyMax" : 50 , "discountRate" : 0 , "discountLabel" : "๊ธฐ๋ณธ๊ฐ" } ,
{ "qtyMin" : 51 , "qtyMax" : null , "discountRate" : 0.03 , "discountLabel" : "์๋ํ ์ธ" }
] ,
"confidence" : 0.98 ,
"explanationKo" : "50์ฅ ์ดํ ์ ๊ฐ, 51์ฅ ์ด์ 3% ํ ์ธ"
}
11.3 ํ๊ฐ๊ณต ์กฐ๊ฑด๋ถ ํ ์ธ (๋ณตํฉ)
{
"outputType" : "mixed_rules" ,
"constraints" : [
{
"constraintName" : "๋ฐ๊ฐ๊ณตโ์๋ํ ์ธ ์ ์ธ ์๋ด" ,
"triggerOptionType" : "PROCESS" ,
"triggerOperator" : "in" ,
"triggerValues" : [ "๊ธ๋ฐ" , "์๋ฐ" , "ํ๋ก๊ทธ๋จ" ] ,
"actions" : [ { "type" : "show_message" , "level" : "warn" , "message" : "๋ฐ๊ฐ๊ณต ํฌํจ ์ฃผ๋ฌธ์ ์๋ํ ์ธ์ด ์ ์ฉ๋์ง ์์ต๋๋ค." } ] ,
"confidence" : 0.89
}
] ,
"priceRules" : {
"outputType" : "qty_discount" ,
"qtyDiscountTiers" : [
{ "qtyMin" : 1 , "qtyMax" : 499 , "discountRate" : 0 , "discountLabel" : "๊ธฐ๋ณธ๊ฐ" } ,
{ "qtyMin" : 500 , "qtyMax" : null , "discountRate" : 0.10 , "discountLabel" : "๋๋ํ ์ธ" }
] ,
"confidence" : 0.92 ,
"explanationKo" : "500์ฅ ์ด์ 10% ํ ์ธ (๋ฐ๊ฐ๊ณต ์ ์ธ)"
} ,
"totalActions" : 2 ,
"confidence" : 0.90 ,
"explanationKo" : "์๋ํ ์ธ + ๋ฐ๊ฐ๊ณต ์์ธ ์๋ด ํผํฉ ๊ท์น"
}
12. ๊ฐ๊ฒฉ ๋ชจ๋ ์ ์ (price_mode_suggestion)
12.1 4๊ฐ์ง ๋ชจ๋ ์ ํ ๊ธฐ์ค LOOKUP (๋จ๊ฐํํ) โ ์ ํฉ:
- ๊ท๊ฒฉ์ด ์ ํด์ง ์ํ (๋ช
ํจ 90ร50, ์ ๋จ์ง A4 ๋ฑ)
- ์๋๋ณ ๋จ๊ฐํ๊ฐ ์๋ ์ํ
- ์: ์๋ 100์ฅ โ ๋จ๊ฐ 150์ โ ์ด 15,000์
AREA (๋ฉด์ ํ) โ ์ ํฉ:
- ๋น๊ท๊ฒฉ, ์์ ํ ์ฌ์ด์ฆ ์ํ
- ํ์๋ง, ๋ฐฐ๋, ๋ํ ์คํฐ์ปค, ๋กค์
- ์: 90cm ร 180cm โ 1.62ใก ร 45,000์/ใก
PAGE (ํ์ด์งํ) โ ์ ํฉ:
- ์ฑ
์, ๋ธ๋ก์
, ์นดํ๋ก๊ทธ
- ํ์ง/๋ด์ง ๊ตฌ๋ถ, ํ์ด์ง์, ์ ๋ณธ ๋ฐฉ์์ด ์๊ฐ ๊ฒฐ์
- ์: 32ํ์ด์ง ๋ฌด์ โ ๋ด์ง ์ถ๋ ฅ๋น + ํ์ง + ์ ๋ณธ๋น
COMPOSITE (๋ณตํฉ๊ฐ์ฐํ) โ ์ ํฉ:
- ๊ธฐ๋ณธ๋น + ํ๊ฐ๊ณต ์ต์
๋ณ ์ถ๊ฐ๋น ํฉ์ฐ ์ํ
- ๋ฐ๊ฐ๊ณต+๋๋ฌด์ก+์ฝํ
๋ฑ ๋ณตํฉ ํ๊ฐ๊ณต ์ํ
- ์: ๊ธฐ๋ณธ 10,000์ + ๋ฐ๊ฐ๊ณต 5,000์ + ๋๋ฌด์ก 3,000์
12.2 ๊ฐ๊ฒฉ ๋ชจ๋ ์ ์ ์์
{
"outputType" : "mixed_rules" ,
"constraints" : [ ] ,
"priceRules" : {
"outputType" : "price_mode_suggestion" ,
"priceModeRecommendation" : {
"mode" : "AREA" ,
"reasoning" : "๋ฐฐ๋/ํ์๋ง์ ๊ณ ๊ฐ์ด ์ง์ ๊ฐ๋กร์ธ๋ก๋ฅผ ์
๋ ฅํ๋ ๋น๊ท๊ฒฉ ์ํ์
๋๋ค. ๋ฉด์ (ใก)๋น ๋จ๊ฐ๋ก ๊ณ์ฐํ๋ AREA ๋ชจ๋๊ฐ ๊ฐ์ฅ ์ ํฉํฉ๋๋ค. ์ต์ ์ฃผ๋ฌธ ๋ฉด์ (min_area_sqm)์ ์ค์ ํ์ฌ ์๋ ์ฃผ๋ฌธ๋ ๊ด๋ฆฌํ์ธ์."
} ,
"confidence" : 0.97 ,
"explanationKo" : "๋ฐฐ๋/ํ์๋ง โ AREA ๋ชจ๋ ๊ถ์ฅ"
} ,
"totalActions" : 1 ,
"confidence" : 0.97 ,
"explanationKo" : "๋น๊ท๊ฒฉ ์ฌ์ด์ฆ ์ํ์ AREA(๋ฉด์ ํ) ๊ฐ๊ฒฉ ๋ชจ๋๋ฅผ ๊ถ์ฅํฉ๋๋ค"
}
13. DB ์คํค๋ง ์ฐธ์กฐ
13.1 price_nl_history (์ ๊ท โ SPEC-WB-007)
export const priceNlHistory = pgTable ('price_nl_history' , {
id : serial ('id' ).primaryKey (),
productId : integer ('product_id' ).notNull ()
.references (() => wbProducts.id , { onDelete : 'cascade' }),
priceConfigId : integer ('price_config_id' )
.references (() => productPriceConfigs.id , { onDelete : 'set null' }),
ruleType : varchar ('rule_type' , { length : 30 }).notNull (),
nlInputText : text ('nl_input_text' ).notNull (),
nlInterpretation : jsonb ('nl_interpretation' ),
aiModelVersion : varchar ('ai_model_version' , { length : 50 }),
interpretationScore : decimal ('interpretation_score' , { precision : 3 , scale : 2 }),
totalRulesGenerated : integer ('total_rules_generated' ).default (1 ),
isApproved : boolean ('is_approved' ).notNull ().default (false ),
approvedBy : varchar ('approved_by' , { length : 100 }),
approvedAt : timestamp ('approved_at' , { withTimezone : true }),
appliedTiers : jsonb ('applied_tiers' ),
appliedConstraintIds : jsonb ('applied_constraint_ids' ),
generatedScript : text ('generated_script' ),
deviationNote : text ('deviation_note' ),
createdBy : varchar ('created_by' , { length : 100 }).notNull (),
createdAt : timestamp ('created_at' , { withTimezone : true }).notNull ().defaultNow (),
}, (t ) => [
index ('idx_pnh_product' ).on (t.productId ),
index ('idx_pnh_rule_type' ).on (t.ruleType ),
index ('idx_pnh_approved' ).on (t.isApproved , t.productId ),
]);
13.2 ๊ธฐ์กด ์ฐ๊ณ ํ
์ด๋ธ recipe_constraints (03-recipe-constraints.ts)
- inputMode: 'manual' | 'template' | 'nl' โ NL ๋ณํ ๊ฒฐ๊ณผ ์ ์ฅ
- triggerOptionType, triggerOperator, triggerValues (JSONB)
- actions (JSONB) โ 8์ข
์ก์
๋ฐฐ์ด
constraint_nl_history (03-constraint-nl-history.ts)
- ECA ์ ์ฝ NL ํ์คํ ๋ฆฌ ๊ฐ์ฌ ๋ก๊ทธ (๊ธฐ์กด, SPEC-WB-003)
product_price_configs (04-product-price-configs.ts)
- priceMode: 'LOOKUP' | 'AREA' | 'PAGE' | 'COMPOSITE'
- formulaText โ ๊ด๋ฆฌ์ ๋ฉ๋ชจ์ฉ ๊ณต์ ํ
์คํธ
recipe_choice_restrictions
- WowPress rst_* ํจํด์ ์๊ตฌ ์ ์ฝ (Allow/Exclude)
14. tRPC ์๋ํฌ์ธํธ ์ธํฐํ์ด์ค
const convertRule = protectedProcedure
.input (z.object ({
recipeId : z.number ().optional (),
productId : z.number ().optional (),
nlText : z.string ().min (5 ).max (1000 ),
ruleHint : z.enum (['constraint' , 'price' , 'composite' , 'auto' ]).default ('auto' ),
availableOptions : z.array (z.string ()).optional (),
availableValues : z.record (z.array (z.string ())).optional (),
}))
.mutation (async ({ input }) => {
});
const confirmRules = protectedProcedure
.input (z.object ({
recipeId : z.number (),
productId : z.number (),
nlText : z.string (),
conversion : z.union ([
SingleConstraintOutputSchema ,
CompositeConstraintOutputSchema ,
QtyDiscountOutputSchema ,
MixedRuleOutputSchema ,
]),
approvedBy : z.string (),
}))
.mutation (async ({ input, ctx }) => {
});
15. ๊ตฌํ ์ฃผ์์ฌํญ
15.1 ๋ณตํฉ ๊ท์น ํธ๋์ญ์
๋ณด์ฅ
await db.transaction (async (tx) => {
for (const constraint of constraints) {
await tx.insert (recipeConstraints).values ({...});
}
if (priceRules?.outputType === 'qty_discount' ) {
await tx.insert (qtyDiscount).values (priceRules.qtyDiscountTiers .map (...));
}
await tx.insert (priceNlHistory).values ({
totalRulesGenerated : constraints.length + (priceRules ? 1 : 0 ),
...
});
});
15.2 outputType ์๋ ํ๋จ ๋ก์ง function detectOutputType (nlText : string ): 'constraint' | 'price' | 'auto' {
const priceKeywords = ['ํ ์ธ' , '% ํ ์ธ' , '์๋' , '๊ตฌ๊ฐ' , '๊ฐ๊ฒฉ ๊ณ์ฐ' , '๋ฉด์ ' , 'ํ์ด์งํ' ];
const constraintKeywords = ['๋ชป ์ฐ๊ฒ' , '์ ์ธ' , 'ํ์' , '์ ๋' , '์๋ ์ถ๊ฐ' , '์๋ด' ];
const hasPrice = priceKeywords.some (kw => nlText.includes (kw));
const hasConstraint = constraintKeywords.some (kw => nlText.includes (kw));
if (hasPrice && hasConstraint) return 'auto' ;
if (hasPrice) return 'price' ;
if (hasConstraint) return 'constraint' ;
return 'auto' ;
}
15.3 GLM_API_KEY ๋ณด์
if (typeof window !== 'undefined' ) {
throw new Error ('GLM service: server-only module' );
}
16. ๊ด๋ จ ํ์ผ ์์น SPEC: .moai/specs/SPEC-WB-007/spec.md
Plan: .moai/specs/SPEC-WB-007/plan.md
WowPress ๋๋ฉ์ธ: .claude/skills/innojini-wowpress/SKILL.md
์ธ์ ๊ธฐ์ด: .claude/skills/innojini-printing-foundation/SKILL.md
DB ์คํค๋ง ์ฐธ์กฐ: .claude/skills/innojini-huni-db-schema/SKILL.md
DB Schema: packages/db/src/schema/widget/04-price-nl-history.ts (์ ๊ท)
packages/db/src/schema/widget/03-constraint-nl-history.ts (๊ธฐ์กด ์ฐธ์กฐ)
packages/db/src/schema/widget/03-recipe-constraints.ts (๊ธฐ์กด ์ฐธ์กฐ)
Backend: apps/web/app/api/_lib/services/glm.service.ts (์ ๊ท)
apps/web/app/api/trpc/routers/glm.router.ts (์ ๊ท)
apps/web/app/api/trpc/utils/constraint-transformer.ts (์ ๊ท)
apps/web/app/api/trpc/utils/price-rule-transformer.ts (์ ๊ท)
apps/web/app/api/trpc/router.ts (์์ )
Admin UI: apps/admin/src/components/glm/nl-rule-panel.tsx (์ ๊ท)
apps/admin/src/components/glm/conversion-preview.tsx (์ ๊ท)
apps/admin/src/hooks/use-glm-convert.ts (์ ๊ท)
Tests: apps/web/__tests__/services/glm.test.ts
apps/web/__tests__/utils/constraint-transformer.test.ts
apps/web/__tests__/utils/price-rule-transformer.test.ts
apps/web/__tests__/pricing/glm-router.test.ts
packages/db/__tests__/schema/price-nl-history.test.ts
Version: 2.0.0
SPEC: SPEC-WB-007
Updated: 2026-02-27
Changes from 1.0.0:
Added WowPress req_/rst_ pattern mapping
Added composite_constraints outputType (multi-rule)
Added mixed_rules outputType (price + constraint)
Added chain rules with executionOrder (AโBโC)
Added TypeScript/Drizzle script generation
Added 15+ new few-shot examples (expanded from 8)
Added automatic outputType detection logic
Added transaction guarantee for composite rules