CosmoAI commited on
Commit
6a3d8d3
1 Parent(s): a43ca38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -15
app.py CHANGED
@@ -1,18 +1,29 @@
1
- import subprocess
2
-
3
- def run_terminal_command(command):
4
- try:
5
- # Run the terminal command and capture its output
6
- output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
7
- return output.decode("utf-8") # Decode bytes to string
8
- except subprocess.CalledProcessError as e:
9
- # Handle errors if the command fails
10
- return f"Error: {e.output.decode('utf-8')}"
11
-
12
- # Example command: list files in the current directory
13
- command = "ls"
14
- output = run_terminal_command(command)
15
- print(output)
 
 
 
 
 
 
 
 
 
 
 
16
 
17
 
18
 
 
1
+ from interpreter import interpreter
2
+ import streamlit as st
3
+
4
+ output = interpreter.chat("hi, how are you")
5
+
6
+ st.write(output)
7
+
8
+
9
+
10
+
11
+
12
+ # import subprocess
13
+
14
+ # def run_terminal_command(command):
15
+ # try:
16
+ # # Run the terminal command and capture its output
17
+ # output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
18
+ # return output.decode("utf-8") # Decode bytes to string
19
+ # except subprocess.CalledProcessError as e:
20
+ # # Handle errors if the command fails
21
+ # return f"Error: {e.output.decode('utf-8')}"
22
+
23
+ # # Example command: list files in the current directory
24
+ # command = "ls"
25
+ # output = run_terminal_command(command)
26
+ # print(output)
27
 
28
 
29