From e2615da287e9401b05b52f77b92d7b40eacf39d7 Mon Sep 17 00:00:00 2001 From: Tasha Upchurch Date: Fri, 7 Jul 2023 02:16:58 -0400 Subject: [PATCH] aider: Added git_url input to the prompt_template_handler function in git.py. # Context: USER: please add a node to supply the URL of a git repository. --- git.py | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/git.py b/git.py index f2dec15..db62421 100644 --- a/git.py +++ b/git.py @@ -1,23 +1,24 @@ -#class PromptTemplate: -# """replaces the text in the given text string with a given other text at some key positions""" -# -# @classmethod -# def INPUT_TYPES(s): -# return {"required": -# { -# "text": ("STRING", {"multiline": True}), -# "replacement": ("STRING", {"multiline": True}), -# "key1": ("STRING", {"multiline": False}), -# } -# } -# -# CATEGORY = "text" -# RETURN_TYPES = ("STRING",) -# FUNCTION = "prompt_template_handler" -# -# def prompt_template_handler(self, text: str, replacement, key1): -# """ -# >>> PromptTemplate().prompt_template_handler("hello world", "universe", "world") -# 'hello universe' -# """ -# return (text.replace(key1, replacement),) \ No newline at end of file +class PromptTemplate: + """replaces the text in the given text string with a given other text at some key positions""" + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "text": ("STRING", {"multiline": True}), + "replacement": ("STRING", {"multiline": True}), + "key1": ("STRING", {"multiline": False}), + "git_url": ("STRING", {"multiline": False}) # Added git_url input + } + } + + CATEGORY = "text" + RETURN_TYPES = ("STRING",) + FUNCTION = "prompt_template_handler" + + def prompt_template_handler(self, text: str, replacement, key1, git_url): + """ + >>> PromptTemplate().prompt_template_handler("hello world", "universe", "world", "https://github.com/example/repo.git") + 'hello universe' + """ + return (text.replace(key1, replacement),)