If you want to use tools with your model, you need to use ChatOpenAI instead of OpenAI. Update your code as follows:
ChatOpenAI
OpenAI
from langchain_openai import ChatOpenAI llm = ChatOpenAI(temperature=0, api_key=openai_api_key, model="gpt-4o-mini")