chat system test
This commit is contained in:
parent
b1be8dd81c
commit
a721a3f364
3 changed files with 31 additions and 13 deletions
|
|
@ -1828,14 +1828,14 @@ NOTE: Respond with ONLY the JSON object. Do not include any explanatory text."""
|
||||||
# Only consider empty results a problem if there are no documents produced
|
# Only consider empty results a problem if there are no documents produced
|
||||||
has_empty_results = any(
|
has_empty_results = any(
|
||||||
not result.data.get('result', '').strip() and
|
not result.data.get('result', '').strip() and
|
||||||
not result.documents and
|
not result.data.get('documents') and
|
||||||
not result.documents
|
not result.data.get('documents')
|
||||||
for result in action_results
|
for result in action_results
|
||||||
if result.success
|
if result.success
|
||||||
)
|
)
|
||||||
|
|
||||||
has_incomplete_metadata = any(
|
has_incomplete_metadata = any(
|
||||||
any(doc.get('filename') == 'unknown' for doc in result.documents or [])
|
any(doc.get('filename') == 'unknown' for doc in result.data.get('documents', []) or [])
|
||||||
for result in action_results
|
for result in action_results
|
||||||
if result.success
|
if result.success
|
||||||
)
|
)
|
||||||
|
|
@ -2351,9 +2351,9 @@ Please review the task requirements and try again with different input or approa
|
||||||
|
|
||||||
# Add action completion message with result documents
|
# Add action completion message with result documents
|
||||||
documents_info = ""
|
documents_info = ""
|
||||||
if result.documents and len(result.documents) > 0:
|
if result.data.get("documents") and len(result.data.get("documents", [])) > 0:
|
||||||
doc_names = [doc.filename if hasattr(doc, 'filename') else f"Document {j+1}"
|
doc_names = [doc.get('filename', f"Document {j+1}") if isinstance(doc, dict) else (doc.filename if hasattr(doc, 'filename') else f"Document {j+1}")
|
||||||
for j, doc in enumerate(result.documents)]
|
for j, doc in enumerate(result.data.get("documents", []))]
|
||||||
documents_info = f"\n📄 Generated documents: {', '.join(doc_names)}"
|
documents_info = f"\n📄 Generated documents: {', '.join(doc_names)}"
|
||||||
|
|
||||||
# Create completion message
|
# Create completion message
|
||||||
|
|
@ -2390,9 +2390,9 @@ Please review the task requirements and try again with different input or approa
|
||||||
|
|
||||||
# Add retry success log
|
# Add retry success log
|
||||||
retry_documents_info = ""
|
retry_documents_info = ""
|
||||||
if retry_result.documents and len(retry_result.documents) > 0:
|
if retry_result.data.get("documents") and len(retry_result.data.get("documents", [])) > 0:
|
||||||
doc_names = [doc.filename if hasattr(doc, 'filename') else f"Document {j+1}"
|
doc_names = [doc.get('filename', f"Document {j+1}") if isinstance(doc, dict) else (doc.filename if hasattr(doc, 'filename') else f"Document {j+1}")
|
||||||
for j, doc in enumerate(retry_result.documents)]
|
for j, doc in enumerate(retry_result.data.get("documents", []))]
|
||||||
retry_documents_info = f"\n📄 Generated documents: {', '.join(doc_names)}"
|
retry_documents_info = f"\n📄 Generated documents: {', '.join(doc_names)}"
|
||||||
|
|
||||||
self.chatInterface.createWorkflowLog({
|
self.chatInterface.createWorkflowLog({
|
||||||
|
|
@ -2790,7 +2790,7 @@ NOTE: Respond with ONLY the JSON object. Do not include any explanatory text."""
|
||||||
logger.info(f"Action {action.execMethod}.{action.execAction} validated successfully")
|
logger.info(f"Action {action.execMethod}.{action.execAction} validated successfully")
|
||||||
|
|
||||||
# Only create action message if documents were produced
|
# Only create action message if documents were produced
|
||||||
if result.documents and len(result.documents) > 0:
|
if result.data.get("documents") and len(result.data.get("documents", [])) > 0:
|
||||||
await self._createActionMessage(action, result, workflow, action.execResultLabel)
|
await self._createActionMessage(action, result, workflow, action.execResultLabel)
|
||||||
else:
|
else:
|
||||||
# Add validation success log instead of message
|
# Add validation success log instead of message
|
||||||
|
|
|
||||||
|
|
@ -388,8 +388,26 @@ class ServiceCenter:
|
||||||
for doc_ref in documentList:
|
for doc_ref in documentList:
|
||||||
# Parse reference format
|
# Parse reference format
|
||||||
parts = doc_ref.split(':', 2) # Split into max 3 parts
|
parts = doc_ref.split(':', 2) # Split into max 3 parts
|
||||||
if len(parts) < 3:
|
|
||||||
|
# Handle simple label format (e.g., "task1_action2_webpage_content")
|
||||||
|
if len(parts) == 1:
|
||||||
|
# Simple label - try to find documents by label
|
||||||
|
label = parts[0]
|
||||||
|
found = False
|
||||||
|
for message in self.workflow.messages:
|
||||||
|
if message.documentsLabel == label and message.documents:
|
||||||
|
all_documents.extend(message.documents)
|
||||||
|
found = True
|
||||||
|
break
|
||||||
|
if not found:
|
||||||
|
logger.warning(f"No documents found for label: {label}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Handle structured reference format
|
||||||
|
if len(parts) < 3:
|
||||||
|
logger.warning(f"Invalid document reference format: {doc_ref}")
|
||||||
|
continue
|
||||||
|
|
||||||
ref_type = parts[0]
|
ref_type = parts[0]
|
||||||
ref_id = parts[1]
|
ref_id = parts[1]
|
||||||
ref_label = parts[2]
|
ref_label = parts[2]
|
||||||
|
|
|
||||||
|
|
@ -862,7 +862,7 @@ gateway/
|
||||||
│ │ ├── managerChat.py # Chat management and AI response validation
|
│ │ ├── managerChat.py # Chat management and AI response validation
|
||||||
│ │ ├── managerPrompt.py # AI prompt generation and management
|
│ │ ├── managerPrompt.py # AI prompt generation and management
|
||||||
│ │ ├── methodBase.py # Base method class with result validation
|
│ │ ├── methodBase.py # Base method class with result validation
|
||||||
│ │ └── processorDocument.py # Document content extraction
|
│ │ └── documentExtraction.py # Document content extraction
|
||||||
│ │
|
│ │
|
||||||
│ ├── agents/ # To be refactored into methods
|
│ ├── agents/ # To be refactored into methods
|
||||||
│ │ ├── agentSharepoint.py → methods/methodSharepoint.py
|
│ │ ├── agentSharepoint.py → methods/methodSharepoint.py
|
||||||
|
|
@ -889,7 +889,7 @@ gateway/
|
||||||
#### Phase 1: Core Structure Setup
|
#### Phase 1: Core Structure Setup
|
||||||
1. **File Renaming and Organization**
|
1. **File Renaming and Organization**
|
||||||
- Rename manager files to follow `manager*.py` pattern
|
- Rename manager files to follow `manager*.py` pattern
|
||||||
- Move document processor to `processorDocument.py`
|
- Move document processor to `documentExtraction.py`
|
||||||
- Create new `methods` directory
|
- Create new `methods` directory
|
||||||
|
|
||||||
2. **Model Updates**
|
2. **Model Updates**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue