Skip to content

Instantly share code, notes, and snippets.

@indraai
Last active January 11, 2021 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indraai/7445302c69555dae417e82e038fbfced to your computer and use it in GitHub Desktop.
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.
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