Skip to content

Commit

Permalink
20241026 @Mookse
Browse files Browse the repository at this point in the history
- strange bot idiot-proofing around entry `summary` and `content`
- cosmetic
  • Loading branch information
Mookse committed Oct 26, 2024
1 parent f6ee622 commit 2ccda94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion inc/js/mylife-factory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -538,16 +538,23 @@ class AgentFactory extends BotFactory {
id=this.newGuid,
keywords=[],
mbr_id=this.mbr_id,
summary,
title=`Untitled ${ defaultForm } ${ defaultType }`,
} = entry
let {
content,
summary,
} = entry
if(this.isMyLife)
throw new Error('System cannot store entries of its own')
let { name, } = entry
name = name
?? `${ defaultType }_${ form }_${ title.substring(0,64) }_${ mbr_id }`
summary = summary
?? content
if(!summary?.length)
throw new Error('entry summary required')
content = content
?? summary
/* assign default keywords */
if(!keywords.includes('entry'))
keywords.push('entry')
Expand All @@ -557,6 +564,7 @@ class AgentFactory extends BotFactory {
...entry,
...{
being,
content,
form,
id,
keywords,
Expand Down
2 changes: 1 addition & 1 deletion inc/json-schemas/openai/functions/entrySummary.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
},
"summary": {
"description": "Generate `entry` summary from member input",
"description": "Generate `entry` summary from member content",
"type": "string"
},
"title": {
Expand Down

0 comments on commit 2ccda94

Please sign in to comment.