LangChain/Tools
Intermediate8 min

Provider Extras & Advanced Tools

The extras attribute (v1.2), Anthropic programmatic tool calling, OpenAI strict schemas, and advanced tool patterns.

Quick Reference

  • extras attribute (v1.2) exposes provider-specific features without breaking the unified API
  • Anthropic: cache_control, tool_choice='any', thinking={type, budget_tokens}
  • OpenAI: strict=True on bind_tools(), parallel_tool_calls=False, seed for determinism
  • Gemini: thinking_budget, include_thoughts=True, safety_settings per harm category
  • Use extras sparingly — they tie your code to a specific provider

Provider Extras at a Glance

ProviderExtraWhat it does
Anthropiccache_controlCache tool definitions or messages to reduce cost and latency on repeated calls
Anthropictool_choiceForce the model to always call a specific tool, or disable tool calling entirely
Anthropicextended thinkingLet Claude reason internally before responding — improves complex problem solving
Anthropicbash / text editor toolsNative Claude tools for running shell commands and editing files
OpenAIstrict: TrueGuarantee the model's output matches your schema exactly — no hallucinated or missing fields
OpenAIparallel_tool_callsControl whether the model can call multiple tools at the same time
OpenAIseedGet deterministic outputs for the same input — useful for testing
Geminisafety_settingsAdjust content safety thresholds per category
Geminithinking_configEnable extended thinking on Gemini 2.5 models
Geminicontext_cacheCache large content (documents, long prompts) across requests to save tokens