Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is pseudo code for how a core language model would work at instantiation.
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