mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
refactor: fix linting errors
This commit is contained in:
parent
f52a65d43b
commit
6d1a5089e3
2 changed files with 8 additions and 3 deletions
|
@ -5,7 +5,7 @@ import requests
|
||||||
import time
|
import time
|
||||||
from typing import Callable, Optional
|
from typing import Callable, Optional
|
||||||
import litellm
|
import litellm
|
||||||
from litellm.utils import ModelResponse, get_secret, Usage
|
from litellm.utils import ModelResponse, EmbeddingResponse, get_secret, Usage
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
import httpx
|
import httpx
|
||||||
|
@ -198,7 +198,7 @@ def completion(
|
||||||
|
|
||||||
def embedding(model: str,
|
def embedding(model: str,
|
||||||
input: list,
|
input: list,
|
||||||
model_response: ModelResponse,
|
model_response: EmbeddingResponse,
|
||||||
print_verbose: Callable,
|
print_verbose: Callable,
|
||||||
encoding,
|
encoding,
|
||||||
logging_obj,
|
logging_obj,
|
||||||
|
@ -262,7 +262,7 @@ def embedding(model: str,
|
||||||
ContentType="application/json",
|
ContentType="application/json",
|
||||||
Body={data},
|
Body={data},
|
||||||
CustomAttributes="accept_eula=true",
|
CustomAttributes="accept_eula=true",
|
||||||
)"""
|
)""" # type: ignore
|
||||||
logging_obj.pre_call(
|
logging_obj.pre_call(
|
||||||
input=input,
|
input=input,
|
||||||
api_key="",
|
api_key="",
|
||||||
|
|
|
@ -1175,6 +1175,11 @@ async def test_endpoint(request: Request):
|
||||||
async def health_endpoint(request: Request, model: Optional[str] = fastapi.Query(None, description="Specify the model name (optional)")):
|
async def health_endpoint(request: Request, model: Optional[str] = fastapi.Query(None, description="Specify the model name (optional)")):
|
||||||
global llm_model_list
|
global llm_model_list
|
||||||
|
|
||||||
|
if llm_model_list is None:
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||||
|
detail={"error": "Model list not initialized"},
|
||||||
|
)
|
||||||
healthy_endpoints, unhealthy_endpoints = await perform_health_check(llm_model_list, model)
|
healthy_endpoints, unhealthy_endpoints = await perform_health_check(llm_model_list, model)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue