mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-26 18:35:38 +08:00
feat(telemetry): add isolated beta quality diagnostics and release identity
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from langbot.pkg.telemetry import diagnostics
|
||||
|
||||
import abc
|
||||
import typing
|
||||
import time
|
||||
@@ -98,6 +100,7 @@ class RuntimeProvider:
|
||||
raise WorkspaceInvariantError('LLM invocation requires an ExecutionContext when query is absent')
|
||||
return execution_context
|
||||
|
||||
@diagnostics.observe('api', 'model.invoke_llm', source='agent')
|
||||
async def invoke_llm(
|
||||
self,
|
||||
query: pipeline_query.Query | None,
|
||||
@@ -182,6 +185,7 @@ class RuntimeProvider:
|
||||
except Exception as monitor_err:
|
||||
self.requester.ap.logger.error(f'[Monitoring] Failed to record LLM call: {monitor_err}')
|
||||
|
||||
@diagnostics.observe('api', 'model.invoke_llm_stream', source='agent')
|
||||
async def invoke_llm_stream(
|
||||
self,
|
||||
query: pipeline_query.Query | None,
|
||||
@@ -264,6 +268,7 @@ class RuntimeProvider:
|
||||
except Exception as monitor_err:
|
||||
self.requester.ap.logger.error(f'[Monitoring] Failed to record LLM stream call: {monitor_err}')
|
||||
|
||||
@diagnostics.observe('api', 'model.invoke_embedding', source='agent')
|
||||
async def invoke_embedding(
|
||||
self,
|
||||
model: RuntimeEmbeddingModel,
|
||||
@@ -331,6 +336,7 @@ class RuntimeProvider:
|
||||
except Exception as monitor_err:
|
||||
self.requester.ap.logger.error(f'[Monitoring] Failed to record embedding call: {monitor_err}')
|
||||
|
||||
@diagnostics.observe('api', 'model.invoke_rerank', source='agent')
|
||||
async def invoke_rerank(
|
||||
self,
|
||||
model: RuntimeRerankModel,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from langbot.pkg.telemetry import diagnostics
|
||||
|
||||
import typing
|
||||
import time
|
||||
import inspect
|
||||
@@ -473,6 +475,7 @@ class ToolManager:
|
||||
)
|
||||
return result
|
||||
|
||||
@diagnostics.observe('api', 'tool.execute', source='agent', stage='execute')
|
||||
async def execute_func_call(
|
||||
self,
|
||||
name: str,
|
||||
|
||||
Reference in New Issue
Block a user