tdurzynski commited on
Commit
bea540e
Β·
verified Β·
1 Parent(s): 79166c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -127,11 +127,11 @@ orchestrator = AssistantAgent(
127
  )
128
 
129
  # Custom speaker selection function (no LLM needed)
130
- def custom_select_speaker(last_speaker, selector, messages, agents):
131
  """Select the next speaker in a fixed order: FoodRecognizer β†’ SizeEstimator β†’ NutritionFetcher β†’ Orchestrator."""
132
  if last_speaker is None:
133
  return "FoodRecognizer" # Start with FoodRecognizer
134
- order = ["FoodRecognizer", "SizeEstimator", "NutritionFetcher", "Orchestrator"]
135
  current_index = order.index(last_speaker)
136
  next_index = (current_index + 1) % len(order)
137
  return order[next_index]
@@ -145,7 +145,6 @@ group_chat = GroupChat(
145
  )
146
  manager = GroupChatManager(groupchat=group_chat)
147
 
148
-
149
  # Orchestrator Logic (via AutoGen chat)
150
  def orchestrate_workflow(image, nutritionix_key):
151
  start = time.time()
 
127
  )
128
 
129
  # Custom speaker selection function (no LLM needed)
130
+ def custom_select_speaker(last_speaker, groupchat):
131
  """Select the next speaker in a fixed order: FoodRecognizer β†’ SizeEstimator β†’ NutritionFetcher β†’ Orchestrator."""
132
  if last_speaker is None:
133
  return "FoodRecognizer" # Start with FoodRecognizer
134
+ order = [food_recognizer, size_estimator, nutrition_fetcher, orchestrator]
135
  current_index = order.index(last_speaker)
136
  next_index = (current_index + 1) % len(order)
137
  return order[next_index]
 
145
  )
146
  manager = GroupChatManager(groupchat=group_chat)
147
 
 
148
  # Orchestrator Logic (via AutoGen chat)
149
  def orchestrate_workflow(image, nutritionix_key):
150
  start = time.time()