Repository: langchain
Issue: OpenAI Assistant V2 Runnable parameters, run_metadata does not exist
Labels: 🤖:bug

### Checked other resources

- [x] I added a very descriptive title to this issue.
- [x] I searched the LangChain documentation with the integrated search.
- [x] I used the GitHub search to find a similar question and didn't find it.
- [x] I am sure that this is a bug in LangChain rather than my code.
- [x] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

```python
from langchain_community.agents.openai_assistant import OpenAIAssistantV2Runnable

assistant = OpenAIAssistantV2Runnable.create_assistant(
    name="bug_reproducer",
    instructions='Write "A"',
    check_every_ms=5_000.0,
    tools={},
    model="gpt-4o-mini",
)

message = {
    "content": "A",
    "max_completion_tokens": 10,
    "run_metadata": {"key": "value"},
}

resp = assistant.invoke(message)

print(resp)

```

### Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
  File "[Redacted]/Langchain Tests/reproducer.py", line 17, in <module>
    resp = assistant.invoke(message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[Redacted]/lib/python3.12/site-packages/langchain_community/agents/openai_assistant/base.py", line 383, in invoke
    raise e
  File "[Redacted]/langchain_community/agents/openai_assistant/base.py", line 365, in invoke
    run = self._create_thread_and_run(input, thread)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[Redacted]/langchain_community/agents/openai_assistant/base.py", line 579, in _create_thread_and_run
    run = self.client.beta.threads.create_and_run(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[Redacted]/openai/_utils/_utils.py", line 279, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
TypeError: Threads.create_and_run() got an unexpected keyword argument 'run_metadata'

### Description

Currently the parameters passed down to OpenAI from Langchain are limited to a set of parameters (lately updated in this [PR](https://github.com/langchain-ai/langchain/pull/29207) ).
While testing the usage of the parameters I noticed that one of the parameters already present prior to the PR that could be passed down to openAI is "run_metadata", but verifying on OpenAI library I saw no such parameters, a parameter "metadata" [exists](https://github.com/openai/openai-python/blob/main/src/openai/resources/beta/threads/threads.py#L275) but not the "run_metadata" one.
Going back to [OpenAI 1.1.0](https://github.com/openai/openai-python/blob/v1.1.0/src/openai/resources/beta/threads/threads.py#L201) which introduced assistants I always see "metadata" and not "run_metadata", so that parameter if passed never actually worked).

This could be easily solved by changing the occurences of the parameter "run_metadata" with "metadata" in the allow sets.
But given the current status of the Assistant class and the passage of parameters to OpenAI threads and runs underneath, I was thinking that the current approach with a "set of allowed values" is quite strict, can be edited only via a PR and could break as soon as a change is done on OpenAI python package.

To avoid this kind of issues and keep aligned parameters from OpenAI side and Langchain side the parameters should be passed in a separate object (not in additional keys of the input where we also provide the chat messages) and could be useful to somehow use  for example for `thread_create_and_run` method to use the "TypedDict" [`ThreadCreateAndRunParamsBase`](https://github.com/openai/openai-python/blob/main/src/openai/types/beta/thread_create_and_run_params.py#L38)  present in OpenAI library.



### System Info

python 3.12
pip freeze

aiohappyeyeballs==2.4.4
aiohttp==3.11.11
aiosignal==1.3.2
annotated-types==0.7.0
anyio==4.8.0
attrs==24.3.0
certifi==2024.12.14
charset-normalizer==3.4.1
dataclasses-json==0.6.7
distro==1.9.0
frozenlist==1.5.0
greenlet==3.1.1
h11==0.14.0
httpcore==1.0.7
httpx==0.28.1
httpx-sse==0.4.0
idna==3.10
jiter==0.8.2
jsonpatch==1.33
jsonpointer==3.0.0
langchain==0.3.14
langchain-community==0.3.14
langchain-core==0.3.30
langchain-text-splitters==0.3.5
langsmith==0.2.11
marshmallow==3.25.1
multidict==6.1.0
mypy-extensions==1.0.0
numpy==2.2.1
openai==1.59.8
orjson==3.10.14
packaging==24.2
propcache==0.2.1
pydantic==2.10.5
pydantic-settings==2.7.1
pydantic_core==2.27.2
python-dotenv==1.0.1
PyYAML==6.0.2
requests==2.32.3
requests-toolbelt==1.0.0
sniffio==1.3.1
SQLAlchemy==2.0.37
tenacity==9.0.0
tqdm==4.67.1
typing-inspect==0.9.0
typing_extensions==4.12.2
urllib3==2.3.0
yarl==1.18.3