I’m looking for some help with a graph checkpointer. I’m using init_chat_model so that users can call any provider and model they choose. I’m passing in specifics with RunnableConfig using options like api_key or base_url. The problem comes when I add {"thread_id":"1"} to the config when invoking the compiled graph. More specifically, this error comes from when I end up calling an Anthropic model I get
File "venv/lib/python3.12/site-packages/langchain_anthropic/chat_models.py", line 1316, in _create
return self._client.messages.create(**payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.12/site-packages/anthropic/_utils/_utils.py", line 283, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
TypeError: Messages.create() got an unexpected keyword argument 'thread_id'
It seems like the thread_id is being passed down to ChatAnthropic and it doesn’t like that. It seems like config passed when invoking the graph is getting passed down to my “assistant” node that is invoking the LLM.
I thought about passing things like api_key or base_url as a **kwargs to init_chat_model() instead of in the RunnableConfig but that doesn’t seem to resolve the issue.