Browse Source

Add clear option to fabric.py CLI and fix changing default model

pull/253/head
Patrick Ruddiman 1 year ago
parent
commit
69f00b2f97
  1. 4
      installer/client/cli/fabric.py
  2. 4
      installer/client/cli/utils.py

4
installer/client/cli/fabric.py

@ -56,6 +56,7 @@ def main():
help='The URL of the remote ollamaserver to use. ONLY USE THIS if you are using a local ollama server in an non-deault location or port')
parser.add_argument('--context', '-c',
help="Use Context file (context.md) to add context to your pattern", action="store_true")
parser.add_argument('--clear', help="Clear the default model and other persisted settings", action="store_true")
args = parser.parse_args()
home_holder = os.path.expanduser("~")
@ -79,6 +80,9 @@ def main():
if args.changeDefaultModel:
Setup().default_model(args.changeDefaultModel)
sys.exit()
if args.clear:
os.remove(env_file)
sys.exit()
if args.agents:
# Handle the agents logic
if args.agents == 'trip_planner':

4
installer/client/cli/utils.py

@ -46,7 +46,7 @@ class Standalone:
self.pattern = pattern
self.args = args
self.model = None
if args.model:
if args and args.model:
self.model = args.model
else:
try:
@ -534,7 +534,7 @@ class Setup:
"""
model = model.strip()
env = os.path.expanduser("~/.config/fabric/.env")
standalone = Standalone(args=[], pattern="")
standalone = Standalone(args=None, pattern="")
gpt, ollama, claude = standalone.fetch_available_models()
allmodels = gpt + ollama + claude
if model not in allmodels:

Loading…
Cancel
Save