mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(main.py): map list input to ollama prompt input format
This commit is contained in:
parent
6ef508cd37
commit
a1aeb7b404
2 changed files with 29 additions and 2 deletions
|
@ -24,6 +24,7 @@ from openai import (
|
|||
PermissionDeniedError,
|
||||
)
|
||||
import httpx
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class AuthenticationError(AuthenticationError): # type: ignore
|
||||
|
@ -50,11 +51,19 @@ class NotFoundError(NotFoundError): # type: ignore
|
|||
|
||||
|
||||
class BadRequestError(BadRequestError): # type: ignore
|
||||
def __init__(self, message, model, llm_provider, response: httpx.Response):
|
||||
def __init__(
|
||||
self, message, model, llm_provider, response: Optional[httpx.Response] = None
|
||||
):
|
||||
self.status_code = 400
|
||||
self.message = message
|
||||
self.model = model
|
||||
self.llm_provider = llm_provider
|
||||
response = response or httpx.Response(
|
||||
status_code=self.status_code,
|
||||
request=httpx.Request(
|
||||
method="GET", url="https://litellm.ai"
|
||||
), # mock request object
|
||||
)
|
||||
super().__init__(
|
||||
self.message, response=response, body=None
|
||||
) # Call the base class constructor with the parameters it needs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue