avfranco commited on
Commit
97a82d4
·
1 Parent(s): a8e76c0

ea4all-gradio-mcp-hackathon-runaway

Browse files
ea4all/ea4all_mcp.py CHANGED
@@ -162,7 +162,11 @@ async def run_reference_architecture_agentic_system(business_query: str) -> Asyn
162
  config=config
163
  ) #astream not loading the graph
164
  vision_target = response['vision_target']
165
- architecture_runway = response['architecture_runway']
 
 
 
 
166
  yield [vision_target, architecture_runway]
167
 
168
  async def run_pmo_agentic_system(question:str) -> AsyncGenerator[list, None]:
 
162
  config=config
163
  ) #astream not loading the graph
164
  vision_target = response['vision_target']
165
+ if isinstance(response['architecture_runway'], str):
166
+ architecture_runway = response['architecture_runway']
167
+ else:
168
+ architecture_runway = None
169
+
170
  yield [vision_target, architecture_runway]
171
 
172
  async def run_pmo_agentic_system(question:str) -> AsyncGenerator[list, None]:
ea4all/src/ea4all_gra/togaf_task3/graph.py CHANGED
@@ -177,7 +177,7 @@ def generate_architecture_runway(state: Task3State, config: RunnableConfig):
177
  "architecture_runway": architecture_runway.content
178
  }
179
 
180
- def save_diagram(state: Task3State, config: RunnableConfig, fmt=["svg","png"]):
181
  configuration = AgentConfiguration.from_runnable_config(config)
182
 
183
  #_config = config.get('configurable')
@@ -203,8 +203,9 @@ def save_diagram(state: Task3State, config: RunnableConfig, fmt=["svg","png"]):
203
  view=False,
204
  ).replace('\\', '/')
205
  except Exception as e:
206
- response=f"Error: Agent couldn't parse the diagram at this time! {e} \n {output_img} \n {input_img}"
207
-
 
208
  return{"architecture_runway": response}
209
 
210
  def generate_reference_architecture(state: Task3State):
 
177
  "architecture_runway": architecture_runway.content
178
  }
179
 
180
+ def save_diagram(state: Task3State, config: RunnableConfig, fmt=["svg","png"]) -> dict | Exception:
181
  configuration = AgentConfiguration.from_runnable_config(config)
182
 
183
  #_config = config.get('configurable')
 
203
  view=False,
204
  ).replace('\\', '/')
205
  except Exception as e:
206
+ #response=f"Error: Agent couldn't parse the diagram at this time! {e} \n {output_img} \n {input_img}"
207
+ return e
208
+
209
  return{"architecture_runway": response}
210
 
211
  def generate_reference_architecture(state: Task3State):