mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix mypy lint
This commit is contained in:
parent
9b4b846af9
commit
f09736ceb9
3 changed files with 9 additions and 7 deletions
|
|
@ -168,16 +168,16 @@ class LangfuseOtelLogger(OpenTelemetry):
|
|||
|
||||
output = response_obj.get("output", [])
|
||||
if output:
|
||||
output_data = []
|
||||
output_items_data: list[dict] = []
|
||||
for item in output:
|
||||
if hasattr(item, "type"):
|
||||
item_type = item.type
|
||||
if item_type == "reasoning" and hasattr(item, "summary"):
|
||||
for summary in item.summary:
|
||||
if hasattr(summary, "text"):
|
||||
output_data.append({"role": "reasoning_summary", "content": summary.text})
|
||||
output_items_data.append({"role": "reasoning_summary", "content": summary.text})
|
||||
elif item_type == "message":
|
||||
output_data.append({
|
||||
output_items_data.append({
|
||||
"role": getattr(item, "role", "assistant"),
|
||||
"content": getattr(getattr(item, "content", [{}])[0], "text", "")
|
||||
})
|
||||
|
|
@ -191,9 +191,9 @@ class LangfuseOtelLogger(OpenTelemetry):
|
|||
"type": "function_call",
|
||||
"arguments": arguments_obj,
|
||||
}
|
||||
output_data.append(langfuse_tool_call)
|
||||
if output_data:
|
||||
safe_set_attribute(span, LangfuseSpanAttributes.OBSERVATION_OUTPUT.value, safe_dumps(output_data))
|
||||
output_items_data.append(langfuse_tool_call)
|
||||
if output_items_data:
|
||||
safe_set_attribute(span, LangfuseSpanAttributes.OBSERVATION_OUTPUT.value, safe_dumps(output_items_data))
|
||||
|
||||
@staticmethod
|
||||
def _set_langfuse_specific_attributes(span: Span, kwargs, response_obj):
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class AzureAIOCRConfig(MistralOCRConfig):
|
|||
model: str,
|
||||
api_key: Optional[str] = None,
|
||||
api_base: Optional[str] = None,
|
||||
litellm_params: Optional[dict] = None,
|
||||
**kwargs,
|
||||
) -> Dict:
|
||||
"""
|
||||
|
|
@ -73,6 +74,7 @@ class AzureAIOCRConfig(MistralOCRConfig):
|
|||
api_base: Optional[str],
|
||||
model: str,
|
||||
optional_params: dict,
|
||||
litellm_params: Optional[dict] = None,
|
||||
**kwargs,
|
||||
) -> str:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class DeepgramAudioTranscriptionConfig(BaseAudioTranscriptionConfig):
|
|||
|
||||
segments = []
|
||||
current_speaker = None
|
||||
current_words = []
|
||||
current_words: list[str] = []
|
||||
|
||||
for word_obj in words:
|
||||
speaker = word_obj.get("speaker")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue