Questa pagina è in inglese.
Gemini decision tool
Call strike-1 from a Gemini functionCall handler with strike-ai.
strike-ai does not ship a Gemini functionDeclarations helper. Prefer the MCP server when your host supports MCP. From a functionCall handler, call Client.decide and return a function response part.
Python
from strike_ai import Client
client = Client()
def handle_function_call(part: dict) -> dict:
args = part["functionCall"]["args"]
kind = args["kind"]
question = args["question"]
options = args.get("options")
context = args.get("context") or ""
if kind == "yes_no":
q = {"type": "noul", "instructions": question}
elif kind == "score":
q = {"type": "score", "instructions": question, "criteria": list(options or [])}
else:
q = {
"type": "choice",
"instructions": question,
"criteria": {str(o): None for o in (options or [])},
}
answer = client.decide(context or question, {"answer": q})["answers"]["answer"]
return {
"functionResponse": {
"name": part["functionCall"]["name"],
"response": answer,
}
}Declare a function named strike_decision (or your own name) with the same argument fields as on the MCP page.