SHX-Auto / shx-ai.py
Ubuntu
Initial SHX commit πŸš€ Ready to launch!
206c9a3
raw
history blame contribute delete
827 Bytes
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}")