import gradio as gr import json def load_products(): try: with open('products.json', 'r') as f: products = json.load(f) return products except Exception as e: print(f"Error loading products: {e}") return None def show_products(): products = load_products() if not products: return "

Error loading products

" html_content = "

Products

" for product in products['products']: html_content += f"
{product[

{product['details']}

Price: ${product['price']}

" return html_content iface = gr.Interface(fn=show_products, inputs=[], outputs='html') iface.launch()