Skip to content

Commit

Permalink
Refactored function to use dynamic framework
Browse files Browse the repository at this point in the history
Signed-off-by: hansrajr <[email protected]>
  • Loading branch information
Hansrajr committed Sep 18, 2024
1 parent 90c5e8c commit bc9c55e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/monocle_apptrace/wrap_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
'embedding_model': get_embedding_model(),
'type': VECTOR_STORE,
},
# Add more frameworks here as needed
}

@with_tracer_wrapper
Expand Down Expand Up @@ -299,19 +298,14 @@ def update_vectorstore_attributes(to_wrap, instance, span):
"""
try:
package = to_wrap.get('package')

# Check if the package exists in the framework mapping
if package in frameworks_mapping:
# Extract attributes based on the configured function for the package
attributes = frameworks_mapping[package](instance)
# Update span attributes with extracted values
span._attributes.update({
TYPE: attributes['type'],
PROVIDER: attributes['provider'],
EMBEDDING_MODEL: attributes['embedding_model']
})
else:
# Handle unknown package logic (optional logging or default behavior)
print(f"Package '{package}' not recognized for vector store telemetry.")

except Exception as e:
Expand Down

0 comments on commit bc9c55e

Please sign in to comment.