trait MapsTools

Methods

array
mapTools(array $tools, Provider $provider)

Map the given tools to xAI function definitions.

array
mapProviderTool(ProviderTool $tool, Provider $provider)

Map a provider tool to an xAI provider tool definition.

array
mapCodeExecutionTool(CodeExecution $tool, Provider $provider)

Map a code execution tool to an xAI code interpreter definition.

array
mapFileSearchTool(FileSearch $tool, Provider $provider)

Map a file search tool to an xAI file search definition.

array
mapWebSearchTool(WebSearch $tool, Provider $provider)

Map a web search tool to an xAI web search definition.

array
mapTool(Tool $tool)

Map a regular tool to an xAI function definition.

Details

at line 27
protected array mapTools(array $tools, Provider $provider)

Map the given tools to xAI function definitions.

Parameters

array $tools
Provider $provider

Return Value

array

at line 45
protected array mapProviderTool(ProviderTool $tool, Provider $provider)

Map a provider tool to an xAI provider tool definition.

Parameters

ProviderTool $tool
Provider $provider

Return Value

array

at line 58
protected array mapCodeExecutionTool(CodeExecution $tool, Provider $provider)

Map a code execution tool to an xAI code interpreter definition.

Parameters

CodeExecution $tool
Provider $provider

Return Value

array

at line 73
protected array mapFileSearchTool(FileSearch $tool, Provider $provider)

Map a file search tool to an xAI file search definition.

Parameters

FileSearch $tool
Provider $provider

Return Value

array

at line 88
protected array mapWebSearchTool(WebSearch $tool, Provider $provider)

Map a web search tool to an xAI web search definition.

Parameters

WebSearch $tool
Provider $provider

Return Value

array

at line 103
protected array mapTool(Tool $tool)

Map a regular tool to an xAI function definition.

Parameters

Tool $tool

Return Value

array