File size: 878 Bytes
74b4453 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # 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")
|