markdown-flow 0.2.10__py3-none-any.whl → 0.2.11__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.

Potentially problematic release.


This version of markdown-flow might be problematic. Click here for more details.

markdown_flow/__init__.py CHANGED
@@ -83,4 +83,4 @@ __all__ = [
83
83
  "replace_variables_in_text",
84
84
  ]
85
85
 
86
- __version__ = "0.2.10"
86
+ __version__ = "0.2.11"
markdown_flow/core.py CHANGED
@@ -505,7 +505,7 @@ class MarkdownFlow:
505
505
  target_variable=target_variable,
506
506
  options=button_displays,
507
507
  question=question,
508
- mode=mode
508
+ mode=mode,
509
509
  )
510
510
 
511
511
  # Check for validation errors in pure button mode or when text input not allowed
@@ -827,7 +827,14 @@ Original Error: {error_message}
827
827
  if match:
828
828
  prefix = match.group(1)
829
829
  suffix = match.group(2)
830
- return f"{prefix}{cleaned_question}{suffix}"
830
+ # Extract only the closing bracket from suffix, remove original question
831
+ # suffix format is "original_question]", we only want "]"
832
+ if suffix.endswith("]"):
833
+ clean_suffix = "]"
834
+ else:
835
+ clean_suffix = suffix
836
+
837
+ return f"{prefix}{cleaned_question}{clean_suffix}"
831
838
  return original_content # type: ignore[unreachable]
832
839
 
833
840
  # Dynamic Interaction Methods
@@ -1123,9 +1130,8 @@ Analyze the content and provide the structured interaction data.""")
1123
1130
  "empty_input": True,
1124
1131
  },
1125
1132
  )
1126
- else:
1127
- error_msg = f"No input provided for variable '{variable_name}'"
1128
- return self._render_error(error_msg, mode)
1133
+ error_msg = f"No input provided for variable '{variable_name}'"
1134
+ return self._render_error(error_msg, mode)
1129
1135
 
1130
1136
  # Use the same validation logic as normal interactions
1131
1137
  if interaction_type in [
@@ -1144,7 +1150,7 @@ Analyze the content and provide the structured interaction data.""")
1144
1150
  )
1145
1151
 
1146
1152
  # Merge with existing variables for dynamic interactions
1147
- if hasattr(button_result, 'variables') and button_result.variables is not None and variables:
1153
+ if hasattr(button_result, "variables") and button_result.variables is not None and variables:
1148
1154
  merged_variables = dict(variables)
1149
1155
  merged_variables.update(button_result.variables)
1150
1156
  return LLMResult(
@@ -1154,7 +1160,7 @@ Analyze the content and provide the structured interaction data.""")
1154
1160
  )
1155
1161
  return button_result
1156
1162
 
1157
- elif interaction_type == InteractionType.NON_ASSIGNMENT_BUTTON:
1163
+ if interaction_type == InteractionType.NON_ASSIGNMENT_BUTTON:
1158
1164
  # Non-assignment buttons: don't set variables, keep existing ones
1159
1165
  return LLMResult(
1160
1166
  content="",
@@ -1164,16 +1170,15 @@ Analyze the content and provide the structured interaction data.""")
1164
1170
  "user_input": user_input,
1165
1171
  },
1166
1172
  )
1167
- else:
1168
- # Text-only input type - merge with existing variables
1169
- merged_variables = dict(variables or {})
1170
- merged_variables[variable_name] = target_values
1171
- return LLMResult(
1172
- content="",
1173
- variables=merged_variables,
1174
- metadata={
1175
- "interaction_type": "text_only",
1176
- "target_variable": variable_name,
1177
- "values": target_values,
1178
- },
1179
- )
1173
+ # Text-only input type - merge with existing variables
1174
+ merged_variables = dict(variables or {})
1175
+ merged_variables[variable_name] = target_values
1176
+ return LLMResult(
1177
+ content="",
1178
+ variables=merged_variables,
1179
+ metadata={
1180
+ "interaction_type": "text_only",
1181
+ "target_variable": variable_name,
1182
+ "values": target_values,
1183
+ },
1184
+ )
markdown_flow/llm.py CHANGED
@@ -5,7 +5,7 @@ Provides LLM provider interfaces and related data models, supporting multiple pr
5
5
  """
6
6
 
7
7
  from abc import ABC, abstractmethod
8
- from collections.abc import AsyncGenerator, Generator
8
+ from collections.abc import Generator
9
9
  from dataclasses import dataclass
10
10
  from enum import Enum
11
11
  from typing import Any
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-flow
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: An agent library designed to parse and process MarkdownFlow documents
5
5
  Project-URL: Homepage, https://github.com/ai-shifu/markdown-flow-agent-py
6
6
  Project-URL: Bug Tracker, https://github.com/ai-shifu/markdown-flow-agent-py/issues
@@ -0,0 +1,13 @@
1
+ markdown_flow/__init__.py,sha256=xKyJPYz2k6AvfCx8QuffJe8WIS9PPMgXkpR7n-1s0Cc,2875
2
+ markdown_flow/constants.py,sha256=pd_KCpTEVlz_IXYekrByqb9VWCQR_XHXoGsFYdLW1Eg,8006
3
+ markdown_flow/core.py,sha256=xeE35QzNRURw6nIongn5tW5Z7u4xP_CkNFrBiLrfpmY,49371
4
+ markdown_flow/enums.py,sha256=Wr41zt0Ce5b3fyLtOTE2erEVp1n92g9OVaBF_BZg_l8,820
5
+ markdown_flow/exceptions.py,sha256=9sUZ-Jd3CPLdSRqG8Pw7eMm7cv_S3VZM6jmjUU8OhIc,976
6
+ markdown_flow/llm.py,sha256=MhllCwqzrN_RtIG-whfdkNk6e0WQ2H6RJVCRv3lNM_0,2531
7
+ markdown_flow/models.py,sha256=ENcvXMVXwpFN-RzbeVHhXTjBN0bbmRpJ96K-XS2rizI,2893
8
+ markdown_flow/utils.py,sha256=cVi0zDRK_rCMAr3EDhgITmx6Po5fSvYjqrprYaitYE0,28450
9
+ markdown_flow-0.2.11.dist-info/licenses/LICENSE,sha256=qz3BziejhHPd1xa5eVtYEU5Qp6L2pn4otuj194uGxmc,1069
10
+ markdown_flow-0.2.11.dist-info/METADATA,sha256=DMbPePTA9ZK5wOgrm7X9tjyGAiXbVB2v3rqGM9EzbHg,24287
11
+ markdown_flow-0.2.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ markdown_flow-0.2.11.dist-info/top_level.txt,sha256=DpigGvQuIt2L0TTLnDU5sylhiTGiZS7MmAMa2hi-AJs,14
13
+ markdown_flow-0.2.11.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- markdown_flow/__init__.py,sha256=BVUJBlr7xrT6ctNgYHPFynvY7bPXcptugNDAsTp4oJU,2875
2
- markdown_flow/constants.py,sha256=pd_KCpTEVlz_IXYekrByqb9VWCQR_XHXoGsFYdLW1Eg,8006
3
- markdown_flow/core.py,sha256=HNeSbVBuiu03NF6m_jSo1o7V-W_FbdPsth62VLsG7Nw,49170
4
- markdown_flow/enums.py,sha256=Wr41zt0Ce5b3fyLtOTE2erEVp1n92g9OVaBF_BZg_l8,820
5
- markdown_flow/exceptions.py,sha256=9sUZ-Jd3CPLdSRqG8Pw7eMm7cv_S3VZM6jmjUU8OhIc,976
6
- markdown_flow/llm.py,sha256=7DjOL2h2N1g0L4NF9kn0M5mR45ZL0vPsW3TzuOGy1bw,2547
7
- markdown_flow/models.py,sha256=ENcvXMVXwpFN-RzbeVHhXTjBN0bbmRpJ96K-XS2rizI,2893
8
- markdown_flow/utils.py,sha256=cVi0zDRK_rCMAr3EDhgITmx6Po5fSvYjqrprYaitYE0,28450
9
- markdown_flow-0.2.10.dist-info/licenses/LICENSE,sha256=qz3BziejhHPd1xa5eVtYEU5Qp6L2pn4otuj194uGxmc,1069
10
- markdown_flow-0.2.10.dist-info/METADATA,sha256=QLL_76xo6kwnmH6_6RdpZ5NuFT8MTAZavmHpCFPQ54A,24287
11
- markdown_flow-0.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- markdown_flow-0.2.10.dist-info/top_level.txt,sha256=DpigGvQuIt2L0TTLnDU5sylhiTGiZS7MmAMa2hi-AJs,14
13
- markdown_flow-0.2.10.dist-info/RECORD,,