Last active
January 11, 2021 02:37
-
-
Save indraai/7445302c69555dae417e82e038fbfced to your computer and use it in GitHub Desktop.
This is pseudo code for how a core language model would work at instantiation.
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
Language Location | |
- en-US | |
- fr-US | |
- es-GB | |
- fr-FR | |
Lang = false | |
Loc = false | |
function SetLangLoc(langloc) | |
const LLArr = lanLoc.split('-'); | |
// LLArr[0] = Language | |
// LLArr[1] = Location | |
Lang = LLArr[0]; | |
Loc = LLArr[1]; | |
/// JSON output of language model. | |
const LangModels = { | |
"en": { | |
"cat": "Cat is an animal that is fluffy with wiskers", | |
"dog": "Dog is fluffy lick face animal", | |
}, | |
"ru": { | |
"als": "salkdjf;akjdf" | |
"jaf": "a;sdkjf" | |
}, | |
"fr": { | |
... | |
}, | |
} | |
// now person talking initiates conversation. | |
// person talking send lang-locale to instance/ | |
// agent sets the language model for interaction an instatiation. | |
Agent.init(ENV.user); | |
// inside agent now | |
Agent = Class Object() | |
Agent.init = (user) => { | |
SetLangLoc(user.langloc) | |
this.langModel = LangModels[Lang] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment