MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / make_request

Method make_request

tools/server/tests/utils.py:316–347  ·  view source on GitHub ↗
(
        self,
        method: str,
        path: str,
        data: dict | Any | None = None,
        headers: dict | None = None,
        timeout: float | None = None,
    )

Source from the content-addressed store, hash-verified

314 self._log.close()
315
316 def make_request(
317 self,
318 method: str,
319 path: str,
320 data: dict | Any | None = None,
321 headers: dict | None = None,
322 timeout: float | None = None,
323 ) -> ServerResponse:
324 url = f"http://{self.server_host}:{self.server_port}{path}"
325 parse_body = False
326 if method == "GET":
327 response = requests.get(url, headers=headers, timeout=timeout)
328 parse_body = True
329 elif method == "POST":
330 response = requests.post(url, headers=headers, json=data, timeout=timeout)
331 parse_body = True
332 elif method == "OPTIONS":
333 response = requests.options(url, headers=headers, timeout=timeout)
334 else:
335 raise ValueError(f"Unimplemented method: {method}")
336 result = ServerResponse()
337 result.headers = dict(response.headers)
338 result.status_code = response.status_code
339 if parse_body:
340 try:
341 result.body = response.json()
342 except JSONDecodeError:
343 result.body = response.text
344 else:
345 result.body = None
346 print("Response from server", json.dumps(result.body, indent=2))
347 return result
348
349 def make_stream_request(
350 self,

Callers 15

startMethod · 0.95
make_any_requestMethod · 0.95
test_mcp_no_proxyFunction · 0.80
test_server_start_simpleFunction · 0.80
test_server_propsFunction · 0.80
test_server_modelsFunction · 0.80
test_server_slotsFunction · 0.80
test_load_split_modelFunction · 0.80
test_tokenize_detokenizeFunction · 0.80

Calls 4

ServerResponseClass · 0.85
jsonMethod · 0.80
getMethod · 0.45
postMethod · 0.45

Tested by 15

test_mcp_no_proxyFunction · 0.64
test_server_start_simpleFunction · 0.64
test_server_propsFunction · 0.64
test_server_modelsFunction · 0.64
test_server_slotsFunction · 0.64
test_load_split_modelFunction · 0.64
test_tokenize_detokenizeFunction · 0.64
test_tokenize_with_bosFunction · 0.64