Fixed issue 1520 - the collect_metrics options for the app is now taken into account for all actions (#1680)
This commit is contained in:
@@ -535,7 +535,8 @@ class EmbedChain(JSONSerializable):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Send anonymous telemetry
|
# Send anonymous telemetry
|
||||||
self.telemetry.capture(event_name="query", properties=self._telemetry_props)
|
if self.config.collect_metrics:
|
||||||
|
self.telemetry.capture(event_name="query", properties=self._telemetry_props)
|
||||||
|
|
||||||
if citations:
|
if citations:
|
||||||
if self.llm.config.token_usage:
|
if self.llm.config.token_usage:
|
||||||
@@ -647,7 +648,8 @@ class EmbedChain(JSONSerializable):
|
|||||||
self.llm.add_history(self.config.id, input_query, answer, session_id=session_id)
|
self.llm.add_history(self.config.id, input_query, answer, session_id=session_id)
|
||||||
|
|
||||||
# Send anonymous telemetry
|
# Send anonymous telemetry
|
||||||
self.telemetry.capture(event_name="chat", properties=self._telemetry_props)
|
if self.config.collect_metrics:
|
||||||
|
self.telemetry.capture(event_name="chat", properties=self._telemetry_props)
|
||||||
|
|
||||||
if citations:
|
if citations:
|
||||||
if self.llm.config.token_usage:
|
if self.llm.config.token_usage:
|
||||||
@@ -679,7 +681,8 @@ class EmbedChain(JSONSerializable):
|
|||||||
list[dict]: A list of dictionaries, each containing the 'context' and 'metadata' of a document.
|
list[dict]: A list of dictionaries, each containing the 'context' and 'metadata' of a document.
|
||||||
"""
|
"""
|
||||||
# Send anonymous telemetry
|
# Send anonymous telemetry
|
||||||
self.telemetry.capture(event_name="search", properties=self._telemetry_props)
|
if self.config.collect_metrics:
|
||||||
|
self.telemetry.capture(event_name="search", properties=self._telemetry_props)
|
||||||
|
|
||||||
if raw_filter and where:
|
if raw_filter and where:
|
||||||
raise ValueError("You can't use both `raw_filter` and `where` together.")
|
raise ValueError("You can't use both `raw_filter` and `where` together.")
|
||||||
@@ -729,7 +732,8 @@ class EmbedChain(JSONSerializable):
|
|||||||
self.db.reset()
|
self.db.reset()
|
||||||
self.delete_all_chat_history(app_id=self.config.id)
|
self.delete_all_chat_history(app_id=self.config.id)
|
||||||
# Send anonymous telemetry
|
# Send anonymous telemetry
|
||||||
self.telemetry.capture(event_name="reset", properties=self._telemetry_props)
|
if self.config.collect_metrics:
|
||||||
|
self.telemetry.capture(event_name="reset", properties=self._telemetry_props)
|
||||||
|
|
||||||
def get_history(
|
def get_history(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user