Vai al contenuto principale
Panoramica

Questa pagina è in inglese.

OpenAI decision tool

Call strike-1 from an OpenAI tool handler with strike-ai.

strike-ai does not ship an OpenAI tool schema helper. Prefer the MCP server when your host supports MCP. From a Chat Completions or Responses tool handler, call Client.decide (or POST /v1/systemone) and return the JSON as the tool result.

Python
from strike_ai import Client

client = Client()

def handle_strike_decision(arguments: dict) -> dict:
    kind = arguments["kind"]
    question = arguments["question"]
    options = arguments.get("options")
    context = arguments.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 [])},
        }
    return client.decide(context or question, {"answer": q})["answers"]["answer"]

Register a tool named strike_decision (or your own name) with fields question, kind, options, and context, then pass the handler return value back to the model as the tool message content.

Strike AI | OpenAI decision tool