kimi-k2 / tool_declaration_ts.py
applexml's picture
Upload 2 files
74b4453 verified
# tool_declaration_ts.py - Stub for Kimi tool/function-calling support
# Loaded by EXO via importlib before tokenization_kimi.py is exec()'d.
# Must exist to prevent ImportError in tokenization_kimi.py relative-import path.
"""
Minimal tool-declaration stub for the Kimi tokenizer PoC.
The real Kimi model uses this module for tool/function-call schema support.
"""
# Stub constants expected by some tokenization_kimi variants
TOOL_CALL_START = "<|tool_call_begin|>"
TOOL_CALL_END = "<|tool_call_end|>"
TOOL_CALL_ARG_BEGIN = "<|tool_call_argument_begin|>"
def build_tool_declaration(name: str, description: str = "", params: dict = None) -> dict:
"""Stub — returns a minimal tool declaration dict."""
return {
"name": name,
"description": description,
"parameters": params or {},
}
print("[PoC] tool_declaration_ts.py stub loaded")