# Context:
USER: Prompt template is a definition for a node that the server will use.. the server will supply information about the node to the front end.
USER: the class should be renamed, "PublicGitRepo"
# Context:
USER: add `image.py`
ASSISTANT: Sure, I can help with that. However, I need more information about what you want to include in `image.py`. Could you please provide more details?
USER: I need you to use it so you can understand the framework
ASSISTANT: I understand that you want me to create a new file named `image.py`. However, without specific details about what this file should contain, I can only provide a basic template. Here's a simple Python file structure:
```python
image.py
<<<<<<< ORIGINAL
=======
# This is a new file named image.py
def main():
pass
if __name__ == "__main__":
main()
>>>>>>> UPDATED
```
Please provide more details if you need specific functions or classes in this file.
- This test validates the functionality of the `TemporalSpatialSmoothing` handler, which smooths image stacks in both temporal and spatial dimensions.
- The test uses random frames of noise and verifies the correctness of the handler.
- Made minor changes in `image.py`
- Updated code formatting for improved readability and consistency.
- Added error handling for cases when creating a PIL image from a numpy array.
- No significant changes were made in `video.py`.
These changes primarily focus on adding test coverage and maintaining code quality.
"Added GetFirstCodeBlock class to functional.py"
Commit details:
- Added a new class called GetFirstCodeBlock to the functional.py file.
- The GetFirstCodeBlock class is used to find and return the first code block in the input text. It checks for code blocks surrounded by "```" or "```python" tags, or "<code>" tags.
- Returns an empty string if no code block is found.
- Added a new function called func to the GetFirstCodeBlock class, which takes the input text as an argument and returns the first code block.
- Updated the functional.py file with the new class and function.
- The new class is categorized under "ETK/func" and has a return type of "STRING".
- The commit message and details were created using the IDEA additional info of the patch, with the charset set to UTF-8.
2. This class has a method func that takes a string and code as input and executes the code.
3. The executed code is expected to convert the input string into a list which is then returned.
4. Also, defined INPUT_TYPES, CATEGORY, RETURN_TYPES, and FUNCTION for the class.
- Added a new function handler called "LoadJson" that loads a JSON object from a file and returns it as a dictionary or list.
- Updated the RETURN_TYPES and RETURN_NAMES for the "LoadJson" function.
2. custom_nodes/SWAIN/llm.py:
- Updated the "get_openai_embedding" function to include additional keyword arguments.
- Added exception handling for API connection errors and API errors in the "get_openai_embedding" function.
- Modified the "get_k_nearest_vectors" function to handle tuples as input.
- Removed unnecessary import statements in the LLMEmbedding class.
- Added a new function handler called "FuncStrToStr" that runs the 'eval' function on the given text with a string as input and returns a string.
- Updated the INPUT_TYPES and RETURN_TYPES for the "FuncStrToStr" function.
3. custom_nodes/SWAIN/tests/test_llm.py:
- Added new unit tests for the "get_openai_embedding" and "get_k_nearest_vectors" functions.
- Fixed import statements in the test file.
4. custom_nodes/EternalKernelLiteGraphNodes/functional.py:
- Added a new function handler called "FuncStrToStr" that runs 'eval' on the given text with a string as input and returns a string.
- Updated the INPUT_TYPES for the "FuncStrToStr" function.
5. custom_nodes/SWAIN/bases.py:
- Added a new widget generator for the "number" parameter type.
These changes introduce new functionality and improve the error handling and testing in the project.
- Modified the `func` method in the `FuncRender` class in `functional.py` to return a tuple.
- Modified the `video_folders` function in `video.py` to include a return statement.
- Modified the `video_files` function in `video.py` to include a return statement.
- Added a new parameter `func` with a default value of `None` to the `optional` dictionary in the `ImageStackToVideoFile` class in `video.py`.
- Updated the `handler` method in the `ImageStackToVideoFile` class in `video.py` to include a check for the `optional` parameter `func`.
Details:
- Removed the unused class "Prompt Template" in the __init__.py file.
- This class was not being used and was causing clutter in the codebase.
- The removal improves code readability and maintainability.
- Updated video.py
- Added new classes for converting image stack to video frames and video file.
- Fixed input and output directories for video files.
Changes made:
1. Created a new class called DecodeTranscriptNode.
2. Added class method INPUT_TYPES() to define the input types for the class.
3. Defined class variables RETURN_TYPES, RETURN_NAMES, and OUTPUT_NODE for the class.
4. Implemented the func() method to decode a descript transcript file and return the speakers, durations, and paragraphs as lists of strings.
5. Added the ETK_descript_base decorator to the class.
Impact: The new DecodeTranscriptNode class allows for decoding descript transcript files and extracting the speakers, durations, and paragraphs from the file.
Note: The patch also includes some import statements and post-processing calculations for the durations.
- Updated the import statements to only import necessary modules and classes.
- Changed the approach to dynamically import modules and retrieve classes using importlib.
- Added a check for ImportError when importing modules, and if not using generic nodes, skip the module.
- Removed NODE_CLASS_MAPPINGS_GENERIC and NODE_CLASS_MAPPINGS_COMFY dictionaries.
- Updated NODE_CLASS_MAPPINGS with the new mappings and added the old mappings.
- Removed the unused OLD_NODE_CLASS_MAPPINGS dictionary.
- Added a check to remove nodes with None values from NODE_CLASS_MAPPINGS.
- Imported the video node class mappings and updated NODE_CLASS_MAPPINGS with them as well.
- Added comments for clarity.