Initialize the client with an API key. Args: api_key (str): Your Bytez API key.
( self, api_key, dev = False )
| 12 | """ |
| 13 | |
| 14 | def __init__( self, api_key, dev = False ): |
| 15 | """ |
| 16 | Initialize the client with an API key. |
| 17 | |
| 18 | Args: |
| 19 | api_key (str): Your Bytez API key. |
| 20 | """ |
| 21 | self.headers = { |
| 22 | "lang": "python", |
| 23 | "authorization": f"Key {api_key}", |
| 24 | "content-type": "application/json", |
| 25 | } |
| 26 | self.host = f"http{'://' if dev else 's://'}{'localhost:8080' if dev else 'api.bytez.com'}/models/v2/" |
| 27 | def request(self, path = "", method = "GET", post_body = None, provider_key = None): |
| 28 | """ |
| 29 | Send an HTTP request. |
nothing calls this directly
no outgoing calls
no test coverage detected