Merge remote-tracking branch 'origin/main' into MVP

# Conflicts:
#	src/service/aios_shell/aios_shell.py
This commit is contained in:
Liu Zhicong
2023-11-08 22:17:50 -08:00
5 changed files with 45 additions and 27 deletions
+4 -2
View File
@@ -70,10 +70,12 @@ class ComputeNodeConfig:
def remove_node(self, model_type: str, url: str, model_name: str):
if model_type == "llama":
llama_nodes_cfg = self.config.get("llama") or []
for i in range(0, len(llama_nodes_cfg)):
cfg = llama_nodes_cfg[i]
i = 0
for cfg in llama_nodes_cfg:
if url == cfg["url"] and model_name == cfg["model_name"]:
llama_nodes_cfg.pop(i)
else:
i += 1
def list(self) -> str:
return toml.dumps(self.config)
+2 -1
View File
@@ -471,8 +471,9 @@ class Workflow:
async def _get_prompt_from_session(self,the_role:AIRole,chatsession:AIChatSession) -> AgentPrompt:
messages = chatsession.read_history(the_role.history_len) # read last 10 message
result_prompt = AgentPrompt()
for msg in reversed(messages):
if msg.sender == chatsession.owner_id:
if msg.sender == the_role.role_id:
result_prompt.messages.append({"role":"assistant","content":msg.body})
else:
result_prompt.messages.append({"role":"user","content":f"{msg.body}"})