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
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
Properties
Description
public string? Description { get; init; }
Property Value
Name
public string Name { get; init; }
Property Value
ParametersJson
public string ParametersJson { get; init; }