forked from phoenix/litellm-mirror
(feat) router, add ModelResponse type hints
This commit is contained in:
parent
44fc20a0ff
commit
459ba5b45e
1 changed files with 4 additions and 1 deletions
|
@ -23,6 +23,7 @@ from litellm.llms.custom_httpx.azure_dall_e_2 import (
|
|||
CustomHTTPTransport,
|
||||
AsyncCustomHTTPTransport,
|
||||
)
|
||||
from litellm.utils import ModelResponse, CustomStreamWrapper
|
||||
import copy
|
||||
|
||||
|
||||
|
@ -216,7 +217,9 @@ class Router:
|
|||
|
||||
### COMPLETION, EMBEDDING, IMG GENERATION FUNCTIONS
|
||||
|
||||
def completion(self, model: str, messages: List[Dict[str, str]], **kwargs):
|
||||
def completion(
|
||||
self, model: str, messages: List[Dict[str, str]], **kwargs
|
||||
) -> Union[ModelResponse, CustomStreamWrapper]:
|
||||
"""
|
||||
Example usage:
|
||||
response = router.completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hey, how's it going?"}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue