Lint fixes and added lint config file

This commit is contained in:
jeffser
2024-08-04 20:41:35 -06:00
parent ccb59c7f02
commit 1fbd6a0824
3 changed files with 19 additions and 8 deletions

View File

@@ -1,15 +1,19 @@
# connection_handler.py
import json, requests
"""
Handles requests to remote and integrated instances of Ollama
"""
import json
import requests
#OK=200 response.status_code
url = None
bearer_token = None
URL = None
BEARER_TOKEN = None
def get_headers(include_json:bool) -> dict:
headers = {}
if include_json:
headers["Content-Type"] = "application/json"
if bearer_token:
headers["Authorization"] = "Bearer {}".format(bearer_token)
if BEARER_TOKEN:
headers["Authorization"] = "Bearer {}".format(BEARER_TOKEN)
return headers if len(headers.keys()) > 0 else None
def simple_get(connection_url:str) -> dict: