To access the DaytonaDataAnalysisTool, youβll need to create a Daytona account, get an API key, and install the langchain-daytona-data-analysis integration package.
Itβs also helpful (but not needed) to set up LangSmith for best-in-class observability/ of your tool calls. To enable automated tracing, set your LangSmith API key:
Enable tracing
Copy
os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")os.environ["LANGSMITH_TRACING"] = "true"
from langchain_daytona_data_analysis import DaytonaDataAnalysisToolfrom daytona import ExecutionArtifacts# Optionally, you can pass an on_result callback.# This callback lets you apply custom logic to the data analysis result.# For example, you can save outputs, display charts, or trigger other actions.def process_data_analysis_result(result: ExecutionArtifacts): print(result)tool = DaytonaDataAnalysisTool( daytona_api_key="your-daytona-api-key", # Only pass if not set as DAYTONA_API_KEY environment variable on_result=process_data_analysis_result)