Last active
March 17, 2025 01:11
-
-
Save revolunet/a72db249efd68a416d1f99104f3ca451 to your computer and use it in GitHub Desktop.
publicodes loop pseudo-code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pseudo-code | |
const engine = new Publicode(rules); | |
const inputs = {} | |
while(engine.missingVariables.length) { | |
// get next question from publi.codes decision tree | |
// has question, schema... | |
const missing = engine.missingVariables[0]; | |
// send question to the user in the chat UI | |
// process answer with LLM if needed | |
// cast answer to required missing.schema | |
const answer = await askUser(missing); | |
// store answer in inputs | |
inputs[answer.id] = answer | |
// update publi.codes model | |
engine.setSituation(inputs); | |
} | |
// display final result | |
display(engine.result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Orange", | |
"siret": "38012986648625" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment