//#region src/tools/code_execution.ts
/**
* xAI Code Execution tool type constant.
* Note: The Responses API uses "code_interpreter" as the type name.
*/
const XAI_CODE_EXECUTION_TOOL_TYPE = "code_interpreter";
/**
* Creates an xAI code execution tool.
* Enables the model to write and execute Python code in real-time for
* calculations, data analysis, and complex computations.
*
* This tool is executed server-side by the xAI API in a secure, sandboxed
* Python environment with common libraries pre-installed (NumPy, Pandas,
* Matplotlib, SciPy).
*
* @returns An XAICodeExecutionTool object to pass to the model
*
* @example Basic usage
* ```typescript
* import { ChatXAIResponses, tools } from "@langchain/xai";
*
* const llm = new ChatXAIResponses({
*   model: "grok-4-1-fast",
* });
*
* const codeExecution = tools.xaiCodeExecution();
* const result = await llm.invoke(
*   "Calculate the compound interest for $10,000 at 5% annually for 10 years",
*   { tools: [codeExecution] }
* );
* ```
*
* @example Combining with search tools
* ```typescript
* const webSearch = tools.xaiWebSearch();
* const codeExecution = tools.xaiCodeExecution();
*
* const result = await llm.invoke(
*   "Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years",
*   { tools: [webSearch, codeExecution] }
* );
* ```
*/
function xaiCodeExecution() {
	return { type: XAI_CODE_EXECUTION_TOOL_TYPE };
}

//#endregion
export { XAI_CODE_EXECUTION_TOOL_TYPE, xaiCodeExecution };
//# sourceMappingURL=code_execution.js.map