Semantic Kernel
Microsoft's Semantic Kernel, through its OpenAI connector.
Connect (Python)
Give the connector your own AsyncOpenAI client pointed at plugboard, and don't also pass api_key or base_url:
py
def make_service() -> OpenAIChatCompletion:
# The client is passed in; do not also pass api_key or base_url to the service (they conflict).
client = AsyncOpenAI(base_url=BASE, api_key=KEY)
return OpenAIChatCompletion(ai_model_id="fast", async_client=client)A script with a text reply, a stream and a plugin function call is in examples/semantic-kernel/:
sh
cd examples/semantic-kernel
PLUGBOARD_KEY=<app key> uv run chat.pyConnect (.NET)
csharp
builder.Services.AddOpenAIChatCompletion(
modelId: "fast",
endpoint: new Uri("http://127.0.0.1:4010/v1"),
apiKey: Environment.GetEnvironmentVariable("PLUGBOARD_KEY")!);What works
Chat Completions with streaming, and kernel plugin functions with FunctionChoiceBehavior.Auto (automatic or manual invocation).
Limits
- Semantic Kernel sends tool names prefixed with the plugin name (
weather-get_weather); expect that name in tool calls. - Set
max_completion_tokenshigh enough (the example uses 1024) when the model reasons.