From 6d1bcde61990fe44f01cad552c84cf163cb4b1c8 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Mon, 5 Feb 2024 20:37:09 +0000 Subject: [PATCH] More minor import cleanup --- src/llm_utils/chat.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/llm_utils/chat.py b/src/llm_utils/chat.py index 58fe01c..1e8f9a2 100644 --- a/src/llm_utils/chat.py +++ b/src/llm_utils/chat.py @@ -17,8 +17,7 @@ ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ) -import requests as req -import re +import requests T = TypeVar("T") from llm_utils.utils import contains_valid_json, extract_code_blocks @@ -217,7 +216,9 @@ def get_inference(cls, payload: Dict[Any, Any]) -> Any: prepped = request.prepare() # Send the HTTP POST request to the prepared URL with the specified headers & JSON-formatted request body, storing the response - response = req.post(prepped.url, headers=prepped.headers, data=request_body) + response = requests.post( + prepped.url, headers=prepped.headers, data=request_body + ) if response.status_code == 200: return response.json()