forked from phoenix/litellm-mirror
fix importing Span
This commit is contained in:
parent
7c1183e76e
commit
87533bacf7
3 changed files with 26 additions and 8 deletions
|
@ -1,12 +1,18 @@
|
|||
import os
|
||||
from typing import Optional
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
from litellm._logging import verbose_logger
|
||||
from litellm.types.services import ServiceLoggerPayload, ServiceTypes
|
||||
from opentelemetry.trace import Span
|
||||
from datetime import datetime
|
||||
from litellm.types.services import ServiceLoggerPayload
|
||||
from typing import Union, Optional, TYPE_CHECKING, Any
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from opentelemetry.trace import Span as _Span
|
||||
|
||||
Span = _Span
|
||||
else:
|
||||
Span = Any
|
||||
|
||||
LITELLM_TRACER_NAME = "litellm"
|
||||
LITELLM_RESOURCE = {"service.name": "litellm"}
|
||||
|
|
|
@ -17,14 +17,20 @@ from litellm.proxy._types import (
|
|||
LiteLLM_OrganizationTable,
|
||||
LitellmUserRoles,
|
||||
)
|
||||
from typing import Optional, Literal, Union
|
||||
from typing import Optional, Literal, TYPE_CHECKING, Any
|
||||
from litellm.proxy.utils import PrismaClient, ProxyLogging, log_to_opentelemetry
|
||||
from litellm.caching import DualCache
|
||||
import litellm
|
||||
from opentelemetry.trace import Span
|
||||
from litellm.types.services import ServiceLoggerPayload, ServiceTypes
|
||||
from datetime import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from opentelemetry.trace import Span as _Span
|
||||
|
||||
Span = _Span
|
||||
else:
|
||||
Span = Any
|
||||
|
||||
all_routes = LiteLLMRoutes.openai_routes.value + LiteLLMRoutes.management_routes.value
|
||||
|
||||
|
||||
|
|
|
@ -2,12 +2,18 @@ import sys, os, platform, time, copy, re, asyncio, inspect
|
|||
import threading, ast
|
||||
import shutil, random, traceback, requests
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from typing import Optional, List, Callable, get_args, Set
|
||||
from typing import Optional, List, Callable, get_args, Set, Any, TYPE_CHECKING
|
||||
import secrets, subprocess
|
||||
import hashlib, uuid
|
||||
import warnings
|
||||
import importlib
|
||||
from opentelemetry.trace import Span
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from opentelemetry.trace import Span as _Span
|
||||
|
||||
Span = _Span
|
||||
else:
|
||||
Span = Any
|
||||
|
||||
|
||||
def showwarning(message, category, filename, lineno, file=None, line=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue