Zum Hauptinhalt springen

LlmQueryNodeConfiguration

Namespace: Meshmakers.Octo.MeshAdapter.Nodes.Transform

Queries an LLM with pipeline data, optionally with MCP tools. Provider-agnostic by design; the providers available today are listed in LlmProvider. Settings that fail their rule (response format, temperature, tool-result cap) are refused when the pipeline definition is read. The provider's endpoint is not a node setting: it comes with the API key from the AiConfiguration (its optional sealed providerEndpoint: URL and key), so the key and the place it is sent to are configured together.

public record LlmQueryNodeConfiguration : SourceTargetPathNodeConfiguration, INodeConfiguration, IEquatable<NodeConfiguration>, ITargetPathNodeConfiguration, IEquatable<TargetPathNodeConfiguration>, IPathNodeConfiguration, IEquatable<SourceTargetPathNodeConfiguration>, IEquatable<LlmQueryNodeConfiguration>

Inheritance Object → NodeConfiguration → TargetPathNodeConfiguration → SourceTargetPathNodeConfiguration → LlmQueryNodeConfiguration
Implements INodeConfiguration, IEquatable<NodeConfiguration>, ITargetPathNodeConfiguration, IEquatable<TargetPathNodeConfiguration>, IPathNodeConfiguration, IEquatable<SourceTargetPathNodeConfiguration>, IEquatable<LlmQueryNodeConfiguration>

Remarks:

The configuration shape is lifted from the LlmQuery prototype by Philipp Schwaab and carries the options of AnthropicAiQuery@1, except the inline API key and the old delegation flag.

Fields​

DefaultSystemPrompt​

The system prompt of a node that sets none and uses no prompt template.

public static string DefaultSystemPrompt;

DefaultMaxToolResultChars​

The cap of LlmQueryNodeConfiguration.MaxToolResultChars when none is set.

public static int DefaultMaxToolResultChars;

Properties​

Provider​

LLM provider. Anthropic (default) uses the Anthropic Messages API; OpenAiCompatible uses the OpenAI Chat Completions API and needs the providerEndpoint of the AiConfiguration.

public LlmProvider Provider { get; set; }

Property Value​

LlmProvider

ApiKeyConfigurationName​

Well-known name of the AiConfiguration entity that holds the API key and, optionally, the sealed provider endpoint (providerEndpoint: URL and its own key), which both providers use and OpenAiCompatible requires. Only Anthropic falls back to https://api.anthropic.com with apiKey when it is unset. An aiModel, maxTokens, temperature or mcpServerUrl set there wins over the node's own value.

public string ApiKeyConfigurationName { get; set; }

Property Value​

String

Model​

Model identifier as the provider expects it (on Microsoft Foundry and Azure OpenAI the deployment name). A prompt template's model and the AiConfiguration's aiModel win over it.

public string Model { get; set; }

Property Value​

String

PromptTemplateName​

Well-known name of a System.Ai/AiPromptTemplate that supplies system prompt, question, model, temperature and maxTokens. Inline question and systemPrompt override its texts.

public string PromptTemplateName { get; set; }

Property Value​

String

Question​

The task or question for the model. Wins over the user template of a prompt template.

public string Question { get; set; }

Property Value​

String

SystemPrompt​

System prompt setting role and rules for the model. Null without a prompt template = the default system prompt; an empty one sends no system prompt.

public string SystemPrompt { get; set; }

Property Value​

String

MaxTokens​

Maximum tokens in the response (default 4096). A prompt template or the AiConfiguration wins.

public int MaxTokens { get; set; }

Property Value​

Int32

Temperature​

Sampling temperature (0.0-1.0). Null (default) = not sent, the model's own default applies. A prompt template or the AiConfiguration wins. A model that rejects the temperature is asked once more without it, with a warning. A value outside 0.0-1.0 is refused.

public Nullable<double> Temperature { get; set; }

Property Value​

Nullable<Double>

CacheSource​

Sends the main content (path) as its own block with a prompt-cache breakpoint. Anthropic only; no effect with OpenAiCompatible.

public bool CacheSource { get; set; }

Property Value​

Boolean

DataPaths​

Additional data paths whose values are appended to the prompt as context.

public String[] DataPaths { get; set; }

Property Value​

String[]

ConversationHistoryPath​

Path to a conversation history array of {role, content} entries, included as previous messages for multi-turn calls.

public string ConversationHistoryPath { get; set; }

Property Value​

String

ResponseFormat​

Response format: "json" (default) or "text". Any other value is refused.

public string ResponseFormat { get; set; }

Property Value​

String

IncludeRawResponse​

Whether to additionally write the raw model response to RawResponseOutputPath.

public bool IncludeRawResponse { get; set; }

Property Value​

Boolean

RawResponseOutputPath​

Output path for the raw model response (used when IncludeRawResponse is true).

public string RawResponseOutputPath { get; set; }

Property Value​

String

JsonFormatSample​

Optional example JSON appended to the prompt to guide response shape and field semantics. Empty = no example.

public string JsonFormatSample { get; set; }

Property Value​

String

JsonSchema​

Optional JSON Schema enforced server-side via the provider's structured outputs (constrained decoding) and validated on the answer. Requires a model with structured-output support.

public string JsonSchema { get; set; }

Property Value​

String

MaxJsonRepairAttempts​

Bounded repair for answers that violate the JSON schema: up to this many follow-up calls (default 1, capped at 2, 0 = off), each resending only the broken output plus the violations - never the original context.

public int MaxJsonRepairAttempts { get; set; }

Property Value​

Int32

UsageOutputPath​

Path the summed token usage of every call (tool rounds and repair calls included) is written to.

public string UsageOutputPath { get; set; }

Property Value​

String

ContinueOnError​

Whether to continue the pipeline if the LLM call fails.

public bool ContinueOnError { get; set; }

Property Value​

Boolean

McpServerUrl​

MCP server URL; the AiConfiguration's mcpServerUrl wins over it. Tools are loaded from {mcpServerUrl}/{tenantId}/mcp. Without an identity (mcpServiceAccountConfigName) no MCP call is made.

public string McpServerUrl { get; set; }

Property Value​

String

McpServiceAccountConfigName​

Well-known name of the ServiceAccountConfiguration the MCP calls authenticate with.

public string McpServiceAccountConfigName { get; set; }

Property Value​

String

Identity​

Whose identity the MCP calls run on: ServiceAccount (default) or Caller, which exchanges the caller's token for a delegated one (fail-closed; needs a trigger that carries a caller token).

public NodeExecutionIdentity Identity { get; set; }

Property Value​

NodeExecutionIdentity

McpToolNames​

Optional tool allowlist. Null/empty = all tools of the MCP server are offered. Restricting tools cuts prompt tokens and keeps the model on task.

public String[] McpToolNames { get; set; }

Property Value​

String[]

MaxToolRounds​

Maximum tool-call rounds before the query fails (default 10). No effect when no MCP tools are configured.

public int MaxToolRounds { get; set; }

Property Value​

Int32

MaxToolResultChars​

Maximum characters (UTF-16 code units) of a single MCP tool result passed back to the model (default 50000, at least 1). Longer results are cut and marked as truncated.

public Nullable<int> MaxToolResultChars { get; set; }

Property Value​

Nullable<Int32>

Path​

public string Path { get; set; }

Property Value​

String

TargetPath​

public string TargetPath { get; set; }

Property Value​

String

TargetValueWriteMode​

public TargetValueWriteModes TargetValueWriteMode { get; set; }

Property Value​

TargetValueWriteModes

TargetValueKind​

public ValueKinds TargetValueKind { get; set; }

Property Value​

ValueKinds

DocumentMode​

public DocumentModes DocumentMode { get; set; }

Property Value​

DocumentModes

Description​

public string Description { get; set; }

Property Value​

String

Constructors​

LlmQueryNodeConfiguration()​

public LlmQueryNodeConfiguration()