Skip to content

Commit

Permalink
Fix n word input and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthSareen committed Nov 12, 2024
1 parent 8a6b387 commit 78d757a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ducky/ducky.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 78d757a

Please sign in to comment.