LM-Kit.NET 2026.2.2

Released: Feb 6, 2026

2026.2.2 での更新項目

機能

  • Introduced the LM-Kit.NET.Integrations.ExtensionsAI NuGet package for Microsoft.Extensions.AI integration.
    • Implements IChatClient via LMKitChatClient, enabling LM-Kit.NET models to be used through the standard Microsoft.Extensions.AI abstraction layer.
    • Implements IEmbeddingGenerator<string, Embedding<float>> via LMKitEmbeddingGenerator for embedding generation.
    • Supports non-streaming and streaming chat completions.
    • Supports tool/function calling through automatic bridging of AIFunction/AITool to LMKit's ITool interface.
    • Maps ChatOptions properties include: Temperature, TopP, TopK, MaxOutputTokens, StopSequences, FrequencyPenalty, PresencePenalty, ToolMode, and JSON response format.
    • Reports token usage (input/output/total) and finish reasons in ChatResponse.
    • Provides IServiceCollection extension methods (AddLMKitChatClient and AddLMKitEmbeddingGenerator) for dependency injection.
    • Compatible with the Microsoft.Extensions.AI middleware pipeline (caching, telemetry, function invocation).
    • Targets .NET Standard 2.0, .NET 8.0, .NET 9.0, and .NET 10.0.
  • Added real-time streaming support for orchestrators
    • Added IOrchestrationStreamHandler interface for handling streaming output from multi-agent workflows.
    • Added DelegateOrchestrationStreamHandler with built-in console output handlers.
    • Added OrchestrationStreamToken class with agent context (agent name, step, token type).
    • Added StreamHandler and StreamToolCalls properties to OrchestrationOptions.
    • Added extension methods: StreamAsync, StreamContentAsync, RunStreamingAsync, and RunStreamingToConsoleAsync.
    • Supports all orchestrators: SupervisorOrchestrator, PipelineOrchestrator, ParallelOrchestrator, and RouterOrchestrator.
    • Token types include: Content, Thinking, ToolCall, ToolResult, AgentStarted, AgentCompleted, Delegation.
  • Added the ConversationId property to the ChatHistory class for session correlation across distributed systems.
  • Extended MCP client with complete protocol support.
    • Sampling: Allows MCP servers to request LLM completions from the client.
      • SamplingRequested event and SetSamplingHandler method for handling sampling requests.
      • McpSamplingRequest, McpSamplingResponse, McpSamplingMessage, and McpModelPreferences classes.
    • Roots: Client exposes filesystem boundaries to servers.
      • AddRoot, RemoveRoot, ClearRoots methods for managing roots.
      • RootsRequested event for server root list requests.
      • McpRoot class with FromPath factory method.
    • Elicitation: Servers can request structured user input.
      • ElicitationRequested event and SetElicitationHandler method.
      • McpElicitationRequest and McpElicitationResponse classes.
    • Progress tracking: Track long-running operations.
      • ProgressReceived event for progress notifications.
      • CreateProgressToken, UnregisterProgressToken, and SendProgress methods.
      • McpProgressToken and McpProgressEventArgs classes.
    • Cancellation: Cancel in-progress requests.
      • CancellationReceived event for cancellation notifications.
      • CancelRequest method to send cancellation notifications.
      • McpCancellationEventArgs class.
    • Logging: Structured server-side logging.
      • LogMessageReceived event for log messages.
      • SetLogLevel method to configure minimum log level.
      • McpLogLevel enum and McpLogMessageEventArgs class.
    • Completions: Argument autocompletion for prompts and resources.
      • GetPromptCompletions and GetResourceCompletions methods.
      • McpCompletionResult class.
    • Resource templates: Parameterized URI templates (RFC 6570).
      • GetResourceTemplates and RefreshResourceTemplates methods.
      • McpResourceTemplate class.
    • Resource subscriptions: Real-time resource update notifications.
      • SubscribeToResource and UnsubscribeFromResource methods.
      • ResourceUpdated event and McpResourceUpdatedEventArgs class.
  • Enhanced telemetry with comprehensive OpenTelemetry GenAI semantic conventions support.
    • Added gen_ai.client.token.usage histogram metric with token type tagging (input/output).
    • Added gen_ai.client.operation.duration histogram metric.
    • Added gen_ai.conversation.id span attribute for session correlation.
    • Added gen_ai.response.id span attribute for response identification.
    • Added gen_ai.response.finish_reasons span attribute (stop, length, tool_calls, etc.).
    • Added gen_ai.request.temperature, gen_ai.request.top_p, and gen_ai.request.top_k span attributes.
    • Added gen_ai.request.max_tokens span attribute.
    • Added gen_ai.embeddings.dimension.count span attribute for embedding operations.
    • Agent telemetry now includes gen_ai.agent.name, gen_ai.agent.id, and gen_ai.agent.description.
    • Tool invocation events now include gen_ai.tool.name and gen_ai.tool.call.id.