acecalisto3 commited on
Commit
b70861c
1 Parent(s): 9e7fba3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -4
app.py CHANGED
@@ -316,7 +316,7 @@ def parse_action(line: str) -> Tuple[str, str]:
316
 
317
  def main():
318
  """Main function to run the Gradio interface."""
319
- global client
320
  # Initialize the LLM client with your API key
321
  try:
322
  client = InferenceClient(
@@ -328,6 +328,9 @@ def main():
328
  print("Error initializing LLM client. Please check your API key.")
329
  return
330
 
 
 
 
331
  with gr.Blocks() as demo:
332
  gr.Markdown("## FragMixt: The No-Code Development Powerhouse")
333
  gr.Markdown("### Your AI-Powered Development Companion")
@@ -360,9 +363,26 @@ def main():
360
  examples = [
361
  ["What is the purpose of this AI agent?", "I am designed to assist with no-code development tasks."],
362
  ["Can you help me generate a Python function to calculate the factorial of a number?", "Sure! Here is a Python function to calculate the factorial of a number:"],
363
- ["Generate a simple HTML page with a heading and a paragraph.", "```html\n<!DOCTYPE html>\n<html>\n<head>\n<title>My Simple Page</title>\n</head>\n<body>\n<h1>Welcome to my page!</h1>\n<p>This is a simple paragraph.</p>\n</body>\n</html>\n```"],
364
- ["Create a basic SQL query to select all data from a table named 'users'.", "```sql\nSELECT * FROM users;\n```"],
365
- ["Design a user interface for a mobile app that allows users to track their daily expenses.", "Here's a basic UI design for a mobile expense tracker app:\n\n**Screen 1: Home**\n- Top: App Name and Balance Display\n- Middle: List of Recent Transactions (Date, Description, Amount)\n- Bottom: Buttons for Add Expense, Add Income, View Categories\n\n**Screen 2: Add Expense**\n- Input fields for Date, Category, Description, Amount\n- Buttons for Save, Cancel\n\n**Screen 3: Expense Categories**\n- List of expense categories (e.g., Food, Transportation, Entertainment)\n- Option to add/edit categories\n\n**Screen 4: Reports**\n- Charts and graphs to visualize spending by category, date range, etc.\n- Filters to customize the reports"],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  ]
367
 
368
  def chat(purpose: str, message: str, agent_name: str, sys_prompt: str, temperature: float, max_new_tokens: int, top_p: float, repetition_penalty: float, history: List[Tuple[str, str]]) -> Tuple[List[Tuple[str, str]], List[Tuple[str, str]]]:
 
316
 
317
  def main():
318
  """Main function to run the Gradio interface."""
319
+ global client, date_time_str
320
  # Initialize the LLM client with your API key
321
  try:
322
  client = InferenceClient(
 
328
  print("Error initializing LLM client. Please check your API key.")
329
  return
330
 
331
+ # Get the current date and time
332
+ date_time_str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
333
+
334
  with gr.Blocks() as demo:
335
  gr.Markdown("## FragMixt: The No-Code Development Powerhouse")
336
  gr.Markdown("### Your AI-Powered Development Companion")
 
363
  examples = [
364
  ["What is the purpose of this AI agent?", "I am designed to assist with no-code development tasks."],
365
  ["Can you help me generate a Python function to calculate the factorial of a number?", "Sure! Here is a Python function to calculate the factorial of a number:"],
366
+ ["Generate a simple HTML page with a heading and a paragraph.", "
367
+
368
+
369
+ html\n
370
+
371
+ <!DOCTYPE html>\n<html>\n<head>\n<title>My Simple Page</title>\n</head>\n<body>\n<h1>Welcome to my page!</h1>\n<p>This is a simple paragraph.</p>\n</body>\n</html>
372
+
373
+ JS
374
+
375
+
376
+
377
+
378
+ \n
379
+
380
+ ["Create a basic SQL query to select all data from a table named 'users'.", "
381
+
382
+
383
+ sql\nSELECT * FROM users;\n
384
+
385
+ ["Design a user interface for a mobile app that allows users to track their daily expenses.", "Here's a basic UI design for a mobile expense tracker app:\n\n**Screen 1: Home**\n- Top: App Name and Balance Display\n- Middle: List of Recent Transactions (Date, Description, Amount)\n- Bottom: Buttons for Add Expense, Add Income, View Categories\n\n**Screen 2: Add Expense**\n- Input fields for Date, Category, Description, Amount\n- Buttons for Save, Cancel\n\n**Screen 3: Expense Categories**\n- List of expense categories (e.g., Food, Transportation, Entertainment)\n- Option to add/edit categories\n\n**Screen 4: Reports**\n- Charts and graphs to visualize spending by category, date range, etc.\n- Filters to customize the reports"],
386
  ]
387
 
388
  def chat(purpose: str, message: str, agent_name: str, sys_prompt: str, temperature: float, max_new_tokens: int, top_p: float, repetition_penalty: float, history: List[Tuple[str, str]]) -> Tuple[List[Tuple[str, str]], List[Tuple[str, str]]]: