Skip to content

Add interactive file read option to fulfill variables#13

Merged
eyalzh merged 2 commits intomainfrom
add-file-selection
Sep 26, 2025
Merged

Add interactive file read option to fulfill variables#13
eyalzh merged 2 commits intomainfrom
add-file-selection

Conversation

@eyalzh
Copy link
Owner

@eyalzh eyalzh commented Sep 26, 2025

No description provided.

@eyalzh eyalzh requested a review from Copilot September 26, 2025 11:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new interactive file read option for variable collection, allowing users to read variable values from files in addition to providing direct values or using MCP tools.

  • Adds file selection option to interactive variable collection
  • Implements file reading functionality with UTF-8 encoding and error handling
  • Updates version from 0.1.1 to 0.2.1 to reflect the new feature

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Version bump from 0.1.1 to 0.2.1
prompt/prompt_helper.py Adds file reading option to interactive variable collection with validation and error handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

:param var_name: Name of the variable to collect
:return: String content of the selected file
"""
import os
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement should be moved to the top of the file with other imports rather than inside the function. This follows Python import conventions and improves code organization.

Copilot uses AI. Check for mistakes.

try:
# Try to read the file as UTF-8
with open(file_path, encoding='utf-8') as f:
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using 'r' mode explicitly for better clarity: open(file_path, 'r', encoding='utf-8')

Suggested change
with open(file_path, encoding='utf-8') as f:
with open(file_path, 'r', encoding='utf-8') as f:

Copilot uses AI. Check for mistakes.
@eyalzh eyalzh merged commit 16791c9 into main Sep 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant