adding player class
Browse files- .DS_Store +0 -0
- app.py +18 -7
- data/classes/Player.json +0 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from autogen.agentchat.contrib.retrieve_user_proxy_agent import (
|
|
| 13 |
PROMPT_CODE,
|
| 14 |
)
|
| 15 |
|
| 16 |
-
TIMEOUT =
|
| 17 |
|
| 18 |
|
| 19 |
def initialize_agents(config_list, docs_path=None):
|
|
@@ -155,7 +155,7 @@ with gr.Blocks() as demo:
|
|
| 155 |
def update_config(config_list):
|
| 156 |
global assistant, ragproxyagent
|
| 157 |
config_list = autogen.config_list_from_models(
|
| 158 |
-
model_list=[os.environ.get("MODEL", "gpt-
|
| 159 |
)
|
| 160 |
if not config_list:
|
| 161 |
config_list = [
|
|
@@ -178,12 +178,12 @@ with gr.Blocks() as demo:
|
|
| 178 |
ragproxyagent._model = config_list[0]["model"]
|
| 179 |
return config_list
|
| 180 |
|
| 181 |
-
def set_params(model, oai_key, aoai_key, aoai_base):
|
| 182 |
os.environ["MODEL"] = model
|
| 183 |
os.environ["OPENAI_API_KEY"] = oai_key
|
| 184 |
os.environ["AZURE_OPENAI_API_KEY"] = aoai_key
|
| 185 |
os.environ["AZURE_OPENAI_API_BASE"] = aoai_base
|
| 186 |
-
return model, oai_key, aoai_key, aoai_base
|
| 187 |
|
| 188 |
txt_model = gr.Dropdown(
|
| 189 |
label="Model",
|
|
@@ -195,6 +195,17 @@ with gr.Blocks() as demo:
|
|
| 195 |
value="gpt-35-turbo",
|
| 196 |
container=True,
|
| 197 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
txt_oai_key = gr.Textbox(
|
| 199 |
label="OpenAI API Key",
|
| 200 |
placeholder="Enter key and press enter",
|
|
@@ -254,9 +265,9 @@ with gr.Blocks() as demo:
|
|
| 254 |
# show_copy_button=True,
|
| 255 |
)
|
| 256 |
|
| 257 |
-
def respond(message, chat_history, model, oai_key, aoai_key, aoai_base):
|
| 258 |
global config_list
|
| 259 |
-
set_params(model, oai_key, aoai_key, aoai_base)
|
| 260 |
config_list = update_config(config_list)
|
| 261 |
messages = chatbot_reply(message)
|
| 262 |
_msg = (
|
|
@@ -302,7 +313,7 @@ with gr.Blocks() as demo:
|
|
| 302 |
|
| 303 |
txt_input.submit(
|
| 304 |
respond,
|
| 305 |
-
[txt_input, chatbot, txt_model, txt_oai_key, txt_aoai_key, txt_aoai_base_url],
|
| 306 |
[txt_input, chatbot],
|
| 307 |
)
|
| 308 |
txt_prompt.submit(update_prompt, [txt_prompt], [txt_prompt])
|
|
|
|
| 13 |
PROMPT_CODE,
|
| 14 |
)
|
| 15 |
|
| 16 |
+
TIMEOUT = 120
|
| 17 |
|
| 18 |
|
| 19 |
def initialize_agents(config_list, docs_path=None):
|
|
|
|
| 155 |
def update_config(config_list):
|
| 156 |
global assistant, ragproxyagent
|
| 157 |
config_list = autogen.config_list_from_models(
|
| 158 |
+
model_list=[os.environ.get("MODEL", "gpt-3.5-turbo")],
|
| 159 |
)
|
| 160 |
if not config_list:
|
| 161 |
config_list = [
|
|
|
|
| 178 |
ragproxyagent._model = config_list[0]["model"]
|
| 179 |
return config_list
|
| 180 |
|
| 181 |
+
def set_params(model, oai_key, aoai_key, aoai_base, aoai_context):
|
| 182 |
os.environ["MODEL"] = model
|
| 183 |
os.environ["OPENAI_API_KEY"] = oai_key
|
| 184 |
os.environ["AZURE_OPENAI_API_KEY"] = aoai_key
|
| 185 |
os.environ["AZURE_OPENAI_API_BASE"] = aoai_base
|
| 186 |
+
return model, oai_key, aoai_key, aoai_base, aoai_context
|
| 187 |
|
| 188 |
txt_model = gr.Dropdown(
|
| 189 |
label="Model",
|
|
|
|
| 195 |
value="gpt-35-turbo",
|
| 196 |
container=True,
|
| 197 |
)
|
| 198 |
+
txt_aoai_context = gr.Dropdown(
|
| 199 |
+
label="Context",
|
| 200 |
+
choices=[
|
| 201 |
+
"Quest_Storage",
|
| 202 |
+
"Track_Function",
|
| 203 |
+
"Test_Track_Function"
|
| 204 |
+
],
|
| 205 |
+
allow_custom_value=True,
|
| 206 |
+
value="Quest_Storage",
|
| 207 |
+
container=True,
|
| 208 |
+
)
|
| 209 |
txt_oai_key = gr.Textbox(
|
| 210 |
label="OpenAI API Key",
|
| 211 |
placeholder="Enter key and press enter",
|
|
|
|
| 265 |
# show_copy_button=True,
|
| 266 |
)
|
| 267 |
|
| 268 |
+
def respond(message, chat_history, model, oai_key, aoai_key, aoai_base, aoai_context):
|
| 269 |
global config_list
|
| 270 |
+
set_params(model, oai_key, aoai_key, aoai_base, aoai_context)
|
| 271 |
config_list = update_config(config_list)
|
| 272 |
messages = chatbot_reply(message)
|
| 273 |
_msg = (
|
|
|
|
| 313 |
|
| 314 |
txt_input.submit(
|
| 315 |
respond,
|
| 316 |
+
[txt_input, chatbot, txt_model, txt_oai_key, txt_aoai_key, txt_aoai_base_url, txt_aoai_context],
|
| 317 |
[txt_input, chatbot],
|
| 318 |
)
|
| 319 |
txt_prompt.submit(update_prompt, [txt_prompt], [txt_prompt])
|
data/classes/Player.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|