bottemplates/store-server.gbai/store-server.gbdialog/auto-register.bas

13 lines
272 B
QBasic
Raw Normal View History

PARAM query AS STRING
existing = SEARCH PRODUCTS query, 1
IF LEN(existing) > 0 THEN
RETURN existing[0]
END IF
info = LLM "Extract product info: " + query + ". Return JSON {name, category, brand, description}"
info.is_active = true
SAVE "products", info
RETURN info