Skip to content

Wrapper for Non Tool-Calling Models to Enable Auto Function Invocation | python #12150

Closed as not planned
@Vizhy

Description

@Vizhy

name: Wrapper for Non Tool-Calling Models to Enable Auto Function Invocation
about:
A wrapper to simulate tool-calling functionality for models that lack native support.

Context Preparation:
From the ongoing request, the wrapper creates a context.tool_calling object containing request.functions, request.function_call_method, and related info about formatting the response for function calling.

Request Encoding:
The wrapper injects context.tool_calling into request.messages with appropriate AuthorRole to embed tool call instructions into the prompt

Response Parsing:
The wrapper parses the combined model response—which contains both standard reply and simulated tool call data—and splits it into separate objects, matching the structure of native tool-calling model responses before forwarding to Semantic Kernel.

Purpose:
This approach extends Semantic Kernel’s usability to models beyond OpenAI and Azure OpenAI, which currently are the only ones with native tool calling support and the only ones capable of fully leveraging Semantic Kernel’s orchestration capabilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions