From 78d757a88d7b0e27eb729423a1564c5248f02e5a Mon Sep 17 00:00:00 2001 From: ParthSareen Date: Tue, 12 Nov 2024 14:03:27 -0800 Subject: [PATCH] Fix n word input and bump version --- ducky/ducky.py | 7 ++++--- setup.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ducky/ducky.py b/ducky/ducky.py index 7ffc7d4..5922797 100644 --- a/ducky/ducky.py +++ b/ducky/ducky.py @@ -25,7 +25,7 @@ async def call_llama(self, code: str = "", prompt: Optional[str] = None, chain: while True: # Include previous responses in the prompt for context context_prompt = "\n".join(responses) + "\n" + prompt - response = await self.client.generate(model="codellama", prompt=context_prompt) + response = await self.client.generate(model=self.model, prompt=context_prompt) print(response['response']) responses.append(response['response']) if not chain: @@ -45,7 +45,7 @@ def read_files_from_dir(directory: str) -> str: async def ducky() -> None: parser = argparse.ArgumentParser() - parser.add_argument("question", nargs="?", help="Direct question to ask", default=None) + parser.add_argument("question", nargs="*", help="Direct question to ask", default=None) parser.add_argument("--prompt", "-p", help="Custom prompt to be used", default=None) parser.add_argument("--file", "-f", help="The file to be processed", default=None) parser.add_argument("--directory", "-d", help="The directory to be processed", default=None) @@ -67,7 +67,8 @@ async def ducky() -> None: # Handle direct question from CLI if args.question is not None: - await rubber_ducky.call_llama(prompt=args.question, chain=args.chain) + question = " ".join(args.question) + await rubber_ducky.call_llama(prompt=question, chain=args.chain) return if args.file is None and args.directory is None: diff --git a/setup.py b/setup.py index 0e6f1e7..19a4d16 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='rubber-ducky', - version='1.1.1', + version='1.1.2', description='AI Companion for Pair Programming', long_description=long_description, long_description_content_type='text/markdown',