File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ module Bytez
5555 function request (path:: String , body:: String = " " )
5656 response = HTTP. request (
5757 body == " " ? " GET" : " POST" ,
58- " https://api.bytez.com /$path " ,
58+ " $HOST /$path " ,
5959 status_exception = false ,
6060 body = body,
6161 headers = Dict (
@@ -95,7 +95,7 @@ module Bytez
9595 status = " "
9696
9797 try
98- json = request ( " model/ start" , body)
98+ json = start ( body)
9999 catch
100100 json = request (" model/status" , body)
101101 finally
@@ -127,9 +127,17 @@ module Bytez
127127 #
128128 # bytez
129129 #
130- function init (key:: String )
130+ function init (key:: String , dev :: Bool = false )
131131 global API_KEY = key
132132
133+ global HOST
134+
135+ if dev
136+ HOST = " http://localhost:8080"
137+ else
138+ HOST = " https://bytez.com"
139+ end
140+
133141 function create_new_model (model_id:: String ; concurrency:: Int = 1 , timeout:: Int = 300 )
134142 return Model (model_id, concurrency, timeout)
135143 end
You can’t perform that action at this time.
0 commit comments