For example
import chatlas as ctl
from pydantic import BaseModel, Field
chat = ctl.ChatAuto(provider="openai")
class MyParams(BaseModel):
n: int = Field(..., description="Number of items to list", alias="_n")
def list_items(_n: int):
return [f"Item {i + 1}" for i in range(_n)]
chat.register_tool(list_items, model=MyParams)
ValueError: `model` fields must match tool function parameters exactly. Fields found in one but not the other: {'n', '_n'}
Note that Field(alias=...) is the only way to create a BaseModel where the field starts with _*. This is, in turn, a problem for shinychat's tool calling UI where _intent is a special parameter.