Skip to content

Commit

Permalink
feat: support both new and legacy llama_index versions (traceloop#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-feel authored Feb 13, 2024
1 parent 18a5537 commit 5e5bc88
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
_with_tracer_wrapper, start_as_current_span_async, should_send_prompts
)

from llama_index.llms.custom import CustomLLM

MODULE_NAME = "llama_index.llms"
try:
from llama_index.core.llms import CustomLLM
MODULE_NAME = "llama_index.core.llms"
except ModuleNotFoundError:
from llama_index.legacy.llms.custom import CustomLLM
MODULE_NAME = "llama_index.legacy.llms"


class CustomLLMInstrumentor:
Expand Down

0 comments on commit 5e5bc88

Please sign in to comment.