Table of Contents

Class FunctionDeclaration

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Declaration of a function that can be used as a Tool.

public class FunctionDeclaration
Inheritance
FunctionDeclaration
Inherited Members
Extension Methods

Properties

Behavior

Optional. Defines the function behavior. Defaults to BLOCKING.

[JsonPropertyName("behavior")]
public Behavior? Behavior { get; set; }

Property Value

Behavior?

Description

Optional. Description of the function.

[JsonPropertyName("description")]
public string? Description { get; set; }

Property Value

string

Name

Required. The name of the function.

[JsonPropertyName("name")]
public string Name { get; set; }

Property Value

string

Parameters

Optional. Defines the parameters accepted by the function.

[JsonPropertyName("parameters")]
public Schema? Parameters { get; set; }

Property Value

Schema

ParametersJsonSchema

Optional. Alternative to parameters using JSON Schema. If set, parameters must be omitted.

[JsonPropertyName("parametersJsonSchema")]
public JsonNode? ParametersJsonSchema { get; set; }

Property Value

JsonNode

Response

Optional. Defines the expected response schema for the function.

[JsonPropertyName("response")]
public Schema? Response { get; set; }

Property Value

Schema

ResponseJsonSchema

Optional. Alternative to response using JSON Schema. If set, response must be omitted.

[JsonPropertyName("responseJsonSchema")]
public JsonNode? ResponseJsonSchema { get; set; }

Property Value

JsonNode

See Also