Server Check
Browse files- herramientas.py +10 -12
herramientas.py
CHANGED
@@ -5,27 +5,25 @@ import time
|
|
5 |
|
6 |
def obtenClienteOpenAI():
|
7 |
if local_check():
|
8 |
-
print("Estoy en LOCAL...")
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
# llave = bridges.llave
|
13 |
else:
|
14 |
print("Estoy en REMOTO...")
|
15 |
-
|
16 |
-
|
17 |
-
# llave = os.getenv("llave")
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
def local_check():
|
23 |
|
24 |
hostname = socket.gethostname()
|
|
|
25 |
print("Dentro de local_check... , el hostname es: ", hostname)
|
26 |
-
time.sleep(18)
|
27 |
|
28 |
-
if hostname == '
|
29 |
print("Ejecutando en el servidor")
|
30 |
return False
|
31 |
else:
|
|
|
5 |
|
6 |
def obtenClienteOpenAI():
|
7 |
if local_check():
|
8 |
+
print("Estoy en LOCAL...")
|
9 |
+
import bridges
|
10 |
+
buzz = bridges.buzz
|
11 |
+
llave = bridges.llave
|
|
|
12 |
else:
|
13 |
print("Estoy en REMOTO...")
|
14 |
+
buzz = os.getenv("buzz")
|
15 |
+
llave = os.getenv("llave")
|
|
|
16 |
|
17 |
+
client = OpenAI(api_key=buzz)
|
18 |
+
return client
|
19 |
|
20 |
def local_check():
|
21 |
|
22 |
hostname = socket.gethostname()
|
23 |
+
#r-moibe-nowme
|
24 |
print("Dentro de local_check... , el hostname es: ", hostname)
|
|
|
25 |
|
26 |
+
if hostname == 'r-moibe-nowme-9odaken2-89247-qbpii':
|
27 |
print("Ejecutando en el servidor")
|
28 |
return False
|
29 |
else:
|