Skip to main content

module  pixeltable.functions.anthropic

Pixeltable UDFs that wrap various endpoints from the Anthropic API. In order to use them, you must first pip install anthropic and configure your Anthropic credentials, as described in the Working with Anthropic tutorial.

func  invoke_tools()

Signature
Converts an Anthropic response dict to Pixeltable tool invocation format and calls tools._invoke().

udf  messages()

Signature
Create a Message. Equivalent to the Anthropic messages API endpoint. For additional details, see: https://docs.anthropic.com/en/api/messages Request throttling: Uses the rate limit-related headers returned by the API to throttle requests adaptively, based on available request and token capacity. No configuration is necessary. Requirements:
  • pip install anthropic
Parameters:
  • messages (pxt.Json[(Json): Input messages.
  • model (Any): The model that will complete your prompt.
  • model_kwargs (Any): Additional keyword args for the Anthropic messages API. For details on the available parameters, see: https://docs.anthropic.com/en/api/messages
  • tools (Any): An optional list of Pixeltable tools to use for the request.
  • tool_choice (Any): An optional tool choice configuration.
Returns:
  • Message: The Anthropic Message object as a dictionary. With thinking enabled, the first content block is a 'thinking' block.
Examples: Add a computed column that applies the model claude-sonnet-5-5 to an existing Pixeltable column tbl.prompt of the table tbl:
Add a computed column with the generated text, from the 'text' content block:
Last modified on December 4, 2026