openlit 1.34.30__py3-none-any.whl → 1.34.31__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openlit/__helpers.py +235 -86
- openlit/__init__.py +16 -13
- openlit/_instrumentors.py +2 -1
- openlit/evals/all.py +50 -21
- openlit/evals/bias_detection.py +47 -20
- openlit/evals/hallucination.py +53 -22
- openlit/evals/toxicity.py +50 -21
- openlit/evals/utils.py +54 -30
- openlit/guard/all.py +61 -19
- openlit/guard/prompt_injection.py +34 -14
- openlit/guard/restrict_topic.py +46 -15
- openlit/guard/sensitive_topic.py +34 -14
- openlit/guard/utils.py +58 -22
- openlit/instrumentation/ag2/__init__.py +24 -8
- openlit/instrumentation/ag2/ag2.py +34 -13
- openlit/instrumentation/ag2/async_ag2.py +34 -13
- openlit/instrumentation/ag2/utils.py +133 -30
- openlit/instrumentation/ai21/__init__.py +43 -14
- openlit/instrumentation/ai21/ai21.py +47 -21
- openlit/instrumentation/ai21/async_ai21.py +47 -21
- openlit/instrumentation/ai21/utils.py +299 -78
- openlit/instrumentation/anthropic/__init__.py +21 -4
- openlit/instrumentation/anthropic/anthropic.py +28 -17
- openlit/instrumentation/anthropic/async_anthropic.py +28 -17
- openlit/instrumentation/anthropic/utils.py +145 -35
- openlit/instrumentation/assemblyai/__init__.py +11 -2
- openlit/instrumentation/assemblyai/assemblyai.py +15 -4
- openlit/instrumentation/assemblyai/utils.py +120 -25
- openlit/instrumentation/astra/__init__.py +43 -10
- openlit/instrumentation/astra/astra.py +28 -5
- openlit/instrumentation/astra/async_astra.py +28 -5
- openlit/instrumentation/astra/utils.py +151 -55
- openlit/instrumentation/azure_ai_inference/__init__.py +43 -10
- openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py +53 -21
- openlit/instrumentation/azure_ai_inference/azure_ai_inference.py +53 -21
- openlit/instrumentation/azure_ai_inference/utils.py +307 -83
- openlit/instrumentation/bedrock/__init__.py +21 -4
- openlit/instrumentation/bedrock/bedrock.py +63 -25
- openlit/instrumentation/bedrock/utils.py +139 -30
- openlit/instrumentation/chroma/__init__.py +89 -16
- openlit/instrumentation/chroma/chroma.py +28 -6
- openlit/instrumentation/chroma/utils.py +167 -51
- openlit/instrumentation/cohere/__init__.py +63 -18
- openlit/instrumentation/cohere/async_cohere.py +63 -24
- openlit/instrumentation/cohere/cohere.py +63 -24
- openlit/instrumentation/cohere/utils.py +286 -73
- openlit/instrumentation/controlflow/__init__.py +35 -9
- openlit/instrumentation/controlflow/controlflow.py +66 -33
- openlit/instrumentation/crawl4ai/__init__.py +25 -10
- openlit/instrumentation/crawl4ai/async_crawl4ai.py +78 -31
- openlit/instrumentation/crawl4ai/crawl4ai.py +78 -31
- openlit/instrumentation/crewai/__init__.py +40 -15
- openlit/instrumentation/crewai/async_crewai.py +32 -7
- openlit/instrumentation/crewai/crewai.py +32 -7
- openlit/instrumentation/crewai/utils.py +159 -56
- openlit/instrumentation/dynamiq/__init__.py +46 -12
- openlit/instrumentation/dynamiq/dynamiq.py +74 -33
- openlit/instrumentation/elevenlabs/__init__.py +23 -4
- openlit/instrumentation/elevenlabs/async_elevenlabs.py +16 -4
- openlit/instrumentation/elevenlabs/elevenlabs.py +16 -4
- openlit/instrumentation/elevenlabs/utils.py +128 -25
- openlit/instrumentation/embedchain/__init__.py +11 -2
- openlit/instrumentation/embedchain/embedchain.py +68 -35
- openlit/instrumentation/firecrawl/__init__.py +24 -7
- openlit/instrumentation/firecrawl/firecrawl.py +46 -20
- openlit/instrumentation/google_ai_studio/__init__.py +45 -10
- openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +67 -44
- openlit/instrumentation/google_ai_studio/google_ai_studio.py +67 -44
- openlit/instrumentation/google_ai_studio/utils.py +180 -67
- openlit/instrumentation/gpt4all/__init__.py +22 -7
- openlit/instrumentation/gpt4all/gpt4all.py +67 -29
- openlit/instrumentation/gpt4all/utils.py +285 -61
- openlit/instrumentation/gpu/__init__.py +128 -47
- openlit/instrumentation/groq/__init__.py +21 -4
- openlit/instrumentation/groq/async_groq.py +33 -21
- openlit/instrumentation/groq/groq.py +33 -21
- openlit/instrumentation/groq/utils.py +192 -55
- openlit/instrumentation/haystack/__init__.py +70 -24
- openlit/instrumentation/haystack/async_haystack.py +28 -6
- openlit/instrumentation/haystack/haystack.py +28 -6
- openlit/instrumentation/haystack/utils.py +196 -74
- openlit/instrumentation/julep/__init__.py +69 -19
- openlit/instrumentation/julep/async_julep.py +53 -27
- openlit/instrumentation/julep/julep.py +53 -28
- openlit/instrumentation/langchain/__init__.py +74 -63
- openlit/instrumentation/langchain/callback_handler.py +1100 -0
- openlit/instrumentation/langchain_community/__init__.py +13 -2
- openlit/instrumentation/langchain_community/async_langchain_community.py +23 -5
- openlit/instrumentation/langchain_community/langchain_community.py +23 -5
- openlit/instrumentation/langchain_community/utils.py +35 -9
- openlit/instrumentation/letta/__init__.py +68 -15
- openlit/instrumentation/letta/letta.py +99 -54
- openlit/instrumentation/litellm/__init__.py +43 -14
- openlit/instrumentation/litellm/async_litellm.py +51 -26
- openlit/instrumentation/litellm/litellm.py +51 -26
- openlit/instrumentation/litellm/utils.py +304 -102
- openlit/instrumentation/llamaindex/__init__.py +267 -90
- openlit/instrumentation/llamaindex/async_llamaindex.py +28 -6
- openlit/instrumentation/llamaindex/llamaindex.py +28 -6
- openlit/instrumentation/llamaindex/utils.py +204 -91
- openlit/instrumentation/mem0/__init__.py +11 -2
- openlit/instrumentation/mem0/mem0.py +50 -29
- openlit/instrumentation/milvus/__init__.py +10 -2
- openlit/instrumentation/milvus/milvus.py +31 -6
- openlit/instrumentation/milvus/utils.py +166 -67
- openlit/instrumentation/mistral/__init__.py +63 -18
- openlit/instrumentation/mistral/async_mistral.py +63 -24
- openlit/instrumentation/mistral/mistral.py +63 -24
- openlit/instrumentation/mistral/utils.py +277 -69
- openlit/instrumentation/multion/__init__.py +69 -19
- openlit/instrumentation/multion/async_multion.py +57 -26
- openlit/instrumentation/multion/multion.py +57 -26
- openlit/instrumentation/ollama/__init__.py +39 -18
- openlit/instrumentation/ollama/async_ollama.py +57 -26
- openlit/instrumentation/ollama/ollama.py +57 -26
- openlit/instrumentation/ollama/utils.py +226 -50
- openlit/instrumentation/openai/__init__.py +156 -32
- openlit/instrumentation/openai/async_openai.py +147 -67
- openlit/instrumentation/openai/openai.py +150 -67
- openlit/instrumentation/openai/utils.py +657 -185
- openlit/instrumentation/openai_agents/__init__.py +5 -1
- openlit/instrumentation/openai_agents/processor.py +110 -90
- openlit/instrumentation/phidata/__init__.py +13 -5
- openlit/instrumentation/phidata/phidata.py +67 -32
- openlit/instrumentation/pinecone/__init__.py +48 -9
- openlit/instrumentation/pinecone/async_pinecone.py +27 -5
- openlit/instrumentation/pinecone/pinecone.py +27 -5
- openlit/instrumentation/pinecone/utils.py +153 -47
- openlit/instrumentation/premai/__init__.py +22 -7
- openlit/instrumentation/premai/premai.py +51 -26
- openlit/instrumentation/premai/utils.py +246 -59
- openlit/instrumentation/pydantic_ai/__init__.py +49 -22
- openlit/instrumentation/pydantic_ai/pydantic_ai.py +69 -16
- openlit/instrumentation/pydantic_ai/utils.py +89 -24
- openlit/instrumentation/qdrant/__init__.py +19 -4
- openlit/instrumentation/qdrant/async_qdrant.py +33 -7
- openlit/instrumentation/qdrant/qdrant.py +33 -7
- openlit/instrumentation/qdrant/utils.py +228 -93
- openlit/instrumentation/reka/__init__.py +23 -10
- openlit/instrumentation/reka/async_reka.py +17 -11
- openlit/instrumentation/reka/reka.py +17 -11
- openlit/instrumentation/reka/utils.py +138 -36
- openlit/instrumentation/together/__init__.py +44 -12
- openlit/instrumentation/together/async_together.py +50 -27
- openlit/instrumentation/together/together.py +50 -27
- openlit/instrumentation/together/utils.py +301 -71
- openlit/instrumentation/transformers/__init__.py +2 -1
- openlit/instrumentation/transformers/transformers.py +13 -3
- openlit/instrumentation/transformers/utils.py +139 -36
- openlit/instrumentation/vertexai/__init__.py +81 -16
- openlit/instrumentation/vertexai/async_vertexai.py +33 -15
- openlit/instrumentation/vertexai/utils.py +123 -27
- openlit/instrumentation/vertexai/vertexai.py +33 -15
- openlit/instrumentation/vllm/__init__.py +12 -5
- openlit/instrumentation/vllm/utils.py +121 -31
- openlit/instrumentation/vllm/vllm.py +16 -10
- openlit/otel/events.py +35 -10
- openlit/otel/metrics.py +32 -24
- openlit/otel/tracing.py +24 -9
- openlit/semcov/__init__.py +72 -6
- {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/METADATA +2 -1
- openlit-1.34.31.dist-info/RECORD +166 -0
- openlit/instrumentation/langchain/async_langchain.py +0 -102
- openlit/instrumentation/langchain/langchain.py +0 -102
- openlit/instrumentation/langchain/utils.py +0 -252
- openlit-1.34.30.dist-info/RECORD +0 -168
- {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/LICENSE +0 -0
- {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/WHEEL +0 -0
@@ -8,12 +8,11 @@ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
|
8
8
|
from wrapt import wrap_function_wrapper
|
9
9
|
|
10
10
|
from openlit.instrumentation.llamaindex.llamaindex import general_wrap
|
11
|
-
from openlit.instrumentation.llamaindex.async_llamaindex import
|
12
|
-
async_general_wrap
|
13
|
-
)
|
11
|
+
from openlit.instrumentation.llamaindex.async_llamaindex import async_general_wrap
|
14
12
|
|
15
13
|
_instruments = ("llama-index >= 0.10.0",)
|
16
14
|
|
15
|
+
|
17
16
|
class LlamaIndexInstrumentor(BaseInstrumentor):
|
18
17
|
"""Framework guide compliant instrumentor with optimized performance"""
|
19
18
|
|
@@ -34,119 +33,279 @@ class LlamaIndexInstrumentor(BaseInstrumentor):
|
|
34
33
|
# === WORKFLOW OPERATIONS (Always enabled) - 17 operations ===
|
35
34
|
workflow_operations = [
|
36
35
|
# Document Loading & Processing Pipeline
|
37
|
-
(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
(
|
44
|
-
|
36
|
+
(
|
37
|
+
"llama_index.core.readers",
|
38
|
+
"SimpleDirectoryReader.load_data",
|
39
|
+
"document_load",
|
40
|
+
),
|
41
|
+
("llama_index.core.readers.base", "BaseReader.load_data", "document_load"),
|
42
|
+
(
|
43
|
+
"llama_index.core.document_transformer",
|
44
|
+
"DocumentTransformer.transform",
|
45
|
+
"document_transform",
|
46
|
+
),
|
47
|
+
(
|
48
|
+
"llama_index.core.node_parser",
|
49
|
+
"SentenceSplitter.get_nodes_from_documents",
|
50
|
+
"document_split",
|
51
|
+
),
|
45
52
|
# Index Construction & Management
|
46
|
-
(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
(
|
54
|
+
"llama_index.core.indices.vector_store.base",
|
55
|
+
"VectorStoreIndex.from_documents",
|
56
|
+
"index_construct",
|
57
|
+
),
|
58
|
+
(
|
59
|
+
"llama_index.core.indices.vector_store.base",
|
60
|
+
"VectorStoreIndex.from_vector_store",
|
61
|
+
"index_construct",
|
62
|
+
),
|
63
|
+
(
|
64
|
+
"llama_index.core.indices.list.base",
|
65
|
+
"ListIndex.from_documents",
|
66
|
+
"index_construct",
|
67
|
+
),
|
68
|
+
(
|
69
|
+
"llama_index.core.indices.tree.base",
|
70
|
+
"TreeIndex.from_documents",
|
71
|
+
"index_construct",
|
72
|
+
),
|
54
73
|
# Query Engine Operations
|
55
|
-
(
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
74
|
+
(
|
75
|
+
"llama_index.core.indices.base",
|
76
|
+
"BaseIndex.as_query_engine",
|
77
|
+
"query_engine_create",
|
78
|
+
),
|
79
|
+
(
|
80
|
+
"llama_index.core.query_engine.retriever_query_engine",
|
81
|
+
"RetrieverQueryEngine.query",
|
82
|
+
"query_engine_query",
|
83
|
+
),
|
84
|
+
(
|
85
|
+
"llama_index.core.query_engine.transform_query_engine",
|
86
|
+
"TransformQueryEngine.query",
|
87
|
+
"query_engine_query",
|
88
|
+
),
|
61
89
|
# Retrieval Operations
|
62
|
-
(
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
90
|
+
(
|
91
|
+
"llama_index.core.indices.base",
|
92
|
+
"BaseIndex.as_retriever",
|
93
|
+
"retriever_create",
|
94
|
+
),
|
95
|
+
(
|
96
|
+
"llama_index.core.indices.vector_store.retrievers.retriever",
|
97
|
+
"VectorIndexRetriever.retrieve",
|
98
|
+
"retriever_retrieve",
|
99
|
+
),
|
100
|
+
(
|
101
|
+
"llama_index.core.retrievers.base",
|
102
|
+
"BaseRetriever.retrieve",
|
103
|
+
"retriever_retrieve",
|
104
|
+
),
|
68
105
|
# LLM & Embedding Operations
|
69
106
|
("llama_index.core.llms.llm", "LLM.complete", "llm_complete"),
|
70
107
|
("llama_index.core.llms.llm", "LLM.chat", "llm_chat"),
|
71
|
-
(
|
72
|
-
|
108
|
+
(
|
109
|
+
"llama_index.core.embeddings.base",
|
110
|
+
"BaseEmbedding.get_text_embedding_batch",
|
111
|
+
"embedding_generate",
|
112
|
+
),
|
73
113
|
]
|
74
114
|
|
75
115
|
# === ASYNC OPERATIONS - 13 operations ===
|
76
116
|
async_operations = [
|
77
|
-
(
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
117
|
+
(
|
118
|
+
"llama_index.core.readers",
|
119
|
+
"SimpleDirectoryReader.aload_data",
|
120
|
+
"document_load_async",
|
121
|
+
),
|
122
|
+
(
|
123
|
+
"llama_index.core.readers.base",
|
124
|
+
"BaseReader.aload_data",
|
125
|
+
"document_load_async",
|
126
|
+
),
|
127
|
+
(
|
128
|
+
"llama_index.core.query_engine.retriever_query_engine",
|
129
|
+
"RetrieverQueryEngine.aquery",
|
130
|
+
"query_engine_query_async",
|
131
|
+
),
|
132
|
+
(
|
133
|
+
"llama_index.core.query_engine.transform_query_engine",
|
134
|
+
"TransformQueryEngine.aquery",
|
135
|
+
"query_engine_query_async",
|
136
|
+
),
|
137
|
+
(
|
138
|
+
"llama_index.core.indices.vector_store.retrievers.retriever",
|
139
|
+
"VectorIndexRetriever.aretrieve",
|
140
|
+
"retriever_retrieve_async",
|
141
|
+
),
|
142
|
+
(
|
143
|
+
"llama_index.core.retrievers.base",
|
144
|
+
"BaseRetriever.aretrieve",
|
145
|
+
"retriever_retrieve_async",
|
146
|
+
),
|
147
|
+
(
|
148
|
+
"llama_index.core.embeddings.base",
|
149
|
+
"BaseEmbedding.aget_text_embedding",
|
150
|
+
"embedding_generate_async",
|
151
|
+
),
|
152
|
+
(
|
153
|
+
"llama_index.core.embeddings.base",
|
154
|
+
"BaseEmbedding.aget_text_embedding_batch",
|
155
|
+
"embedding_generate_async",
|
156
|
+
),
|
86
157
|
("llama_index.core.llms.llm", "LLM.acomplete", "llm_complete_async"),
|
87
158
|
("llama_index.core.llms.llm", "LLM.achat", "llm_chat_async"),
|
88
159
|
("llama_index.core.llms.llm", "LLM.astream_complete", "llm_stream_async"),
|
89
160
|
("llama_index.core.llms.llm", "LLM.astream_chat", "llm_stream_async"),
|
90
|
-
(
|
161
|
+
(
|
162
|
+
"llama_index.core.response_synthesizers.base",
|
163
|
+
"BaseSynthesizer.asynthesize",
|
164
|
+
"response_generate_async",
|
165
|
+
),
|
91
166
|
]
|
92
167
|
|
93
168
|
# === COMPONENT OPERATIONS (Detailed tracing only) - 25 operations ===
|
94
169
|
component_operations = [
|
95
170
|
# Text Processing Components
|
96
|
-
(
|
97
|
-
|
98
|
-
|
99
|
-
|
171
|
+
(
|
172
|
+
"llama_index.core.node_parser.text.sentence",
|
173
|
+
"SentenceSplitter.split_text",
|
174
|
+
"text_splitter_split",
|
175
|
+
),
|
176
|
+
(
|
177
|
+
"llama_index.core.node_parser.text.sentence",
|
178
|
+
"SentenceSplitter._postprocess_nodes",
|
179
|
+
"text_splitter_postprocess",
|
180
|
+
),
|
181
|
+
(
|
182
|
+
"llama_index.core.node_parser.interface",
|
183
|
+
"NodeParser.get_nodes_from_node",
|
184
|
+
"node_parser_parse",
|
185
|
+
),
|
100
186
|
# Embedding Processing Components
|
101
|
-
(
|
102
|
-
|
187
|
+
(
|
188
|
+
"llama_index.core.embeddings.base",
|
189
|
+
"BaseEmbedding._get_text_embeddings",
|
190
|
+
"embedding_encode",
|
191
|
+
),
|
192
|
+
(
|
193
|
+
"llama_index.core.embeddings.utils",
|
194
|
+
"embed_nodes",
|
195
|
+
"embedding_embed_nodes",
|
196
|
+
),
|
103
197
|
("llama_index.core.embeddings.utils", "similarity", "embedding_similarity"),
|
104
|
-
|
105
198
|
# Retrieval Processing Components
|
106
|
-
(
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
(
|
112
|
-
|
113
|
-
|
199
|
+
(
|
200
|
+
"llama_index.core.retrievers.base",
|
201
|
+
"BaseRetriever._retrieve_nodes",
|
202
|
+
"retrieval_retrieve_nodes",
|
203
|
+
),
|
204
|
+
(
|
205
|
+
"llama_index.core.indices.vector_store.retrievers.retriever",
|
206
|
+
"VectorIndexRetriever._get_nodes_with_embeddings",
|
207
|
+
"retrieval_get_nodes",
|
208
|
+
),
|
209
|
+
(
|
210
|
+
"llama_index.core.indices.vector_store.retrievers.retriever",
|
211
|
+
"VectorIndexRetriever._build_node_list_from_query_result",
|
212
|
+
"retrieval_build_nodes",
|
213
|
+
),
|
214
|
+
(
|
215
|
+
"llama_index.core.postprocessor.node",
|
216
|
+
"BaseNodePostprocessor.postprocess_nodes",
|
217
|
+
"postprocessor_process",
|
218
|
+
),
|
114
219
|
# Response Generation Components
|
115
|
-
(
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
220
|
+
(
|
221
|
+
"llama_index.core.response_synthesizers.base",
|
222
|
+
"BaseSynthesizer.synthesize",
|
223
|
+
"response_synthesize",
|
224
|
+
),
|
225
|
+
(
|
226
|
+
"llama_index.core.response_synthesizers.compact_and_refine",
|
227
|
+
"CompactAndRefine.get_response",
|
228
|
+
"response_compact_refine",
|
229
|
+
),
|
230
|
+
(
|
231
|
+
"llama_index.core.response_synthesizers.tree_summarize",
|
232
|
+
"TreeSummarize.get_response",
|
233
|
+
"response_tree_summarize",
|
234
|
+
),
|
122
235
|
# Vector Store Components
|
123
|
-
(
|
124
|
-
|
125
|
-
|
126
|
-
|
236
|
+
(
|
237
|
+
"llama_index.core.vector_stores.simple",
|
238
|
+
"SimpleVectorStore.add",
|
239
|
+
"vector_store_add",
|
240
|
+
),
|
241
|
+
(
|
242
|
+
"llama_index.core.vector_stores.simple",
|
243
|
+
"SimpleVectorStore.delete",
|
244
|
+
"vector_store_delete",
|
245
|
+
),
|
246
|
+
(
|
247
|
+
"llama_index.core.vector_stores.simple",
|
248
|
+
"SimpleVectorStore.query",
|
249
|
+
"vector_store_query",
|
250
|
+
),
|
127
251
|
# Index Maintenance Components
|
128
|
-
(
|
129
|
-
|
130
|
-
|
131
|
-
|
252
|
+
(
|
253
|
+
"llama_index.core.indices.vector_store.base",
|
254
|
+
"VectorStoreIndex._insert",
|
255
|
+
"index_insert",
|
256
|
+
),
|
257
|
+
(
|
258
|
+
"llama_index.core.indices.vector_store.base",
|
259
|
+
"VectorStoreIndex._delete_node",
|
260
|
+
"index_delete",
|
261
|
+
),
|
262
|
+
(
|
263
|
+
"llama_index.core.indices.vector_store.base",
|
264
|
+
"VectorStoreIndex._build_index_from_nodes",
|
265
|
+
"index_build",
|
266
|
+
),
|
132
267
|
# Additional Framework Components
|
133
268
|
("llama_index.core.schema", "Document.get_content", "document_get_content"),
|
134
269
|
("llama_index.core.schema", "TextNode.get_content", "node_get_content"),
|
135
|
-
(
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
270
|
+
(
|
271
|
+
"llama_index.core.schema",
|
272
|
+
"TextNode.get_metadata_str",
|
273
|
+
"node_get_metadata",
|
274
|
+
),
|
275
|
+
(
|
276
|
+
"llama_index.core.readers.base",
|
277
|
+
"BaseReader._extract_metadata",
|
278
|
+
"document_extract_metadata",
|
279
|
+
),
|
280
|
+
(
|
281
|
+
"llama_index.core.vector_stores.utils",
|
282
|
+
"node_to_metadata_dict",
|
283
|
+
"embedding_metadata",
|
284
|
+
),
|
285
|
+
(
|
286
|
+
"llama_index.core.query_engine.retriever_query_engine",
|
287
|
+
"RetrieverQueryEngine._prepare_response_builder",
|
288
|
+
"query_prepare_response",
|
289
|
+
),
|
140
290
|
]
|
141
291
|
|
142
292
|
# Wrap workflow operations (always enabled)
|
143
293
|
for module, method, operation_type in workflow_operations:
|
144
294
|
try:
|
145
295
|
wrap_function_wrapper(
|
146
|
-
module,
|
147
|
-
|
148
|
-
|
149
|
-
|
296
|
+
module,
|
297
|
+
method,
|
298
|
+
general_wrap(
|
299
|
+
operation_type,
|
300
|
+
version,
|
301
|
+
environment,
|
302
|
+
application_name,
|
303
|
+
tracer,
|
304
|
+
pricing_info,
|
305
|
+
capture_message_content,
|
306
|
+
metrics,
|
307
|
+
disable_metrics,
|
308
|
+
),
|
150
309
|
)
|
151
310
|
except Exception:
|
152
311
|
pass
|
@@ -155,10 +314,19 @@ class LlamaIndexInstrumentor(BaseInstrumentor):
|
|
155
314
|
for module, method, operation_type in async_operations:
|
156
315
|
try:
|
157
316
|
wrap_function_wrapper(
|
158
|
-
module,
|
159
|
-
|
160
|
-
|
161
|
-
|
317
|
+
module,
|
318
|
+
method,
|
319
|
+
async_general_wrap(
|
320
|
+
operation_type,
|
321
|
+
version,
|
322
|
+
environment,
|
323
|
+
application_name,
|
324
|
+
tracer,
|
325
|
+
pricing_info,
|
326
|
+
capture_message_content,
|
327
|
+
metrics,
|
328
|
+
disable_metrics,
|
329
|
+
),
|
162
330
|
)
|
163
331
|
except Exception:
|
164
332
|
pass
|
@@ -168,10 +336,19 @@ class LlamaIndexInstrumentor(BaseInstrumentor):
|
|
168
336
|
for module, method, operation_type in component_operations:
|
169
337
|
try:
|
170
338
|
wrap_function_wrapper(
|
171
|
-
module,
|
172
|
-
|
173
|
-
|
174
|
-
|
339
|
+
module,
|
340
|
+
method,
|
341
|
+
general_wrap(
|
342
|
+
operation_type,
|
343
|
+
version,
|
344
|
+
environment,
|
345
|
+
application_name,
|
346
|
+
tracer,
|
347
|
+
pricing_info,
|
348
|
+
capture_message_content,
|
349
|
+
metrics,
|
350
|
+
disable_metrics,
|
351
|
+
),
|
175
352
|
)
|
176
353
|
except Exception:
|
177
354
|
pass
|
@@ -12,8 +12,18 @@ from openlit.instrumentation.llamaindex.utils import (
|
|
12
12
|
set_server_address_and_port,
|
13
13
|
)
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
def async_general_wrap(
|
17
|
+
gen_ai_endpoint,
|
18
|
+
version,
|
19
|
+
environment,
|
20
|
+
application_name,
|
21
|
+
tracer,
|
22
|
+
pricing_info,
|
23
|
+
capture_message_content,
|
24
|
+
metrics,
|
25
|
+
disable_metrics,
|
26
|
+
):
|
17
27
|
"""
|
18
28
|
Generates a telemetry wrapper for LlamaIndex async function calls.
|
19
29
|
"""
|
@@ -39,10 +49,22 @@ def async_general_wrap(gen_ai_endpoint, version, environment, application_name,
|
|
39
49
|
try:
|
40
50
|
# Process response and generate telemetry
|
41
51
|
response = process_llamaindex_response(
|
42
|
-
response,
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
response,
|
53
|
+
operation_type,
|
54
|
+
server_address,
|
55
|
+
server_port,
|
56
|
+
environment,
|
57
|
+
application_name,
|
58
|
+
metrics,
|
59
|
+
start_time,
|
60
|
+
span,
|
61
|
+
capture_message_content,
|
62
|
+
disable_metrics,
|
63
|
+
version,
|
64
|
+
instance,
|
65
|
+
args,
|
66
|
+
endpoint=gen_ai_endpoint,
|
67
|
+
**kwargs,
|
46
68
|
)
|
47
69
|
|
48
70
|
except Exception as e:
|
@@ -13,8 +13,18 @@ from openlit.instrumentation.llamaindex.utils import (
|
|
13
13
|
set_server_address_and_port,
|
14
14
|
)
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
def general_wrap(
|
18
|
+
gen_ai_endpoint,
|
19
|
+
version,
|
20
|
+
environment,
|
21
|
+
application_name,
|
22
|
+
tracer,
|
23
|
+
pricing_info,
|
24
|
+
capture_message_content,
|
25
|
+
metrics,
|
26
|
+
disable_metrics,
|
27
|
+
):
|
18
28
|
"""
|
19
29
|
Generates a telemetry wrapper for LlamaIndex function calls.
|
20
30
|
"""
|
@@ -40,10 +50,22 @@ def general_wrap(gen_ai_endpoint, version, environment, application_name,
|
|
40
50
|
try:
|
41
51
|
# Process response and generate telemetry
|
42
52
|
response = process_llamaindex_response(
|
43
|
-
response,
|
44
|
-
|
45
|
-
|
46
|
-
|
53
|
+
response,
|
54
|
+
operation_type,
|
55
|
+
server_address,
|
56
|
+
server_port,
|
57
|
+
environment,
|
58
|
+
application_name,
|
59
|
+
metrics,
|
60
|
+
start_time,
|
61
|
+
span,
|
62
|
+
capture_message_content,
|
63
|
+
disable_metrics,
|
64
|
+
version,
|
65
|
+
instance,
|
66
|
+
args,
|
67
|
+
endpoint=gen_ai_endpoint,
|
68
|
+
**kwargs,
|
47
69
|
)
|
48
70
|
|
49
71
|
except Exception as e:
|