Skip to content

Enhancements to workflow prompt.txt parsing: Path resolution and @file@ syntax support #276

Description

@yangbobo2021

Issue Overview

We are encountering two primary issues with the current implementation of parsing the prompt.txt for our workflow processes. This issue aims to address these concerns by proposing enhancements that will improve the functionality and flexibility of handling prompt.txt files.

1. Path Resolution Issue

The current parser is unable to correctly locate the prompt.txt file. This seems to be a problem with how paths are being resolved within our system. An amendment to this path resolution logic is necessary to ensure that prompt.txt can be consistently and accurately found regardless of the environment it is run in.

2. Support for @file@ Syntax

We're looking to introduce new syntax support within the content of prompt.txt, specifically the incorporation of @file@ tags. This syntax will allow the direct referencing of files via relative paths to be included as part of the context within prompt.txt. If the file referenced by @file@ does not exist, the parser should leave the @file@ tag unchanged, maintaining the original text without alteration.

Proposed Solution

For Path Resolution:

  • Investigate and identify the root cause of the failure in path resolution.
  • Implement adjustments to the path resolution mechanism to ensure correct identification and access to prompt.txt files across different operating environments.

For @file@ Syntax Support:

  • Develop a parsing logic that can recognize and process @file@ tags within prompt.txt.
  • Ensure that if the referenced file does not exist or cannot be accessed, the tag remains unaltered in the text, preserving the intended input.

Desired Outcome

  • Successful resolution of the path finding issue for prompt.txt.
  • Implementation of @file@ syntax that enhances the context capabilities of prompt.txt by allowing direct file references, improving the flexibility and depth of workflow scripting.

Additional Notes

  • Thorough testing in various environments is crucial to validate the solutions proposed for both issues.
  • Documentation should be updated accordingly to reflect these new features and any changes made to the parsing process.

Looking forward to the team's feedback and suggestions on how best to implement these improvements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions