Table of Contents

Method Clone

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

Clone()

Creates a copy of this options instance.

public AgentExecutionOptions Clone()

Returns

AgentExecutionOptions

A new AgentExecutionOptions with the same values.

Examples

Creating option variants:

using LMKit.Model;
using LMKit.Agents;

// Base configuration for chat var baseOptions = new AgentExecutionOptions { Timeout = TimeSpan.FromSeconds(30), MaxCompletionTokens = 500 };

// Quick variant with shorter timeout var quickOptions = baseOptions.Clone(); quickOptions.Timeout = TimeSpan.FromSeconds(10); quickOptions.MaxCompletionTokens = 100;

// Detailed variant with longer limits var detailedOptions = baseOptions.Clone(); detailedOptions.Timeout = TimeSpan.FromMinutes(2); detailedOptions.MaxCompletionTokens = 2000;

using var model = new LM("path/to/model.gguf"); var agent = new Agent(model);

// Use different options for different queries var quickAnswer = agent.Run("What is 2+2?", quickOptions); var detailedAnswer = agent.Run("Explain calculus.", detailedOptions);

Remarks

Use this method when you need to create variations of an existing options configuration.

Share