-
Notifications
You must be signed in to change notification settings - Fork 4
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
Updated message reactions #829
base: dev
Are you sure you want to change the base?
Changes from 1 commit
067b421
c0f6e5d
6fe58fe
5db96a7
41b3a4e
63ab1a6
6296aa0
039c23a
cb91177
b289013
dbbd104
fd1c38a
6148e04
1042e59
99a5aef
2965ca6
a000641
6b08665
83dbed6
6c88a77
573d8b6
2c86880
20c8cc2
72511ae
0200cc0
615cc8c
a0ee2c2
e1966a3
b8e93fc
9180283
454ccf1
bcd9f16
9a1fba8
2a1f860
7b5337e
9e9967a
9d0679d
0e4be57
473a4f4
e100853
0d49b94
cf43af1
f08b0af
8cdb850
67c7658
47047e9
a314c52
1c3b747
c75aed4
e4c0827
706bba8
6250b65
948146c
72c6964
9465fa0
5c3c748
37dc44b
1d181c3
84c0448
d9303e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import { loadMessagesFromDatabase } from '../util/loadMessagesFromDatabase'; | |
|
||
export class ConversationObject extends EventTarget { | ||
agent: ActiveAgentObject; // the current agent | ||
currentAgentSpecs: object; // the current agent's spec | ||
currentAgentPlayer: Player; // the current agent's player | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure the We should rethink the data model so all of the data is one type rather than having the remote players in the |
||
agentsMap: Map<string, Player>; // note: agents does not include the current agent | ||
scene: SceneObject | null; | ||
getHash: GetHashFn; // XXX this can be a string, since conversation hashes do not change (?) | ||
|
@@ -47,11 +47,11 @@ export class ConversationObject extends EventTarget { | |
this.scene = scene; | ||
this.getHash = getHash; | ||
this.mentionsRegex = mentionsRegex; | ||
this.currentAgentSpecs = { | ||
this.currentAgentPlayer = new Player(agent.id, { | ||
id: agent.id, | ||
name: agent.name, | ||
bio: agent.bio, | ||
}; | ||
name: agent.agentJson.name, | ||
bio: agent.agentJson.bio, | ||
}); | ||
this.messageCache = new MessageCacheConstructor({ | ||
loader: async () => { | ||
const supabase = this.agent.appContextValue.useSupabase(); | ||
|
@@ -104,19 +104,19 @@ export class ConversationObject extends EventTarget { | |
return this.agent; | ||
} | ||
|
||
setCurrentAgentSpecs(agentSpec: object) { | ||
this.currentAgentSpecs = agentSpec; | ||
setCurrentAgentPlayer(player: Player) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we unify the data model, these probably won't be needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed with update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the Agent's Player is itself available in the agentsMap, any functions related to the currentAgent are removed |
||
this.currentAgentPlayer = player; | ||
} | ||
|
||
getCurrentAgentSpecs() { | ||
return this.currentAgentSpecs; | ||
getCurrentAgentPlayer() { | ||
return this.currentAgentPlayer; | ||
} | ||
|
||
appendCurrentAgentSpecs(agentSpec: object) { | ||
this.currentAgentSpecs = { | ||
...this.currentAgentSpecs, | ||
this.currentAgentPlayer.setPlayerSpec({ | ||
...this.currentAgentPlayer.getPlayerSpec(), | ||
...agentSpec, | ||
}; | ||
}); | ||
} | ||
// setAgent(agent: ActiveAgentObject) { | ||
// this.agent = agent; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about the data model more: do we need the conversation to be aware of the current agent at all? Can the conversation just be a bag of messages and players, while the current agent is tracked external to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i agree, the conversation doesnt have to include the active agent object, the conversation should only require the Agent represented as a player in the conversation