fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
529 B

from flask import request, jsonify
from app.patterns import bp
import os
@bp.route("/get", methods=['GET'])
def get():
try:
config = os.path.expanduser("~/.config/fabric/patterns")
patterns = os.listdir(config)
pattern_list = {}
for pattern in patterns:
with open(f"{config}/{pattern}/system.md", "r") as f:
pattern_list[pattern] = f.read()
return jsonify(pattern_list)
except Exception as e:
return jsonify(message="Patterns not found"), 404