MCPcopy
hub / github.com/ModelTC/LightLLM / RequestThread

Class RequestThread

test/test_api/test_multimodal_api.py:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86
87class RequestThread(threading.Thread):
88 def __init__(self, url, headers, data):
89 threading.Thread.__init__(self)
90 self.url = url
91 self.headers = headers
92 self.data = data
93
94 def run(self):
95 response = requests.post(self.url, headers=self.headers, data=json.dumps(self.data))
96 if response.status_code == 200:
97 print(response.json())
98 else:
99 print("Error:", response.status_code, response.text)
100
101
102def image_to_base64(image):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected