The error comes from the way you defined llm
. You accidentally added a comma at the end, so llm
becomes a tuple instead of a ChatOpenAI
instance. Just delete the comma at the end.
llm = ChatOpenAI(model="openai/gpt-4o-mini",openai_api_base="https://openrouter.ai/api/v1", temperature=0)