Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang committed Jan 19, 2024
1 parent 322a3cb commit 63f6ecc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ instruments = [
test = [
"llama-index == 0.9.14",
"openai",
"openinference-instrumentation-openai",
"opentelemetry-sdk",
"opentelemetry-instrumentation-httpx",
"openinference-instrumentation-openai",
"respx",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,13 @@ def start_trace(self, trace_id: Optional[str] = None) -> None:
self._stragglers.pop(event_id)

def end_trace(self, trace_id: Optional[str] = None, *args: Any, **kwargs: Any) -> None:
dfs_stack, adjacency_list = _build_graph(self._event_data)
roots, adjacency_list = _build_graph(self._event_data)
self._event_data.clear()
dfs_stack = roots.copy()
while dfs_stack:
event_id, event_data = dfs_stack.pop()
event_type = event_data.event_type
attributes = event_data.attributes
if not event_data.span:
# `on_event_start` was never called, so discard the event.
continue

if event_type is CBEventType.LLM:
while dfs_stack:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
from httpx import AsyncByteStream, Response, SyncByteStream
from llama_index import ListIndex, ServiceContext
from llama_index.callbacks import CallbackManager
from llama_index.llms import (
OpenAI,
)
from llama_index.llms import OpenAI
from llama_index.schema import Document, TextNode
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
from openinference.instrumentation.openai import OpenAIInstrumentor
Expand Down

0 comments on commit 63f6ecc

Please sign in to comment.