Zum Hauptinhalt springen
Unkalibrierte Beta
StrikeStrike

Decision tools overview

The strike_decision tool for LLM agents across OpenAI, Anthropic, Gemini, and MCP.

strike.strike_decision_tool() exposes a single tool name, strike_decision, that delegates choices to strike-1. One object renders provider-specific schemas and executes tool calls.

Create the tool

Python
import strikeflow as strike

tool = strike.strike_decision_tool(min_confidence=0.7)

Schema (all providers)

Required JSON fields:

FieldTypeNotes
questionstringDecision phrased as a question
kindchoice | score | yes_no
optionsstring[] or nullRequired for choice; ordered levels for score; omit for yes_no
contextstring or nullFacts for the decision (conversation can be added via messages= on handle)

Execution

MethodReturns
handle(arguments, messages=..., run_id=..., host=...)dict (never raises; errors use {"error": "..."})
ahandle(...)async dict

Provider-specific helpers build the message shape your host expects:

ProviderDefinitionHandler
OpenAI Chat Completions.openai(strict=False)handle_openai_tool_call
OpenAI Responses.openai_responses()handle_responses_function_call
Anthropic Messages.anthropic()handle_anthropic_tool_use
Gemini.gemini()handle_gemini_function_call
MCP.mcp()used by python -m strikeflow.mcp

Async twins: ahandle_openai_tool_call, ahandle_responses_function_call, ahandle_anthropic_tool_use, ahandle_gemini_function_call.

Optional framework adapters

These live in extras (not in core imports):

FrameworkExtraEntry point
LangChainlangchaintool.langchain() or integrations.langchain.strike_tool
LangGraphlanggraphstrike_decision_node, strike_router
CrewAIcrewaiintegrations.crewai.strike_crewai_tool()
OpenAI Agents SDKagentstool.openai_agents()

Other providers: call tool.handle(...) with the parsed arguments.

Decision tools overview: Strike docs