Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.250.071"
VERSION = "0.250.073"
IS_DEVELOPMENT = is_development_env_enabled()

SESSION_COOKIE_SAMESITE = os.getenv('SESSION_COOKIE_SAMESITE', 'Lax')
Expand Down
23 changes: 5 additions & 18 deletions application/single_app/functions_assistant_table_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
re.compile(r'\b(?:include|with|using)\s+(?:the\s+)?(?:columns?|fields?)\b'),
)


def assistant_table_export_requested(user_question: str) -> bool:
"""Return True when the user asked for table-shaped output or a CSV export."""
normalized_question = re.sub(r'\s+', ' ', str(user_question or '').strip().casefold())
Expand Down Expand Up @@ -261,20 +260,6 @@ def has_generated_tabular_csv_output(generated_outputs: List[Dict[str, Any]]) ->
return False


def get_assistant_csv_export_content(assistant_result: Any) -> str:
"""Return the structured document-action reply when it supersedes a concise artifact reply."""
if not isinstance(assistant_result, dict):
return str(assistant_result or '')

analysis_result = assistant_result.get('analysis_result')
if isinstance(analysis_result, dict):
analysis_reply = str(analysis_result.get('analysis_reply') or '').strip()
if analysis_reply:
return analysis_reply

return str(assistant_result.get('reply') or '')


def extract_assistant_table_entries(assistant_content: str) -> List[Dict[str, str]]:
"""Extract table rows from Markdown, tab-separated, or CSV assistant output."""
normalized_content = str(assistant_content or '').replace('\r\n', '\n').replace('\r', '\n')
Expand Down Expand Up @@ -310,14 +295,16 @@ def build_assistant_table_csv(table_rows: List[Dict[str, Any]]) -> str:
if not ordered_columns:
ordered_columns = ['value']

safe_columns = build_safe_csv_headers(ordered_columns)

output_buffer = io.StringIO()
writer = csv.DictWriter(output_buffer, fieldnames=ordered_columns, extrasaction='ignore')
writer = csv.DictWriter(output_buffer, fieldnames=safe_columns, extrasaction='ignore')
writer.writeheader()
for table_row in table_rows or []:
serialized_row = {}
if isinstance(table_row, dict):
for column_name in ordered_columns:
serialized_row[column_name] = _serialize_table_cell(table_row.get(column_name))
for source_column, safe_column in zip(ordered_columns, safe_columns):
serialized_row[safe_column] = _serialize_table_cell(table_row.get(source_column))
writer.writerow(serialized_row)
return output_buffer.getvalue()

Expand Down
6 changes: 3 additions & 3 deletions application/single_app/functions_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -4395,15 +4395,15 @@ def extract_document_metadata(document_id, user_id, group_id=None, public_worksp
json.dumps(meta_data),
user_id,
document_id=document_id,
top_n=25,
top_n=50,
doc_scope=document_scope
)
elif document_scope == "group":
search_results = hybrid_search(
json.dumps(meta_data),
user_id,
document_id=document_id,
top_n=25,
top_n=50,
doc_scope=document_scope,
active_group_id=scope_id
)
Expand All @@ -4412,7 +4412,7 @@ def extract_document_metadata(document_id, user_id, group_id=None, public_worksp
json.dumps(meta_data),
user_id,
document_id=document_id,
top_n=25,
top_n=50,
doc_scope=document_scope,
active_public_workspace_id=scope_id
)
Expand Down
Loading