Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha 0.0.2 #151

Merged
merged 22 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ OPENAI_API_CHAT_RESPONSE_PING_INTERVAL=890 # how often to ping openai service fo
OPENAI_API_KEY=sk-... # your individual openai API key
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MAHT_GITHUB=https://github.com/MyLife-Services/mylife-maht.git
OPENAI_MODEL_CORE="gpt-3.5-turbo"
OPENAI_MAHT_GITHUB_BRANCH=base
OPENAI_MAHT_GPT_OVERRIDE=# localdev version [3.5-turbo]: asst_c8qcXkJS6urevqja5wcZ0za5
OPENAI_MODEL_CORE_AVATAR=gpt-3.5-turbo
OPENAI_MODEL_CORE_BOT=gpt-3.5-turbo
OPENAI_ORG_KEY=org-... # use ours or use your own
PORT=3000 # KOA port
MYLIFE_ALLOW_INTELLIGENT_QUESTIONS=false
Expand Down
2 changes: 2 additions & 0 deletions inc/js/agents/system/bot-assistant.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// creates and manages avatar bot legion
// avatars = personae, secondary personae cannot have certain bots, such as biog-bot
23 changes: 1 addition & 22 deletions inc/js/core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { _ } from 'ajv'
// define export Classes for Members and MyLife
class Member extends EventEmitter {
#avatar
#avatars = []
#categories = [
'Abilities',
'Artifacts',
Expand Down Expand Up @@ -41,15 +40,7 @@ class Member extends EventEmitter {
* @returns {Promise} Promise resolves to this Member class instantiation
*/
async init(){
this.#avatars = await this.factory.getAvatars() // defaults to `this.core` which factory owns; **note**: getAvatars() normally accepts the object dna
if(!this.#avatars.length)
console.log(chalk.red('no avatars found')) // create avatar
const _avatarProperties = {
...this?.avatars[0]??this.core,
proxyBeing: this.being,
}
this.avatar = await this.factory
.getAvatar(undefined,_avatarProperties) // not pulling from db
this.#avatar = await this.factory.getAvatar() // returns fully functional and initializaed avatar
return this
}
/**
Expand Down Expand Up @@ -103,9 +94,6 @@ class Member extends EventEmitter {
throw new Error('avatar requires Avatar Class')
this.#avatar = _Avatar
}
get avatars(){
return this.#avatars
}
/**
* Gets being type. Members are _only_ human prototypes, and presents as human, even though the current manifestation is a datacore `core` being.
* @returns {string} returns 'human'
Expand Down Expand Up @@ -205,15 +193,6 @@ class Member extends EventEmitter {
return this.core.values
}
// public functions
async setAvatar(_avatar){ // whether new or existing, _avatar is an object
const _a = this.#avatars
?.filter(_=>{ return _.id === _avatar.id })[0]
??null
if(!_a || !_a.length){ // if no avatar found, push generated avatar
_a = await this.factory.pushItem(_avatar)
this.#avatars.push(_a)
}
}
async testEmitters(){
// test emitters with callbacks
this.emit('testEmitter',_response=>{
Expand Down
Loading
Loading