Table of Contents

Class FunctionCallExtensions

Namespace
GenerativeAI
Assembly
GenerativeAI.dll

Provides extension methods for working with function call-related types.

public static class FunctionCallExtensions
Inheritance
FunctionCallExtensions
Inherited Members

Methods

ToFunctionCallContent(FunctionResponse?)

Converts a nullable FunctionResponse into a Content object configured with the role "user" (as the official SDKs send function results) and containing the response as a single part of the content.

public static Content ToFunctionCallContent(this FunctionResponse? responseContent)

Parameters

responseContent FunctionResponse

A nullable FunctionResponse representing the function response to be converted into content.

Returns

Content

A Content object with the "user" role and a single part containing the provided function response.

ToFunctionCallContent(List<FunctionResponse>)

Converts a nullable FunctionResponse into a Content object configured with the role "user" (as the official SDKs send function results) and containing the provided function responses.

public static Content ToFunctionCallContent(this List<FunctionResponse> responses)

Parameters

responses List<FunctionResponse>

A list of FunctionResponse objects to be converted into content.

Returns

Content

A Content object with the "user" role and parts containing the provided function responses.