gateway/logs/debug/prompts/20251127-114158-089-actionplan_prompt.txt

100 lines
21 KiB
Text

Select exactly one next action to advance the task incrementally.
OVERALL TASK CONTEXT:
Test
OBJECTIVE:
Complete the user's main business objective as specified in their request.
AVAILABLE_DOCUMENTS_SUMMARY:
6 documents available from previous tasks
AVAILABLE_METHODS:
{
"ai.analyzeDocuments": "\n GENERAL:\n - Purpose: Analyze documents and find insights, patterns, trends, and key information.\n - Input requirements: documentList (required); optional analysisType, focus.\n - Output format: Analysis report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Document(s) to analyze.\n - analysisType (str, optional): Type of analysis - general, financial, technical, sentiment, etc. Default: general.\n - focus (str, optional): Specific aspect to focus on (e.g., \"trends\", \"risks\", \"opportunities\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
"ai.compareDocuments": "\n GENERAL:\n - Purpose: Compare multiple documents and identify differences, similarities, and changes.\n - Input requirements: documentList (required, should contain 2+ documents); optional comparisonType, focus.\n - Output format: Comparison report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Two or more documents to compare.\n - comparisonType (str, optional): Type of comparison - differences, similarities, changes, full. Default: full.\n - focus (str, optional): Specific aspect to focus on (e.g., \"content\", \"structure\", \"data\", \"formatting\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
"ai.convertDocument": "\n GENERAL:\n - Purpose: Convert documents between different formats (PDF→Word, Excel→CSV, etc.).\n - Input requirements: documentList (required); targetFormat (required).\n - Output format: Document in target format.\n\n Parameters:\n - documentList (list, required): Document reference(s) to convert.\n - targetFormat (str, required): Target format extension (docx, pdf, xlsx, csv, txt, html, json, md, etc.).\n - preserveStructure (bool, optional): Whether to preserve document structure (headings, tables, etc.). Default: True.\n ",
"ai.extractData": "\n GENERAL:\n - Purpose: Extract structured data from documents (key-value pairs, entities, facts, etc.).\n - Input requirements: documentList (required); optional dataStructure, fields.\n - Output format: JSON by default, or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract data from.\n - dataStructure (str, optional): Desired data structure - flat, nested, or list. Default: nested.\n - fields (list, optional): Specific fields/properties to extract (e.g., [\"name\", \"date\", \"amount\"]).\n - resultType (str, optional): Output format (json, csv, xlsx, etc.). Default: json.\n ",
"ai.extractTables": "\n GENERAL:\n - Purpose: Extract tables from documents, preserving structure and data.\n - Input requirements: documentList (required); optional tableFormat.\n - Output format: JSON by default (structured table data), or CSV/XLSX if specified.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract tables from.\n - tableFormat (str, optional): Output format for tables - json, csv, or xlsx. Default: json.\n - includeHeaders (bool, optional): Include table headers. Default: True.\n ",
"ai.generateChart": "\n GENERAL:\n - Purpose: Generate charts/graphs from data in documents or structured data.\n - Input requirements: documentList (required); optional chartType, title, labels.\n - Output format: Image (png or jpg).\n\n Parameters:\n - documentList (list, required): Documents containing data to visualize (CSV, Excel, JSON, etc.).\n - chartType (str, optional): Type of chart - bar, line, pie, scatter, area, etc. Default: bar.\n - title (str, optional): Chart title.\n - xAxisLabel (str, optional): X-axis label.\n - yAxisLabel (str, optional): Y-axis label.\n - resultType (str, optional): Image format (png or jpg). Default: png.\n ",
"ai.generateDocument": "\n GENERAL:\n - Purpose: Generate documents from scratch or based on templates/inputs.\n - Input requirements: prompt or description (required); optional documentList (for templates/references).\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - prompt (str, required): Description of the document to generate.\n - documentList (list, optional): Template documents or reference documents to use as a guide.\n - documentType (str, optional): Type of document - letter, memo, proposal, contract, etc.\n - resultType (str, optional): Output format (docx, pdf, txt, md, etc.). Default: docx.\n ",
"ai.generateReport": "\n GENERAL:\n - Purpose: Generate comprehensive reports from input documents/data with analysis and insights.\n - Input requirements: documentList (optional, can generate from scratch); optional reportType, sections.\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - documentList (list, optional): Input documents/data to base the report on.\n - reportType (str, optional): Type of report - summary, analysis, executive, detailed. Default: analysis.\n - sections (list, optional): Specific sections to include (e.g., [\"introduction\", \"findings\", \"recommendations\"]).\n - title (str, optional): Report title.\n - resultType (str, optional): Output format (docx, pdf, md, etc.). Default: docx.\n ",
"ai.process": "\n GENERAL:\n - Purpose: Universal AI document processing action - accepts MULTIPLE input documents in ANY format (docx, pdf, json, txt, xlsx, html, images, etc.) and processes them together with a prompt to produce MULTIPLE output documents in ANY specified format (via resultType). Use for document generation, format conversion, content transformation, analysis, summarization, translation, extraction, comparison, and any AI-powered document manipulation.\n - Input requirements: aiPrompt (required); optional documentList (can contain multiple documents in any format).\n - Output format: Multiple documents in the same format per call (via resultType: txt, json, pdf, docx, xlsx, pptx, png, jpg, etc.). The AI can generate multiple files based on the prompt (e.g., \"create separate documents for each section\"). Default: txt.\n - Key capabilities: Can process any number of input documents together, extract data from mixed formats, combine information, generate multiple output files, transform between formats, perform analysis/comparison/summarization on document sets.\n\n Parameters:\n - aiPrompt (str, required): Instruction for the AI describing what processing to perform.\n - documentList (list, optional): Document reference(s) in any format to use as input/context.\n - resultType (str, optional): Output file extension (txt, json, md, csv, xml, html, pdf, docx, xlsx, png, etc.). All output documents will use this format. Default: txt.\n ",
"ai.summarizeDocument": "\n GENERAL:\n - Purpose: Summarize one or more documents, extracting key points and main ideas.\n - Input requirements: documentList (required); optional summaryLength, focus.\n - Output format: Text document with summary (default: txt, can be overridden with resultType).\n\n Parameters:\n - documentList (list, required): Document reference(s) to summarize.\n - summaryLength (str, optional): Desired summary length - brief, medium, or detailed. Default: medium.\n - focus (str, optional): Specific aspect to focus on in the summary (e.g., \"financial data\", \"key decisions\").\n - resultType (str, optional): Output file extension (txt, md, docx, etc.). Default: txt.\n ",
"ai.translateDocument": "\n GENERAL:\n - Purpose: Translate documents to a target language while preserving formatting and structure.\n - Input requirements: documentList (required); targetLanguage (required).\n - Output format: Translated document in same format as input (default) or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to translate.\n - targetLanguage (str, required): Target language code or name (e.g., \"de\", \"German\", \"French\", \"es\").\n - sourceLanguage (str, optional): Source language if known (e.g., \"en\", \"English\"). If not provided, AI will detect.\n - preserveFormatting (bool, optional): Whether to preserve original formatting. Default: True.\n - resultType (str, optional): Output file extension. If not specified, uses same format as input.\n ",
"ai.validateData": "\n GENERAL:\n - Purpose: Validate data quality, structure, completeness, and correctness in documents/data files.\n - Input requirements: documentList (required); optional validationRules, schema.\n - Output format: Validation report in JSON or text format (default: json).\n\n Parameters:\n - documentList (list, required): Documents/data files to validate.\n - validationRules (list, optional): Specific validation rules to check (e.g., [\"required_fields\", \"data_types\", \"ranges\"]).\n - schema (dict, optional): Expected data schema/structure to validate against.\n - resultType (str, optional): Output format (json, txt, md, etc.). Default: json.\n ",
"ai.webResearch": "\n GENERAL:\n - Purpose: Web research with two-step process: search for URLs, then crawl content.\n - Input requirements: prompt (required); optional list(url), country, language, researchDepth.\n - Output format: JSON with research results including URLs and content.\n\n Parameters:\n - prompt (str, required): Natural language research instruction.\n - urlList (list, optional): Specific URLs to crawl, if needed.\n - country (str, optional): Two-digit country code (lowercase, e.g., ch, us, de).\n - language (str, optional): Language code (lowercase, e.g., de, en, fr).\n - researchDepth (str, optional): Research depth - fast, general, or deep. Default: general.\n ",
"outlook.composeAndDraftEmailWithContext": "\n GENERAL:\n - Purpose: Compose email content using AI from context and optional documents, then create a draft.\n - Input requirements: connectionReference (required); to (required); context (required); optional documentList, cc, bcc, emailStyle, maxLength.\n - Output format: JSON confirmation with AI-generated draft metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - to (list, required): Recipient email addresses.\n - context (str, required): Detailled context for composing the email.\n - documentList (list, optional): Document references for context/attachments.\n - cc (list, optional): CC recipients.\n - bcc (list, optional): BCC recipients.\n - emailStyle (str, optional): formal | casual | business. Default: business.\n - maxLength (int, optional): Maximum length for generated content. Default: 1000.\n ",
"outlook.readEmails": "\n GENERAL:\n - Purpose: Read emails and metadata from a mailbox folder.\n - Input requirements: connectionReference (required); optional folder, limit, filter, outputMimeType.\n - Output format: JSON with emails and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - folder (str, optional): Folder to read from. Default: Inbox.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - filter (str, optional): Sender, query operators, or subject text.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
"outlook.searchEmails": "\n GENERAL:\n - Purpose: Search emails by query and return matching items with metadata.\n - Input requirements: connectionReference (required); query (required); optional folder, limit, outputMimeType.\n - Output format: JSON with search results and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - query (str, required): Search expression.\n - folder (str, optional): Folder scope or All. Default: All.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
"outlook.sendDraftEmail": "\n GENERAL:\n - Purpose: Send draft email(s) using draft email JSON document(s) from action outlook.composeAndDraftEmailWithContext.\n - Input requirements: connectionReference (required); documentList with draft email JSON documents (required).\n - Output format: JSON confirmation with sent mail metadata for all emails.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - documentList (list, required): Document reference(s) to draft emails in JSON format (outputs from outlook.composeAndDraftEmailWithContext function).\n ",
"sharepoint.findDocumentPath": "\n GENERAL:\n - Purpose: Find documents and folders by name/path across sites.\n - Input requirements: connectionReference (required); searchQuery (required); optional site, maxResults.\n - Output format: JSON with found items and paths.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - site (str, optional): Site hint.\n - searchQuery (str, required): Search terms or path.\n - maxResults (int, optional): Maximum items to return. Default: 100.\n ",
"sharepoint.listDocuments": "\n GENERAL:\n - Purpose: List documents and folders in SharePoint paths across sites.\n - Input requirements: connectionReference (required); optional pathObject or pathQuery; includeSubfolders.\n - Output format: JSON with folder items and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Path query if no pathObject.\n - includeSubfolders (bool, optional): Include one level of subfolders. Default: False.\n ",
"sharepoint.readDocuments": "\n GENERAL:\n - Purpose: Read documents from SharePoint and extract content/metadata.\n - Input requirements: connectionReference (required); optional documentList, pathObject, or pathQuery; includeMetadata.\n - Output format: Standardized ActionDocument format (documentName, documentData, mimeType).\n - Binary files (PDFs, etc.) are Base64-encoded in documentData.\n - Text files are stored as plain text in documentData.\n - Returns ActionResult with documents list for template processing.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result (from findDocumentPath).\n - documentList (list, optional): Document list reference(s) to read (backward compatibility).\n - pathQuery (str, optional): Path query if no pathObject (backward compatibility).\n - includeMetadata (bool, optional): Include metadata. Default: True.\n \n Returns:\n - ActionResult with documents: List[ActionDocument] where each ActionDocument contains:\n - documentName: File name\n - documentData: Base64-encoded content (binary files) or plain text (text files)\n - mimeType: MIME type (e.g., application/pdf, text/plain)\n ",
"sharepoint.uploadDocument": "\n GENERAL:\n - Purpose: Upload documents to SharePoint. Only to choose this action with a connectionReference\n - Input requirements: connectionReference (required); documentList (required); optional pathObject or pathQuery.\n - Output format: JSON with upload status and file info.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Upload target path if no pathObject.\n - documentList (list, required): Document reference(s) to upload. File names are taken from the documents.\n "
}
WORKFLOW_HISTORY (reverse-chronological, enriched):
- Round 1: 2 docs (memo_analysis_summary.txt, structured_content_2.json) label='round1_task1_action3_results' | success=Unknown | msg='**Action 3 (ai.summarizeDocument)** ✅ This task will accomplish the entire business objective you have requested.'
- Round 1: 2 docs (memo_analysis_report.txt, structured_content_1.json) label='round1_task1_action2_results' | success=Unknown | msg='**Action 2 (ai.analyzeDocuments)** ✅ This task will accomplish the entire business objective you have requested.'
- Round 1: 2 docs (test_document_memo.docx, structured_content.json) label='round1_task1_action1_results' | success=Unknown | msg='**Action 1 (ai.generateDocument)** ✅ This task will accomplish the entire business objective you have requested.'
Available documents: 6
AVAILABLE_DOCUMENTS_INDEX:
Current round documents:
- docList:round1_task1_action3_results contains:
- docItem:04546e10-67f0-4e89-aecf-67e6261ab919:memo_analysis_summary.txt
- docItem:05e4eb1c-451f-4a88-b96b-3767ba13a8b5:structured_content_2.json
- docList:round1_task1_action2_results contains:
- docItem:937cbc15-3df6-45b7-8d24-80964746a4be:memo_analysis_report.txt
- docItem:b129c6dc-f9ac-45de-9789-7ca73002d314:structured_content_1.json
- docList:round1_task1_action1_results contains:
- docItem:08c7d2e7-e3ac-44c6-b305-2696f7de627a:test_document_memo.docx
- docItem:da1fa51f-68d2-41f1-bc25-aaff26beaab7:structured_content.json
AVAILABLE_CONNECTIONS_INDEX:
No connections available
LEARNING-BASED GUIDANCE:
No previous failures detected. Proceed with standard approach.
FAILURE ANALYSIS:
{}
ESCALATION LEVEL: low
REPLY: Return ONLY a JSON object with the following structure (no comments, no extra text). The chosen action MUST:
- be the next logical incremental step toward fulfilling the objective
- not attempt to complete the entire objective in one step
- if producing files, target exactly one output format for this step
- reference ONLY existing document IDs/labels from AVAILABLE_DOCUMENTS_INDEX
- learn from previous validation feedback and avoid repeated mistakes
{{
"action": "method.action_name",
"actionObjective": "...",
"learnings": ["..."],
"requiredInputDocuments": ["docList:..."],
"requiredConnection": "connection:..." | null,
"parametersContext": "concise text that Stage 2 will use to set business parameters"
}}
EXAMPLE how to assign references from AVAILABLE_DOCUMENTS_INDEX and AVAILABLE_CONNECTIONS_INDEX:
"requiredInputDocuments": ["docList:msg_47a7a578-e8f2-4ba8-ac66-0dbff40605e0:round8_task1_action1_results","docItem:5d8b7aee-b546-4487-b6a8-835c86f7b186:AI_Generated_Document_20251006-104256.docx"],
"requiredConnection": "connection:msft:p.motsch@valueon.ch",
RULES:
1. Use EXACT action names from AVAILABLE_METHODS
2. Do NOT output a "parameters" object
3. parametersContext must be short and sufficient for Stage 2
4. Return ONLY JSON - no markdown, no explanations
5. For requiredInputDocuments, use ONLY exact references from AVAILABLE_DOCUMENTS_INDEX (docList:... or docItem:...)
- DO NOT invent or modify Message IDs
- DO NOT create new references
- Copy references EXACTLY as shown in AVAILABLE_DOCUMENTS_INDEX
6. For requiredConnection, use ONLY an exact label from AVAILABLE_CONNECTIONS_INDEX
7. Plan incrementally: if the overall intent needs multiple output formats (e.g., CSV and HTML), choose one format in this step and leave the other(s) for subsequent steps
8. CRITICAL: Learn from previous validation feedback - avoid repeating the same mistakes
9. If previous attempts failed, consider alternative approaches or more specific parameters