Skip to main content
Uncalibrated beta
StrikeStrike

Gemini decision tool

functionDeclarations and functionCall handling for strike_decision.

Tool definition

Gemini uses an OpenAPI-subset schema (no additionalProperties):

Python
import strikeflow as strike

tool = strike.strike_decision_tool()
gemini_tools = tool.gemini()
assert gemini_tools["functionDeclarations"][0]["name"] == "strike_decision"

Pass gemini_tools to the Gemini client's tools argument with your Gemini model.

Handle functionCall

Python
import strikeflow as strike

tool = strike.strike_decision_tool()
part = {
    "functionCall": {
        "name": "strike_decision",
        "args": {
            "question": "Should we escalate?",
            "kind": "yes_no",
            "context": "Customer is furious after a third outage.",
        },
    },
}

response_part = tool.handle_gemini_function_call(part, run_id="gem-1")
print(response_part["functionResponse"]["response"]["answer"])

Send response_part back in a user content message as required by the Gemini API.

Gemini decision tool: Strike docs