Rahul-8799 commited on
Commit
d171858
·
verified ·
1 Parent(s): f053ddb

Update agents/software_architect_agent.py

Browse files
Files changed (1) hide show
  1. agents/software_architect_agent.py +10 -5
agents/software_architect_agent.py CHANGED
@@ -10,12 +10,17 @@ model = AutoModelForCausalLM.from_pretrained(
10
  device_map="auto"
11
  )
12
 
13
- def run(state):
14
- """Designs system architecture from project plan."""
15
- prompt = state["input"]
 
 
16
  input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
17
  output_ids = model.generate(input_ids, max_new_tokens=512)
18
  output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
19
 
20
- new_log = state["chat_log"] + [{"role": "Software Architect", "content": output}]
21
- return {"arch_output": output, "chat_log": new_log}
 
 
 
 
10
  device_map="auto"
11
  )
12
 
13
+ def run(state: dict) -> dict:
14
+ """Software Architect designs overall system architecture"""
15
+ messages = state["messages"]
16
+ prompt = messages[-1]["content"]
17
+
18
  input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
19
  output_ids = model.generate(input_ids, max_new_tokens=512)
20
  output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
21
 
22
+ return {
23
+ "messages": [{"role": "Software Architect", "content": output}],
24
+ "chat_log": state["chat_log"] + [{"role": "Software Architect", "content": output}],
25
+ "arch_output": output,
26
+ }