import torchfrom transformers import AutoModelForCausalLM, AutoTokenizer model_id = "flintglass/GPT-OSS-20B-PrismAgent"tok = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto") tools = [{ "type": "function", "function": { "name": "get_weather", "description": "Get current weather for a city", "parameters": { "type": "object", "properties": {"city": {"type": "string", "description": "City name"}}, "required": ["city"], }, },}]messages = [{"role": "user", "content": "What is the weather in Tokyo right now?"}]prompt = tok.apply_chat_template( messages, tools=tools, tokenize=False, add_generation_prompt=True, reasoning_effort="low")inputs = tok(prompt, return_tensors="pt").to(model.device)out = model.generate(**inputs, max_new_tokens=256, do_sample=False)print(tok.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=False))