Table of Contents

Class LiteRtTool

Namespace
LiteRtLmSharp
Assembly
LiteRtLmSharp.dll

A tool the model may call. ParametersJson is a JSON-Schema object string (the parameters of a Gemini/OpenAI function declaration), e.g. {"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}.

public sealed record LiteRtTool : IEquatable<LiteRtTool>
Inheritance
LiteRtTool
Implements
Inherited Members

Remarks

Names are sent to the model verbatim. Small on-device models are trained predominantly on snake_case tool and parameter names, and calling accuracy suffers with other conventions — prefer get_weather over GetWeather/getWeather. (Google's Kotlin binding converts camelCase to snake_case automatically for this reason; this binding keeps names as-authored, so the convention is the caller's responsibility.)

Constructors

LiteRtTool(string, string?, string)

A tool the model may call. ParametersJson is a JSON-Schema object string (the parameters of a Gemini/OpenAI function declaration), e.g. {"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}.

public LiteRtTool(string Name, string? Description, string ParametersJson)

Parameters

Name string
Description string
ParametersJson string

Remarks

Names are sent to the model verbatim. Small on-device models are trained predominantly on snake_case tool and parameter names, and calling accuracy suffers with other conventions — prefer get_weather over GetWeather/getWeather. (Google's Kotlin binding converts camelCase to snake_case automatically for this reason; this binding keeps names as-authored, so the convention is the caller's responsibility.)

Fields

NoParameters

An empty parameter schema, for tools that take no arguments.

public const string NoParameters = "{\"type\":\"object\",\"properties\":{}}"

Field Value

string

Properties

Description

public string? Description { get; init; }

Property Value

string

Name

public string Name { get; init; }

Property Value

string

ParametersJson

public string ParametersJson { get; init; }

Property Value

string