Skip to content

XaiTools

Namespace: Vercel.AI.Xai

public static class XaiTools

Factories for the xAI provider-defined tools. Each returns a Tool that xAI runs. Maps to xai.tools. The name is the name the model and the results use. It defaults to the tool’s wire name.

Inheritance: object

View source

public static Tool CodeExecution(string name = "code_execution")

The xai.code_execution tool. Maps to codeExecution.

Parameters

Name Type Description
name string

Returns: Tool

View source

public static Tool FileSearch(XaiFileSearchOptions options, string name = "file_search")

The xai.file_search tool. Maps to fileSearch.

Parameters

Name Type Description
options XaiFileSearchOptions
name string

Returns: Tool

View source

ImageGeneration(XaiImageGenerationOptions?, string)

Section titled “ImageGeneration(XaiImageGenerationOptions?, string)”
public static Tool ImageGeneration(XaiImageGenerationOptions? options = null, string name = "image_generation")

The xai.image_generation tool. Maps to imageGeneration.

Parameters

Name Type Description
options XaiImageGenerationOptions
name string

Returns: Tool

View source

public static Tool McpServer(XaiMcpServerOptions options, string name = "mcp")

The xai.mcp tool. Maps to mcpServer.

Parameters

Name Type Description
options XaiMcpServerOptions
name string

Returns: Tool

View source

public static Tool ViewImage(string name = "view_image")

The xai.view_image tool. Maps to viewImage.

Parameters

Name Type Description
name string

Returns: Tool

View source

public static Tool ViewXVideo(string name = "view_x_video")

The xai.view_x_video tool. Maps to viewXVideo.

Parameters

Name Type Description
name string

Returns: Tool

View source

public static Tool WebSearch(XaiWebSearchOptions? options = null, string name = "web_search")

The xai.web_search tool. Maps to webSearch.

Parameters

Name Type Description
options XaiWebSearchOptions
name string

Returns: Tool

View source

public static Tool XSearch(XaiXSearchOptions? options = null, string name = "x_search")

The xai.x_search tool. Maps to xSearch.

Parameters

Name Type Description
options XaiXSearchOptions
name string

Returns: Tool

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product