taruvi-functions
Installation
SKILL.md
Taruvi functions (Python SDK)
Write Python code that runs inside Taruvi's serverless function runtime. This skill covers the function signature, the SDK module surface, the immutable auth pattern, runtime detection, and the execution model (sync vs async).
This skill is for the body of a deployed function. If you're registering a function's metadata (name, description, environment), switch to taruvi-backend-provisioning and use manage_function. If you're building the frontend that triggers the function, switch to taruvi-refine-frontend.
Core principles
- The function signature is fixed. Always
def main(params, user_data, sdk_client). Don't rename parameters; the runtime binds them positionally. sdk_clientis already authenticated with the calling user's context. Do not re-authenticate for the common case. Only callsignInWithTokenwhen you need to act as a different principal.- Immutable auth.
signInWithToken()returns a new client. Reassigning the variable is mandatory. Mutating operations on the original client won't reflect the new auth. - Use
log(), notprint().log()routes to Taruvi's structured logging and shows up in the function's invocation record.print()goes to stdout, which is harder to surface. - Prefer sync in function bodies. The runtime auto-detects mode; async is only worth it when you're fanning out concurrent I/O. Sync is simpler and faster for the common case.