feat(databricks/chat): support structured outputs on databricks

Closes https://github.com/BerriAI/litellm/pull/6978

- handles content as list for dbrx, - handles streaming+response_format for dbrx
This commit is contained in:
Krrish Dholakia 2024-12-02 18:23:05 -08:00
parent 12aea45447
commit 0caf804f4c
18 changed files with 538 additions and 193 deletions

View file

@ -115,7 +115,8 @@ from .llms.cohere import chat as cohere_chat
from .llms.cohere import completion as cohere_completion # type: ignore
from .llms.cohere.embed import handler as cohere_embed
from .llms.custom_llm import CustomLLM, custom_chat_llm_router
from .llms.databricks.chat import DatabricksChatCompletion
from .llms.databricks.chat.handler import DatabricksChatCompletion
from .llms.databricks.embed.handler import DatabricksEmbeddingHandler
from .llms.groq.chat.handler import GroqChatCompletion
from .llms.huggingface_restapi import Huggingface
from .llms.OpenAI.audio_transcriptions import OpenAIAudioTranscription
@ -230,6 +231,7 @@ watsonxai = IBMWatsonXAI()
sagemaker_llm = SagemakerLLM()
watsonx_chat_completion = WatsonXChatHandler()
openai_like_embedding = OpenAILikeEmbeddingHandler()
databricks_embedding = DatabricksEmbeddingHandler()
####### COMPLETION ENDPOINTS ################
@ -3475,7 +3477,7 @@ def embedding( # noqa: PLR0915
) # type: ignore
## EMBEDDING CALL
response = databricks_chat_completions.embedding(
response = databricks_embedding.embedding(
model=model,
input=input,
api_base=api_base,