markdown-flow 0.2.10__py3-none-any.whl → 0.2.12__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 +1 -1
- markdown_flow/core.py +28 -23
- markdown_flow/llm.py +1 -1
- {markdown_flow-0.2.10.dist-info → markdown_flow-0.2.12.dist-info}/METADATA +1 -1
- markdown_flow-0.2.12.dist-info/RECORD +13 -0
- markdown_flow-0.2.10.dist-info/RECORD +0 -13
- {markdown_flow-0.2.10.dist-info → markdown_flow-0.2.12.dist-info}/WHEEL +0 -0
- {markdown_flow-0.2.10.dist-info → markdown_flow-0.2.12.dist-info}/licenses/LICENSE +0 -0
- {markdown_flow-0.2.10.dist-info → markdown_flow-0.2.12.dist-info}/top_level.txt +0 -0
markdown_flow/__init__.py
CHANGED
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
|
-
|
|
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
|
|
@@ -921,9 +928,9 @@ Original Error: {error_message}
|
|
|
921
928
|
Task: Analyze the given content block and determine if it needs to be converted to an interaction block to collect user information.
|
|
922
929
|
|
|
923
930
|
Judgment criteria:
|
|
924
|
-
1.
|
|
925
|
-
2.
|
|
926
|
-
3.
|
|
931
|
+
1. It requires to generate/show buttons
|
|
932
|
+
2. It requires to generate/show checkboxs or multi-selection interactive elements
|
|
933
|
+
3. It requires to generate/show text input box
|
|
927
934
|
|
|
928
935
|
If conversion is needed, generate a STANDARD interaction block format with SPECIFIC options based on the document-level instructions and context provided in the user message."""
|
|
929
936
|
|
|
@@ -1123,9 +1130,8 @@ Analyze the content and provide the structured interaction data.""")
|
|
|
1123
1130
|
"empty_input": True,
|
|
1124
1131
|
},
|
|
1125
1132
|
)
|
|
1126
|
-
|
|
1127
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
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
|
|
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.
|
|
3
|
+
Version: 0.2.12
|
|
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=3RX4XqfRF50P1XTEZJOo6zOpqnI78rm8tuMF4ABiCx4,2875
|
|
2
|
+
markdown_flow/constants.py,sha256=pd_KCpTEVlz_IXYekrByqb9VWCQR_XHXoGsFYdLW1Eg,8006
|
|
3
|
+
markdown_flow/core.py,sha256=g35M6AQ4_CEFPMqmMpGypPR7hZwsh2y3wbxrICRSZds,49323
|
|
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.12.dist-info/licenses/LICENSE,sha256=qz3BziejhHPd1xa5eVtYEU5Qp6L2pn4otuj194uGxmc,1069
|
|
10
|
+
markdown_flow-0.2.12.dist-info/METADATA,sha256=uTVCF7unXm-eFO0XtvTdGTG-WT3zzx4BcCyBv2WasBQ,24287
|
|
11
|
+
markdown_flow-0.2.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
markdown_flow-0.2.12.dist-info/top_level.txt,sha256=DpigGvQuIt2L0TTLnDU5sylhiTGiZS7MmAMa2hi-AJs,14
|
|
13
|
+
markdown_flow-0.2.12.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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|