File size: 827 Bytes
206c9a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json
import subprocess
import os

# Load configuration
with open("/home/subatomicERROR/dev/shx-hfspace/shx-config.json", "r") as f:
    config = json.load(f)

def run_command(command):
    try:
        result = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
        return result.stdout
    except subprocess.CalledProcessError as e:
        return f"⚠️ Error: {e.stderr}"

def shx_ai(prompt):
    # Generate response using the model
    response = run_command(f"python3 /home/subatomicERROR/dev/shx-hfspace/app.py --prompt '{prompt}'")
    return response

# Example usage
if __name__ == "__main__":
    prompt = "Create a simple web application with a form to collect user data."
    response = shx_ai(prompt)
    print(f"🤖 SHX Response: {response}")