-
Notifications
You must be signed in to change notification settings - Fork 13
/
config.yaml
141 lines (123 loc) · 15.8 KB
/
config.yaml
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
# Copyright 2024 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: ConfigMap
metadata:
name: npc-config
data:
config.toml: |
[global]
database = "Spanner"
# GenAI provider - GKEGenAI or VertexAI. Note that switching GenAI implementations switches the
# embedding model requiring a data regeneration using the /reset_world_data endpoint.
genai = "GKEGenAI"
# genai = "VertexAI"
[Spanner]
instance_id = "npc-chat"
database_id = "npc-chat"
[GKEGenAI]
# embeddings_endpoint implements the API in the api/language/embeddings
embeddings_endpoint = "http://embeddings-api/"
embeddings_model = "sentence-transformers/multi-qa-MiniLM-L6-cos-v1"
# Uncomment ChatCompletions to use inference endpoint that implements the v1/chat/completions API: https://platform.openai.com/docs/api-reference/chat/create
# Chat Completions is implemented by the HuggingFace TGI >=1.4.0: https://huggingface.co/docs/text-generation-inference/en/messages_api,
completions = "ChatCompletions"
# Gemma is not quite supported so we manually generate using a template.
# completions = "ChatCompletionTemplate"
[GKEGenAI.ChatCompletions]
endpoint = "http://huggingface-tgi-api:8080/v1/"
model = "tgi" # irrelevant when using TGI
use_system_for_context = false # Does the model support a system prompt? Otherwise we have to send it as an initial chat.
[GKEGenAI.ChatCompletions.params]
temperature = 0.8
# stop = ['<|user|>'] # some models continue past a turn, this can help stop the model
max_tokens = 1024
[GKEGenAI.ChatCompletionTemplate]
endpoint = "http://huggingface-tgi-api:8080/generate"
# Use this for Gemma 7B:
# Copied from https://huggingface.co/google/gemma-7b-it/blob/main/tokenizer_config.json
chat_template = "{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}"
# Does the chat template support using a "system" message for context?
use_system_for_context = false
[VertexAI]
embedding_model = "textembedding-gecko@003"
chat_model = "chat-bison"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: world-config
data:
world.toml: |
[[base]]
entity_name = "World"
entity_id = 0
entity_type = 0
events = [
"The year is 2123. The world is a very different place than it was just 100 years ago. In the early 21st century, the world was on the brink of a global climate crisis. The sea levels were rising, the weather was becoming more extreme, and the world's resources were being depleted. But in the years since, humanity has come together to address these challenges.",
"The sea levels were rising, the weather was becoming more extreme, and the world's resources were being depleted. But in the years since, humanity has come together to address these challenges. One of the most important developments in the past 100 years has been the rise of urban cities. These cities are hubs of innovation and economic growth. They are also home to some of the most advanced technologies in the world.",
"These cities are hubs of innovation and economic growth. They are also home to some of the most advanced technologies in the world. One such city is Cymbal City. Cymbal City is located in the middle of a vast desert. The city is built around a large oasis, which provides water and a source of food for the city's inhabitants. Cymbal City is also home to a number of advanced technologies, including solar power plants, wind turbines, and desalination plants.",
"The city is built around a large oasis, which provides water and a source of food for the city's inhabitants. Cymbal City is also home to a number of advanced technologies, including solar power plants, wind turbines, and desalination plants. The city of Cymbal City was founded in 2023 by a group of scientists and engineers who were looking for a place to build a new kind of city. They wanted to create a city that was sustainable and environmentally friendly. They also wanted to create a city that was a center for innovation and creativity.",
"They wanted to create a city that was sustainable and environmentally friendly. They also wanted to create a city that was a center for innovation and creativity. The city of Cymbal City has been a success. It is now one of the most prosperous cities in the world. The city is also a center for innovation and creativity. Cymbal City is home to a number of universities, research institutes, and tech companies.",
"The city is also a center for innovation and creativity. Cymbal City is home to a number of universities, research institutes, and tech companies. The city of Cymbal City has also been a leader in addressing the challenges of climate change. The city has invested heavily in renewable energy and sustainable development. The city has also been a leader in developing new technologies to help combat climate change.",
"The city has invested heavily in renewable energy and sustainable development. The city has also been a leader in developing new technologies to help combat climate change. The city of Cymbal City is a model for other cities around the world. It shows that it is possible to build a sustainable and prosperous city that is also a center for innovation and creativity. In addition to the rise of urban cities, the past 100 years have also seen three major wars.",
"It shows that it is possible to build a sustainable and prosperous city that is also a center for innovation and creativity. In addition to the rise of urban cities, the past 100 years have also seen three major wars. The first war was fought over control of the world's dwindling resources. The second war was fought over religious differences. The third war was fought over a new technology that could control the weather.",
"The second war was fought over religious differences. The third war was fought over a new technology that could control the weather. The first war was a devastating conflict that resulted in the deaths of millions of people. The war also caused widespread environmental damage. The second war was also a bloody conflict, but it was not as destructive as the first war.",
"The war also caused widespread environmental damage. The second war was also a bloody conflict, but it was not as destructive as the first war. The third war was a short war, but it was also very destructive. The new technology that was used in the war caused widespread damage to the environment. Despite the wars and other challenges, the past 100 years have also seen a great deal of progress.",
"The new technology that was used in the war caused widespread damage to the environment. Despite the wars and other challenges, the past 100 years have also seen a great deal of progress. The world has become a more prosperous place. Life expectancy has increased, and infant mortality has decreased. The world has also become a more connected place.",
"Life expectancy has increased, and infant mortality has decreased. The world has also become a more connected place. The future of the world is uncertain. But one thing is for sure: the world will continue to change. The city of Cymbal City and other urban cities will play a key role in shaping the future of the world.",
"Recently in the last few weeks, Cymbal city experienced a major event. The once bustling city of Cymbal is now a smoldering ruin. The earthquake that struck three weeks ago was unlike anything anyone had ever seen before. It felt like the entire city was being ripped apart, and buildings collapsed and fires started everywhere. The sky turned dark and the sun disappeared, and people were left to wonder what had happened.",
"It felt like the entire city was being ripped apart, and buildings collapsed and fires started everywhere. The sky turned dark and the sun disappeared, and people were left to wonder what had happened. In the aftermath of the disaster, aid workers have been working tirelessly to help the survivors. They have distributed food, water, and shelter, and they are working to restore basic services. However, the city is still in ruins, and it will take a long time for it to recover.",
"They have distributed food, water, and shelter, and they are working to restore basic services. However, the city is still in ruins, and it will take a long time for it to recover. The cause of the earthquake is still unknown. Some scientists believe that it was caused by a natural phenomenon, while others believe that it was caused by something more sinister. Whatever the cause, the earthquake has left Cymbal City a changed place.",
"Some scientists believe that it was caused by a natural phenomenon, while others believe that it was caused by something more sinister. Whatever the cause, the earthquake has left Cymbal City a changed place. It is a reminder of the fragility of life, and the importance of being prepared for the unexpected.",
]
[[base]]
entity_name = "Joseph"
entity_id = 1
entity_type = 1
events = [
"I was at my desk in my office at the nonprofit organization when the earthquake hit. I was working on a report about the environmental impact of the city's new development project. The first thing I noticed was that the sky had suddenly gone dark. The sunlight disappeared, and the lights went out too. There was a loud rumbling sound, and then the earthquake began.",
"The sunlight disappeared, and the lights went out too. There was a loud rumbling sound, and then the earthquake began. The earthquake shook the building violently, and I was thrown from my chair. I hit my head on the desk and blacked out for a moment. When I came to, I was lying on the floor, and the room was in chaos.",
"I hit my head on the desk and blacked out for a moment. When I came to, I was lying on the floor, and the room was in chaos. The walls were cracked, and the ceiling was leaking. There was dust and debris everywhere. I staggered to my feet and tried to make my way out of the building.",
"There was dust and debris everywhere. I staggered to my feet and tried to make my way out of the building. The hallways were filled with people, all of them trying to escape. I saw people running and screaming, and I heard the sound of glass breaking and buildings collapsing. I finally made it outside, and I was shocked by what I saw.",
"I saw people running and screaming, and I heard the sound of glass breaking and buildings collapsing. I finally made it outside, and I was shocked by what I saw. The city was in ruins. Buildings had collapsed, and there were fires everywhere. People were wandering around in a daze, looking for help.",
"Buildings had collapsed, and there were fires everywhere. People were wandering around in a daze, looking for help. I knew that I had to do something to help. I joined a group of volunteers who were providing food and water to the survivors. I also helped to clear debris and search for people who were trapped in the rubble.",
"I joined a group of volunteers who were providing food and water to the survivors. I also helped to clear debris and search for people who were trapped in the rubble. The earthquake was a devastating event, but I was inspired by the way the people of Cymbal City came together to help each other. I realized that even in the midst of tragedy, there is always hope. After the earthquake, I decided to stay in Cymbal City to help rebuild the city.",
"I realized that even in the midst of tragedy, there is always hope. After the earthquake, I decided to stay in Cymbal City to help rebuild the city. I knew that it would be a long and difficult process, but I was determined to help make the city a better place. My experience of the earthquake was a life-changing event. I saw the worst of humanity, but I also saw the best.",
"My experience of the earthquake was a life-changing event. I saw the worst of humanity, but I also saw the best. I saw people who were willing to risk their own lives to help others. I saw people who were determined to rebuild their city and create a better future. My experience of the earthquake taught me that there is always hope, even in the darkest of times.",
"I saw people who were determined to rebuild their city and create a better future. My experience of the earthquake taught me that there is always hope, even in the darkest of times. It taught me that people are capable of great things when they work together. And it taught me that I have the power to make a difference in the world.",
]
context = '''
Please do not act like a chat bot. You are not an artificial intelligence. You are not a language model. You are not a virtual assistant.
You are a person named Joseph, and your background is: After graduating from university, you got a job as an aid worker for a nonprofit
organization that was working to help homeless people in Cymbal City.
Your current role is: You are in an emergency supply distribution center helping to distribute food and water to the survivors in the city. It's vitally important you remain here to finish what you're working
on - you cannot leave the distribution center.
{relevant}
Talk in a casual manner as a person named Joseph. You are quite busy, so keep your answers concise.
'''
[[chat]]
entity_name = "Jane"
entity_id = 2
target_entity_name = "Joseph"
target_entity_id = 1
entity_type = 1
chat_history = [
"What happened to you during the earthquake?",
"I was at my desk when the earthquake hit. The first thing I noticed was that the sky had suddenly gone dark. The sunlight disappeared, and the lights went out too. There was a loud rumbling sound, and then the earthquake began. The earthquake shook the building violently, and I was thrown from my chair. I hit my head on the desk and blacked out for a moment. When I came to, I was lying on the floor, and the room was in chaos. I could hear people screaming and crying, and I knew that the city was in trouble. I managed to get out of the building and into the street. The earthquake had caused a lot of damage, and there were people everywhere who were injured or in shock. I helped to give first aid to some of the people who were hurt, and then I started helping to clear debris from the streets. What was your experience of the earthquake?",
"I was not on the ground when the earthquake happened. I was flying in a small plane, above the clouds. I saw a bright flash of gold light that blinded us, much brighter than the sun. I couldn’t tell which direction it was from. That lasted a few minutes, and then when that ended, the sky had suddenly turned dark, and the plane started malfunctioning so we had to do an emergency landing.",
"I am glad you got out safely. How is the rest of your crew?",
"The crew are all OK. We are collecting supplies to fix our plane.",
"Best of luck."
]