Skip to main content
All docs
V25.2
  • AIChatFunctionCall Class

    Defines details of an AI-invoked function.

    Namespace: DevExpress.AIIntegration.Blazor.Chat

    Assembly: DevExpress.AIIntegration.Blazor.Chat.v25.2.dll

    NuGet Package: DevExpress.AIIntegration.Blazor.Chat

    Declaration

    public class AIChatFunctionCall

    Remarks

    The AIChatFunctionCall class encapsulates information about an AI-invoked function. Use class properties to access call details and execution results from the MessageContentTemplate context.

    The following code snippet appends information about each invoked function to the AI chat response:

    @using DevExpress.AIIntegration.Blazor.Chat
    @using DevExpress.AIIntegration.Tools
    @inject AIToolsContextContainer aiToolsContextContainer
    
    <DxAIChat>
        <MessageContentTemplate>
            @context.Content
            @if(context.FunctionCalls.Count > 0) {
                <ul>
                    @foreach(var functionCall in context.FunctionCalls) {
                        <li>
                            Called function: <b>@functionCall.Request.Name</b><br />
                            Return value: <b>@functionCall.Result.Result.ToString()</b>
                        </li>
                    }
                </ul>
            }
        </MessageContentTemplate>
    </DxAIChat>
    
    @code {
        protected override void OnAfterRender(bool firstRender) {
            if(firstRender) {
                var context = new AIToolsContextBuilder()
                    .WithToolMethods(MyAITools.Greet, MyAITools.AddNumbers)
                    .Build();
                aiToolsContextContainer.Add(context);
            }
        }
    }
    

    AI Function Call

    Inheritance

    Object
    AIChatFunctionCall
    See Also