tools = [{ "type": "function", "function": { "name": "get_quote", "description": "Güncel piyasa fiyatını getirir.", "parameters": { "type": "object", "properties": { "symbol": {"type": "string"}, "market": {"type": "string", "enum": ["bist", "us", "fx", "crypto"]}, }, "required": ["symbol", "market"], "additionalProperties": False, }, },}] messages = [ {"role": "system", "content": "Güncel finans verisi için uygun aracı kullan."}, {"role": "user", "content": "GARAN hissesinin güncel BIST fiyatını getir."},] inputs = tokenizer.apply_chat_template( messages, tools=tools, add_generation_prompt=True, return_tensors="pt",).to(model.device) with torch.inference_mode(): output = model.generate(inputs, max_new_tokens=192, do_sample=False) print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=False))