-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
804 lines (597 loc) · 26.7 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
Character
name
Age
skills (list)
traits (list)
associative_memory
scratch_memory
focus
health
physical condition
mood
rest //https://rimworldwiki.com/wiki/Rest#Levels_of_Rest
food_saturation //https://rimworldwiki.com/wiki/Saturation
thirsty //https://dwarffortresswiki.org/index.php/Thirst
Body attributes
https://dwarffortresswiki.org/index.php/DF2014:Attribute
ch decide if take action based on factors ( skills...) or manually assignment
ch find place for this action (e.x forest:trees)
go to place (time)
execute action (time)
generate or not random event
calculate success percentage of action's result
calculate amount and quality of extracted materials based on factors ( skills, timeframe...)
ch thoughts for this action emotional statement
ch calculate physical condition (tired)
ch calculate needs (hunger, thirst)
ch decide what to do with the materials
ch transfer material to the desired spot
------------------------
ch decide when to eat
ch decide when to drink
Fell trees
Cut down trees
Axe trees
Bring down trees
Timber harvesting
Deforest
Log trees
Harvest timber
Lumber trees
Clear-cut trees
Tree removal
Logging
Tree felling
Timber extraction
Forest clearing
Tree cutting
Tree elimination
Tree destruction
Tree removal
Timber logging
write a list of synonyms for the phrase "fishing"
Angling
Casting a line
Hooking
Trawling
Netting
Fly-fishing
Spearfishing
Seining
Gillnetting
Ice fishing
Freshwater fishing
Saltwater fishing
Sportfishing
Deep-sea fishing
Line fishing
Catching fish
Reeling in
Landing a catch
Noodling fishing
Jug fishing
Rod and reel fishing
Actions (composition)
move (single -> action)
talk
find
explore
think
doTask
Task
action_pointer = 0
Actions -> List<action>
find place/object/person -> ai or cached
move to place -> front
result
ExecuteActions
"tasks": [
{
"id": 1,
"title": "gather wood from trees",
"full_descr": "{CHARACTER} want to chop trees.",
"patterns": [
"Fell trees",
"Cut down trees",
"Axe trees",
"Bring down trees",
"Timber harvesting",
"Log trees",
"Harvest timber",
"Lumber trees",
"Clear-cut trees",
"Tree removal",
"Logging",
"Tree felling",
"Timber extraction",
"Forest clearing",
"Tree cutting",
"Tree elimination",
"Tree destruction",
"Tree removal",
"Timber logging"
],
"factors": [{"type": "skill", "id" : 1 , "multiplier" : 0.2}
],
"steps": [
{"action": "find", "params" : 'section/arena/gameObject'}
{"action": "move", "params" : 'section/arena/gameObject'}
{"ret": "move", "params" : 'section/arena/gameObject'}
],
"resuts": [{"type": "material", "id" : 1 , "singleU_obtain_time" : 60}
]
},
class baseAction
start_time
end_time
descr
class findAction(baseAction)
find_section -> ai or existing -> ret string
find_arena -> ai or existing -> ret string
find_game_object -> ai or existing -> ret string
class moveAction(baseAction)
ret section/arena/gameObject -> front will find nearest
ret {x,y}
ret null only log to db
class takeAction(baseAction)
add_to_inventory
GatherWoodTaskExecution
step 1:
retFind = decideLocationAction(task.full_descr, character) ret section/arena/gameObject (e.x tree)
write retFind find at task, not to hit ai all the time
{task_execution_id :1, id:action_id, action:find, section/arena/gameObject : tree or whatever, callback:onFinish}
step 2:
front must send (tree or whatever )
validate if tree or whatever is valid game object
interval depends on task results get minimum interval.
intreval depends on character skill which may increase or decrease the interval
ret {task_execution_id :1, id:action_id, action:chop , section/arena/gameObject :tree or whatever, callback:{progress, interval : 60 sec}}
step 3:
interval from previous
if material update store of materials at front
db TasksExecution
id
character_id
onFrontMove
send api calculate physical condition (tired)
log player x,y
log moveAction
This is a fictional scenario for a game.
If the action is not available enclose the action in #.
The probability should always be a number based on reality.
actions available: {find, move, chop tree, mining, collect}
Current activity: Fell trees for wood
1) move to forest
2) find {tree}
3) chop {tree}
probability of find {tree} at forest : 100%
Current activity: collect {gold}
1) move to mining site
2) mining {gold}
probability of find gold at mining site : 0.2%
Current activity: Gather food from the forest (foraging)
1) move to forest
2) collect {blackberries}
probability of find {blackberries} at forest : 80%
Current activity: Hunt for game in the forest
1) move to forest
2) #hunting# {rabbits}
probability of find {rabbits} at forest : 60%
Current activity: Search for suitable land for farming
--------------------------------------------------------------
This is a fictional scenario for a game.
It is Medieval Period in a fictional place near a forest where Alex is trying to survive.
Alex's inventory: axe
What actions should be taken in order to achieve his goals?
Avoid generic actions try to be specific.
List the items in json list.Write one action per row.
Example output json:[{action:'fell trees for wood', purspose:'use in building and crafting'}]
{ "action": "scout the forest perimeter", "purpose": "identify potential threats and resources" },
{ "action": "inspect the axe for damage", "purpose": "ensure it's in optimal condition for use" },
{ "action": "gather dry leaves and twigs", "purpose": "prepare for starting a fire" },
{ "action": "locate a water source", "purpose": "ensure a sustainable water supply" },
{ "action": "search for edible plants and berries", "purpose": "secure a food source" },
{ "action": "set up a basic shelter using fallen branches", "purpose": "provide rudimentary protection" },
{ "action": "listen for wildlife sounds", "purpose": "detect potential dangers or opportunities" },
{ "action": "create a makeshift map of the immediate area", "purpose": "aid in navigation and future planning" },
{ "action": "carve a wooden spear", "purpose": "improve personal defense capabilities" },
{ "action": "establish a hidden storage spot for valuable items", "purpose": "protect essential belongings" }
-----------------------------------
available actions: {find, move, chop tree, collect, mining, reeling in}.
If the available action is not in the available actions set always reply with none.
Be more specific about the result if the statement is too generic.
activity: fell trees for wood to use in building and crafting
real action: fell trees
available action : chop tree
results: [wood logs]
activity: hunt for game in the forest
real action: hunt
available action : none
results: [rabbits, deers]
activity: collect berries, nuts, and edible plants
real action: collect
available action : collect
results: [berries, burdock, dandelion]
activity: locate a water source
------------------------------------
categories: food, construction
objects: iron ore, copper ore, fish, berries
classify the objects in the categories .List the items in json list.
Example output json:[{object:'wood', categories:'construction'}]
------------------------------------
This is a fictional scenario for a game.
activity: Fell trees for wood to use in building and crafting
game items: [tree, dandelion]
What game items could be obtained from the activity?
If you can't find the item answer "no item available".
Answer:
--------------------------
This is a fictional scenario for a game with a fixed number of items.
The items that you can gather as resources are : tree, dandelion, rabbits
The activity is "Hunt for game in the forest"
Is there any resource from the above realtive to this activity ?
Answer with yes or no
What [game items] are relative to the activity?
If the items are not listed in [game items] answer "no item available".
Answer:
______________________ STARTING THOUGHTS ______________________
⭐
It is Medieval Period in a fictional place near a forest where Alex is trying to survive.
Alex's inventory: axe
Alex's saturation: fed
What actions should be taken in order to achieve his goals?
Priority should have values from 1 to 10 where 10 is extremely important for the current situation.
Avoid generic actions try to be specific.
List the items in json list.Write one action per row.
Classify each action to the following categories : gather resources-materials = 1, crafting-building = 2, planting = 3, unknown = 4
Example output json:[{action:'fell trees for wood', purpose:'use in building and crafting', priority: 4, category:1}]
{ "action": "scout the forest perimeter", "purpose": "identify potential threats and resources" },
{ "action": "inspect the axe for damage", "purpose": "ensure it's in optimal condition for use" },
{ "action": "gather dry leaves and twigs", "purpose": "prepare for starting a fire" },
{ "action": "locate a water source", "purpose": "ensure a sustainable water supply" },
{ "action": "search for edible plants and berries", "purpose": "secure a food source" },
{ "action": "set up a basic shelter using fallen branches", "purpose": "provide rudimentary protection" },
{ "action": "listen for wildlife sounds", "purpose": "detect potential dangers or opportunities" },
{ "action": "create a makeshift map of the immediate area", "purpose": "aid in navigation and future planning" },
{ "action": "carve a wooden spear", "purpose": "improve personal defense capabilities" },
{ "action": "establish a hidden storage spot for valuable items", "purpose": "protect essential belongings" }
______________________ CREATE ACTION LLM ______________________
1)
activity: Fish in nearby rivers or streams
classify the activity to one of the following categories : gather resources-materials, crafting-building, planting
1.1)
action: fell trees for wood to use in building and crafting
what resource should be gathered to complete the action above.
The resource must be directly related to the action.
The resource must be a tangible material that can be transferred and stored in a warehouse.
Output the response in json.
Example output json:{resource:'fish'}
search in resources embeddings for similar or by exact string. if similar repeat the saved action.
ask ai from the existing resources knowledge list
1.2)
action: fell trees for wood to use in building and crafting
What action should be executed at tree to gather logs.
search in actions embeddings for similar or by exact string. if similar repeat the saved action.
ask ai from the existing resources actions list
--------------------------------------------
2)
This is a fictional scenario for a game with a fixed number of items.
The items that you can gather as resources are : tree, dandelion
activity: fell trees for wood to use in building and crafting
item exist in list: yes
existing resources : tree
---
activity: hunt for game in the forest
item exist in list: no
existing resources : none
new generated resources: rabbit, deer
---
activity: Locate a clean water source
Output the response only for the last activity in json.
TODO:: the generated resource must be a resource (check: Locate a clean water source)
TODO:: use spacy to mconvert plural nouns to singular nouns
--------------------------------------------
2.1) ⭐
The items that you can use to gather the required resources are : tree, dandelion
activity: fell trees for wood to use in building and crafting
existing items : tree
---
activity: hunt for game in the forest
existing items : none
new generated items: rabbit, deer
---
activity: Locate a clean water source
Output the response only for the last activity in json.
2.2) ⭐
action: fell trees for wood to use in building and crafting
what resource should be gathered from tree to complete the action above.
The resource must be directly related to the action.
The resource must be a tangible material that can be transferred and stored in a warehouse.
Output the response in json.
Example output json:{resource:'fish'}
Any natural substance that humans use can be considered a natural resource
A resource is any physical material that is a part of our planet, earth, that humans value or require.
On the basis of tier availability, resources can be classified into two types: Renewable and nonrenewable resources.
Resources are divided into two categories based on their origin: biotic and abiotic resources.
--------------------------------------------
3) ⭐
action: fell trees for wood to use in building and crafting
What action should be executed at tree to gather logs.
Output only the verb.
Answer:
--------------------------------------------
4)
TODO:: define the unit of the item 1 tree 1kg of stone
TODO:: define if the item is a living thing or non-living thing
TODO:: define if the item is moving
TODO:: define if the item is below or above earth surface (need digging)
TODO:: define the mass of the object how many tiles of the grid we need to place the object
TODO:: probability of find {rabbits} at forest : 60%
--------------------------------------------
5)
Given a medieval-themed game scenario where characters engage in various resource-gathering activities, I need realistic time estimates for each task to enhance the game's authenticity. Please provide estimates for the following activities
chop tree.
gather leaves and twigs.
Hunting rabbits.
Fishing at lake.
Mining for ore.
List the items in json list.Write one action per row.
Example output json:[{action:'collecting water', estimated_time_in_seconds:'120 to 240', estimated_quantity: '1 to 2 @ litres'}]
----------------------------------------------------------
This is a fictional scenario for a game with items in a grid map.
Action: Collect berries, nuts, and edible plants
status: removed, removed-respawn, not removed
Choose one from the status above to describe the tree after the activity?
TODO:: find respawn time
⭐
This is a classification task -- choose an appropriate item from the item options for a task at hand.
Game Object: plant.
Status Options Available (Class label): {removed, removed-respawn, not removed}.
Classification Task: Collect berries, nuts, and edible plants.
Choose one or more options from the provided Status options to describe the status of the Game Object after the activity?
If there is no appropriate status do not choose anything.
Output the response in json in the following format : {status:'removed'}
⭐
Item Options Available (Class label): Boxwood, Boxelder, oak tree, Butterfly flower, Black cherry, Coffee plant, Golden buttons.
Categories Options Available (Class label): Windflowers, Thistle, Flowers, Mushrooms, Weed, Fern, Reeds, Bamboo, Ivy, Moss, Grass, Palm Tree, Corn, Tree, Bush, Shrub, Cattails, Herbs.
Given a 2d tiled game with each tile to represent 1x1 meters in real scale calculate realisticly how much space in tiles for each from the item options.
Also Categorize each item from the the item options into the provided Categories Options Available.
Output the response in json in the following format : [apple tree: {size:'2x2', category: 'tree'}]
https://leverageedu.com/blog/plants/
⭐
For each from the item options categorize it from the provided Categories Options.
Rewrite the sentence above in proper english
______________________ FRONT/API CREATE ACTION ______________________
fell trees for wood to use in building and crafting
CREATE ACTION LLM -> 1
IF category == gather resources-materials
GatherResourcesTask(thought = fell trees for wood to use in building and crafting, llm)
create
get_selected_sections() -> llm find appropriate place-section
get_selected_game_objects() -> get game objects from selected sections and CREATE ACTION LLM -> 2
[{"sector": 1, "game_objects": [4]}] where 1 = forest, 4 = tree
if sector does not exist return error cannot find place or the charachter should explore new areas
if retured game_objects does not exist CREATE ACTION LLM -> 4 create new material
CREATE ACTION LLM -> 3. create synonyms for the action and create embeddings
save new action
update
when new thought match with embeddings action and the thought does not exists as synonym
when new sections in the game
when new game objects at selected sections of the action
@@@
This is a fictional scenario for a game with items in a grid map.
activity: chop tree
Suppose that the resource unit is in front of us and we have the right tools. Assume that we only need 1 unit of this item.
On the scale of 1 to 10, where 1 is quick and 10 is extremely time consuming, rate the final result of this action.
Output only the result number.
Suppose that the resource unit is in front of us and we have the right tools.
How much time in average do a normal person needs in order to gather a berrie.
Output only the number in seconds
I need to create a pc game where characters gather materials. For example
chops a tree
character collecting herbs
character hunting rabbits
character fishing at the lake
I need to determine how much time each task will take to obtain a resource based on reality. Can you generate a prompt for asking ai about Realistic Time Estimates for a specific task ?
This is a fictional scenario for a game with items in a grid map.
Propose a fictional resource gathering rate in seconds as much close to reality.
Suppose that the resource unit is in front of us and we have the right tools.
activity: fell trees for wood to use in building and crafting
resource: tree
action: chop
seconds to gather 1 unit: 2000
activity: extract ore
resource: ore
action: mining
seconds to gather 1 unit : 3600
activity: Collect berries, nuts, and edible plants
resource: berries
action: collect
seconds to gather 1 unit :
import random
# Initialize a 100x100 grid with all zeros (0 represents ground)
grid_size = 100
grid = [["0"] * grid_size for _ in range(grid_size)]
# Function to add a tree to the grid
def add_tree(grid, x, y):
if 0 <= x < grid_size and 0 <= y < grid_size:
grid[y][x] = "🌲"
# Function to add a lake to the grid
def add_lake(grid, lake_size):
# Randomly choose a position for the lake
lake_x = random.randint(10, grid_size - 20)
lake_y = random.randint(10, grid_size - 20)
# Fill the area with "@" to represent the lake
for i in range(lake_size):
for j in range(lake_size):
x = lake_x + i
y = lake_y + j
if 0 <= x < grid_size and 0 <= y < grid_size:
grid[y][x] = "🌊"
# Function to generate a realistic forest
def generate_forest(grid, num_trees):
for _ in range(num_trees):
# Randomly choose a position for the tree
x = random.randint(0, grid_size - 1)
y = random.randint(0, grid_size - 1)
# Add the tree to the grid
add_tree(grid, x, y)
# Introduce clustering by adding a few more trees around the chosen position
for _ in range(random.randint(3, 7)):
add_tree(grid, x + random.randint(-5, 5), y + random.randint(-5, 5))
# Set the number of trees in the forest and lake size
num_trees_in_forest = 500
lake_size = 15
# Generate the lake
add_lake(grid, lake_size)
# Generate the forest
generate_forest(grid, num_trees_in_forest)
# Print the grid
for row in grid:
print(" ".join(row))
Resources in the Middle Ages can be classified into several categories based on their nature, utility, and significance in the socio-economic context of that time. Here are some broad categories:
Land:
Agricultural land: The primary source of sustenance and wealth.
Pasture land: Used for grazing livestock.
Forests: Provided wood for construction and fuel, as well as hunting grounds.
Labor:
Serfs/Peasants: The workforce bound to the land, providing labor in exchange for protection.
Craftsmen: Skilled workers who produced goods such as tools, clothing, and household items.
Guildsmen: Members of guilds, organized groups of craftsmen that regulated and protected their trade.
Minerals and Metals:
Iron, copper, tin, and other metals for tools and weapons.
Stone for construction.
Crops and Food Resources:
Grains (wheat, barley, oats): Staple food sources.
Livestock (cattle, sheep, pigs): Provided meat, milk, leather, and wool.
Water Resources:
Rivers and streams for transportation, irrigation, and milling.
Wells and springs for drinking water.
Trade and Commerce:
Trade routes: Controlled access to valuable goods and facilitated economic exchange.
Marketplaces: Hubs for buying and selling goods.
Human Capital:
Intellectual resources: Scholars, monks, and scribes who preserved knowledge.
Military strength: Soldiers and knights for defense and conquest.
Buildings and Infrastructure:
Castles and fortifications for defense.
Churches and monasteries for religious and cultural purposes.
Roads and bridges for transportation.
Knowledge and Education:
Manuscripts and books: Preserved knowledge in religious, scientific, and literary works.
Monastic schools: Centers of education and scholarship.
Money and Currency:
Coins: Used for trade and transactions.
Social and Political Resources:
Nobility: Landowners and rulers who held political power.
Monarchy: Centralized political authority.
These categories illustrate the diverse range of resources that were essential for survival, economic prosperity, and societal organization during the Middle Ages. Keep in mind that the significance of each resource varied across different regions and time periods within the Middle Ages.
--- DI ---
https://www.netguru.com/blog/dependency-injection-with-python-make-it-easy
https://github.com/kodemore/kink
--- react ---
https://najm-eddine-zaga.medium.com/react-render-multiple-layouts-with-react-router-dom-v6-7a42bd984acf
--- libs ---
https://annoraaq.github.io/grid-engine/
https://github.com/mroderick/PubSubJS
https://game-icons.net/
--- data ---
https://github.com/dariusk/corpora/blob/master/data/plants/plants.json
https://gist.github.com/damzaky/59c5b7f10722c828309400611a627869
--- Dijkstra's algorithm ---
https://www.google.com/search?q=dijkstra+visit+all+nodes&rlz=1C1GCEU_enGR928GR928&oq=dijgstra+visit+all&gs_lcrp=EgZjaHJvbWUqCAgBEAAYFhgeMgYIABBFGDkyCAgBEAAYFhgeMggIAhAAGBYYHjIICAMQABgWGB4yDQgEEAAYhgMYgAQYigUyDQgFEAAYhgMYgAQYigUyDQgGEAAYhgMYgAQYigUyDQgHEAAYhgMYgAQYigUyDQgIEAAYhgMYgAQYigXSAQkxMjQxM2owajeoAgCwAgA&sourceid=chrome&ie=UTF-8
https://gist.github.com/Prottoy2938/66849e04b0bac459606059f5f9f3aa1a
https://www.algorithms-and-technologies.com/dijkstra/javascript
--- etc ---
https://abagames.github.io/joys-of-small-game-development-en/tools/for_handheld.html
https://gamedev.stackexchange.com/questions/184767/what-is-the-unity-way-to-approach-tech-design-for-a-2d-game-like-this
https://rory.itch.io/modern-mmorpg-ui
--- dynamic generation ---
https://blog.pbbg.com/dynamic-and-repeatable-tilemap-generation/
https://github.com/Descrout/2D-Terrain-Generator
https://github.com/leodeslf/perlin-noise
https://github.com/thetarby/noise-js
---- start conv ------
const embedding = await embeddingsCache.fetch(
ctx,
`${player.name} is talking to ${otherPlayer.name}`,
);
`You are ${player.name}, and you just started a conversation with ${otherPlayer.name}.`,
if (agent) {
prompt.push(`About you: ${agent.identity}`);
prompt.push(`Your goals for the conversation: ${agent.plan}`);
}
if (otherAgent) {
prompt.push(`About ${otherPlayer.name}: ${otherAgent.identity}`);
}
prompt.push(
`Last time you chatted with ${
otherPlayer.name
} it was ${prev.toLocaleString()}. It's now ${now.toLocaleString()}.`,
);
if (memories.length > 0) {
prompt.push(`Here are some related memories in decreasing relevance order:`);
for (const memory of memories) {
prompt.push(' - ' + memory.description);
}
}
---- continue conv ------
const embedding = await embeddingsCache.fetch(
ctx,
`What do you think about ${otherPlayer.name}?`,
);
const prompt = [
`You are ${player.name}, and you're currently in a conversation with ${otherPlayer.name}.`,
`The conversation started at ${started.toLocaleString()}. It's now ${now.toLocaleString()}.`,
];
prompt.push(
`Below is the current chat history between you and ${otherPlayer.name}.`,
`DO NOT greet them again. Do NOT use the word "Hey" too often. Your response should be brief and within 200 characters.`,
);
---- end conv ------
const prompt = [
`You are ${player.name}, and you're currently in a conversation with ${otherPlayer.name}.`,
`You've decided to leave the question and would like to politely tell them you're leaving the conversation.`,
];
prompt.push(
`Below is the current chat history between you and ${otherPlayer.name}.`,
`How would you like to tell them that you're leaving? Your response should be brief and within 200 characters.`,
);
---- summarize ------
const llmMessages: LLMMessage[] = [
{
role: 'user',
content: `You are ${player.name}, and you just finished a conversation with ${otherPlayer.name}. I would
like you to summarize the conversation from ${player.name}'s perspective, using first-person pronouns like
"I," and add if you liked or disliked this interaction.`,
},
];
ai-town/convex/agent/memory.ts
calculateImportance
On the scale of 0 to 9, where 0 is purely mundane (e.g., brushing teeth, making bed) and 9 is extremely poignant (e.g., a break up, college acceptance), rate the likely poignancy of the following piece of memory.
const llmMessages: LLMMessage[] = [
{
role: 'user',
content: `You are ${player.name}, and you just finished a conversation with ${otherPlayer.name}. I would
like you to summarize the conversation from ${player.name}'s perspective, using first-person pronouns like
"I," and add if you liked or disliked this interaction.`,
},
];
insertMemory, {
agentId,
playerId: player.id,
description,
importance,
lastAccess: messages[messages.length - 1]._creationTime,
data: {
type: 'conversation',
conversationId,
playerIds: [...authors],
},
embedding,
}
persona.a_mem.add_thought(created, expiration, s, p, o, thought, keywords, thought_poignancy, thought_embedding_pair, None)
focal_points = [f"{target_persona.scratch.name}"]
retrieved = new_retrieve(init_persona, focal_points, 50)
relationship = generate_summarize_agent_relationship(init_persona, target_persona, retrieved)
this.httpFactory.request(this.urls.getPropertyInsuredObjectTypes, { method: 'GET' }).execute()