mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
style: minor cleanup from Greptile review
- Add noqa comment for unused model/is_async params (interface compatibility) - Filter empty strings in tool content flattening for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c2231ae225
commit
340ffd19f4
1 changed files with 6 additions and 3 deletions
|
|
@ -156,7 +156,7 @@ class SnowflakeConfig(SnowflakeBaseConfig, OpenAIGPTConfig):
|
|||
|
||||
return f"{api_base}/cortex/inference:complete"
|
||||
|
||||
def _transform_messages(
|
||||
def _transform_messages( # noqa: ARG002 - model, is_async unused; accepted for interface compatibility
|
||||
self, messages: List[AllMessageValues], model: str, is_async: bool = False
|
||||
) -> List[AllMessageValues]:
|
||||
"""
|
||||
|
|
@ -335,9 +335,12 @@ class SnowflakeConfig(SnowflakeBaseConfig, OpenAIGPTConfig):
|
|||
if content is None:
|
||||
content = "null"
|
||||
elif isinstance(content, list):
|
||||
# Flatten OpenAI multipart tool content to a plain string
|
||||
# Flatten OpenAI multipart tool content to a plain string.
|
||||
# Filter out empty strings from non-text parts (e.g., images).
|
||||
content = " ".join(
|
||||
part.get("text", "") for part in content if isinstance(part, dict)
|
||||
part.get("text", "")
|
||||
for part in content
|
||||
if isinstance(part, dict) and part.get("text")
|
||||
)
|
||||
elif not isinstance(content, str):
|
||||
content = str(content)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue