This code snippet shows you how to dynamically deploy user-defined TS function tool calls using Modal.
deployment_example.py
: Code for deploying new Modal App.server
: Lightweight Node server that handles requests for user tool calls. Users can modify function definitions inuser-functions.ts
.app.py
: App logic that's deployed.
tool_call_example.py
: After deploying, run this script to invoke deployed tool.
pip install modal
python deployment_example.py
--> deploy the Modal App that deploys the Node shim serverpython tool_call_example.py
--> call your deployed Function!