fastworkflow 2.17.14__py3-none-any.whl → 2.17.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -184,7 +184,7 @@ def run_main(args):
184
184
 
185
185
  with contextlib.suppress(queue.Empty):
186
186
  if command_output := fastworkflow.chat_session.command_output_queue.get(
187
- timeout=1.0
187
+ timeout=180.0
188
188
  ):
189
189
  print_command_output(command_output)
190
190
  while not fastworkflow.chat_session.workflow_is_complete or args.keep_alive:
@@ -108,12 +108,23 @@ class fastWorkflowReAct(Module):
108
108
  trajectory = {}
109
109
  max_iters = input_args.pop("max_iters", self.max_iters)
110
110
  idx = 0
111
+ exception_count = 0
111
112
  while True:
112
113
  try:
113
114
  pred = self._call_with_potential_trajectory_truncation(self.react, trajectory, **input_args)
114
115
  except ValueError as err:
115
- logger.warning(f"Ending the trajectory: Agent failed to select a valid tool: {_fmt_exc(err)}")
116
- break
116
+ trajectory[f"observation_{idx}"] = f"Agent failed to select a valid tool: {_fmt_exc(err)}"
117
+ idx += 1 # this is the counter for the index of the entire trajectory
118
+ trajectory[f"thought_{idx}"] = (
119
+ "To execute a command, I should use the execute_workflow_query tool"
120
+ )
121
+ trajectory[f"observation_{idx}"] = "Use the execute_workflow_query tool with a single argument called 'command' formatted as plain text using the command name and parameter values"
122
+ idx += 1 # this is the counter for the index of the entire trajectory
123
+ exception_count += 1
124
+ if exception_count > 2:
125
+ break
126
+ else:
127
+ continue
117
128
 
118
129
  trajectory[f"thought_{idx}"] = pred.next_thought
119
130
  trajectory[f"tool_name_{idx}"] = pred.next_tool_name
@@ -186,7 +186,7 @@ def _execute_workflow_query(command: str, chat_session_obj: fastworkflow.ChatSes
186
186
 
187
187
  # Clean up the context flag after command execution
188
188
  workflow = chat_session_obj.get_active_workflow()
189
- if workflow and "is_user_command" in workflow.context:
189
+ if "is_user_command" in workflow.context:
190
190
  del workflow.context["is_user_command"]
191
191
 
192
192
  return response_text
@@ -213,6 +213,11 @@ def _ask_user_tool(clarification_request: str, chat_session_obj: fastworkflow.Ch
213
213
  }
214
214
  f.write(json.dumps(agent_user_dialog, ensure_ascii=False) + "\n")
215
215
 
216
+ # store the message as 'raw_user_input' in workflow_context. This is useful in agentic mode
217
+ # when command implementations want to get the exact message that user entered (no refinement)
218
+ workflow = chat_session_obj.get_active_workflow()
219
+ workflow.context['raw_user_message'] = user_query
220
+
216
221
  return build_query_with_next_steps(user_query, chat_session_obj, with_agent_inputs_and_trajectory = True)
217
222
 
218
223
  def initialize_workflow_tool_agent(chat_session: fastworkflow.ChatSession, max_iters: int = 25):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastworkflow
3
- Version: 2.17.14
3
+ Version: 2.17.16
4
4
  Summary: A framework for rapidly building large-scale, deterministic, interactive workflows with a fault-tolerant, conversational UX
5
5
  License: Apache-2.0
6
6
  Keywords: fastworkflow,ai,workflow,llm,openai
@@ -145,7 +145,7 @@ fastworkflow/mcp_server.py,sha256=NxbLSKf2MA4lAHVcm6ZfiVuOjVO6IeV5Iw17wImFbxQ,88
145
145
  fastworkflow/model_pipeline_training.py,sha256=P_9wrYSfJVSYCTu8VEPkgXJ16eH58LLCK4rCRbRFAVg,46740
146
146
  fastworkflow/refine/__main__.py,sha256=bDLpPNMcdp8U4EFnMdjxx1sPDQCZuEJoBURr2KebTng,3398
147
147
  fastworkflow/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
148
- fastworkflow/run/__main__.py,sha256=XmybAsr1MnCx8tzvhWxtBT7xu2Om3PVZFtABXavPccU,12075
148
+ fastworkflow/run/__main__.py,sha256=WMrlkwUt0VTAp_DQwp3LAsJqZlFW63mmVXckuWdMiSo,12077
149
149
  fastworkflow/run_fastapi_mcp/README.md,sha256=dAmG2KF-9mqSjyIPSA9vhUit-DjsDH6WJUDCkQ3C1is,11943
150
150
  fastworkflow/run_fastapi_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
151
  fastworkflow/run_fastapi_mcp/__main__.py,sha256=R3A5PUoBXtEufaTTKF92kWhBuDg3xsVG0IQEyg4XJOI,53536
@@ -172,14 +172,14 @@ fastworkflow/utils/logging.py,sha256=2SA-04fg7Lx_vGf980tfCOGDQxBvU9X6Vbhv47rbdaw
172
172
  fastworkflow/utils/parameterize_func_decorator.py,sha256=V6YJnishWRCdwiBQW6P17hmGGrga0Empk-AN5Gm7iMk,633
173
173
  fastworkflow/utils/pydantic_model_2_dspy_signature_class.py,sha256=w1pvl8rJq48ulFwaAtBgfXYn_SBIDBgq1aLMUg1zJn8,12875
174
174
  fastworkflow/utils/python_utils.py,sha256=D0JBdzkwKoyK7XvZcnIxOgsS8CRGdvuW-zcO45_pfOA,8252
175
- fastworkflow/utils/react.py,sha256=eROhiG0TQACLqa-4aVQB36kr4KsnqqQTQjqQdMpImCs,12384
175
+ fastworkflow/utils/react.py,sha256=FGDnzIPKSTwXOCrzUVluFtkZ06lVjgMdB-YQ8jhggZU,13065
176
176
  fastworkflow/utils/signatures.py,sha256=uv1HxkVK8yzu6xt0ci8RUSgQW0Njaz22YuJVO_aNUEM,33393
177
177
  fastworkflow/utils/startup_progress.py,sha256=9icSdnpFAxzIq0sUliGpNaH0Efvrt5lDtGfURV5BD98,3539
178
178
  fastworkflow/workflow.py,sha256=37gn7e3ct-gdGw43zS6Ab_ADoJJBO4eJW2PywfUpjEg,18825
179
- fastworkflow/workflow_agent.py,sha256=UKjRTgnO9j7UNZVLPM8_N_g5anrPuJ6sJU8bWO_Z4EE,18434
179
+ fastworkflow/workflow_agent.py,sha256=LRPdl-3lDRPx8pQtK202JWGYMYBNz5Mruy630fCBCk0,18725
180
180
  fastworkflow/workflow_inheritance_model.py,sha256=Pp-qSrQISgPfPjJVUfW84pc7HLmL2evuq0UVIYR51K0,7974
181
- fastworkflow-2.17.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
182
- fastworkflow-2.17.14.dist-info/METADATA,sha256=K_v08Sjjy4Jo3kfFVA6WYBQ0udXtTcgC5FnXex7WZa0,30635
183
- fastworkflow-2.17.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
184
- fastworkflow-2.17.14.dist-info/entry_points.txt,sha256=m8HqoPzCyaZLAx-V5X8MJgw3Lx3GiPDlxNEZ7K-Gb-U,54
185
- fastworkflow-2.17.14.dist-info/RECORD,,
181
+ fastworkflow-2.17.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
182
+ fastworkflow-2.17.16.dist-info/METADATA,sha256=ibUAlBsYionZzJk3G7L0DI3u_UisRU2OsGQ1c8VZeQ4,30635
183
+ fastworkflow-2.17.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
184
+ fastworkflow-2.17.16.dist-info/entry_points.txt,sha256=m8HqoPzCyaZLAx-V5X8MJgw3Lx3GiPDlxNEZ7K-Gb-U,54
185
+ fastworkflow-2.17.16.dist-info/RECORD,,