mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix mypy
This commit is contained in:
parent
ca6d77b479
commit
cf676e7aef
1 changed files with 4 additions and 6 deletions
|
|
@ -382,20 +382,18 @@ class DatabricksConfig(DatabricksBase, OpenAILikeChatConfig, AnthropicConfig):
|
|||
) -> Optional[List[Any]]:
|
||||
if content is None:
|
||||
return None
|
||||
citations: Optional[List[Any]] = None
|
||||
citations = []
|
||||
if isinstance(content, list):
|
||||
for item in content:
|
||||
text = item.get("text", None)
|
||||
if item.get("citations") is not None:
|
||||
if citations is None:
|
||||
citations = []
|
||||
if citations_item := item.get("citations"):
|
||||
citations.append(
|
||||
[
|
||||
{**citation, "supported_text": text}
|
||||
for citation in item["citations"]
|
||||
for citation in citations_item
|
||||
]
|
||||
)
|
||||
return citations
|
||||
return citations or None
|
||||
|
||||
def _transform_dbrx_choices(
|
||||
self, choices: List[DatabricksChoice], json_mode: Optional[bool] = None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue