File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 5656if profiling_env_var :
5757 from ddtrace .profiling import profiler
5858
59+ llmobs_api_key = None
5960llmobs_env_var = os .environ .get ("DD_LLMOBS_ENABLED" , "false" ).lower () in ("true" , "1" )
6061if llmobs_env_var :
62+ from datadog_lambda .api import init_api
63+ from datadog import api
6164 from ddtrace .llmobs import LLMObs
6265
66+ init_api ()
67+ llmobs_api_key = api ._api_key
68+
6369logger = logging .getLogger (__name__ )
6470
6571DD_FLUSH_TO_LOG = "DD_FLUSH_TO_LOG"
@@ -229,7 +235,10 @@ def __init__(self, func):
229235
230236 # Enable LLM Observability
231237 if llmobs_env_var :
232- LLMObs .enable ()
238+ LLMObs .enable (
239+ agentless_enabled = True ,
240+ api_key = llmobs_api_key ,
241+ )
233242
234243 logger .debug ("datadog_lambda_wrapper initialized" )
235244 except Exception as e :
You can’t perform that action at this time.
0 commit comments