### 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

As a dummy example, let's try to stop a model using exclamation marks. 

Using tiktoken, I can identify that the token for '!' is '0':

![image](https://github.com/langchain-ai/langchain/assets/46486498/c7f2fc04-b89d-476f-9f40-2f08529e961b)

```
from langchain_openai import ChatOpenAI
logit_bias_dict = {'0': -100}

llm = ChatOpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    model="gpt-4o",
    temperature=0,
    model_kwargs={"logit_bias":logit_bias_dict},
)

messages = [("human", "Write me a furious message as though you are screaming")]
response = llm.invoke(messages) 
response.content
```

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

I get the following response, still with exclamation marks:

"ARE YOU KIDDING ME RIGHT NOW?! I CAN'T BELIEVE YOU WOULD DO SOMETHING SO ABSURD AND THOUGHTLESS!! THIS IS COMPLETELY UNACCEPTABLE AND I AM BEYOND FURIOUS!! HOW COULD YOU POSSIBLY THINK THIS WAS A GOOD IDEA?! YOU HAVE CROSSED THE LINE AND I AM DONE PUTTING UP WITH THIS NONSENSE!! GET YOUR ACT TOGETHER IMMEDIATELY OR THERE WILL BE SERIOUS CONSEQUENCES!!"

### Description

As you can see, it is not having the desired effect. I have also tried passing the logit bias dictionary to llm.invoke instead:

```
from langchain_openai import ChatOpenAI

logit_bias_dict = {'0': -100}

llm = ChatOpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    model="gpt-4o",
    temperature=0,

)

messages = [("human", "Write me a furious message as though you are screaming")]
response = llm.invoke(messages, **{"logit_bias": logit_bias_dict}) 
response.content
```

which also has no effect. Conversely this works fine with OpenAI directly.

I have also tried using 0 instead of '0' (i.e. an integer instead of a string) - also no difference.

### System Info

langchain                 0.2.1
langchain-community       0.2.1
langchain-core            0.2.3
langchain-openai          0.1.8
langchain-text-splitters  0.2.0


MacOS 

Python 3.12.3
Logit Bias is not having the desired effect when using ChatOpenAI - it doesn't seem like it's propagating to OpenAI call properly
This is a GitHub Issue
repo:langchain
owner:langchain-ai
Title : Logit Bias is not having the desired effect when using ChatOpenAI - it doesn't seem like it's propagating to OpenAI call properly
Issue date:

--- start body ---
### 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

As a dummy example, let's try to stop a model using exclamation marks. 

Using tiktoken, I can identify that the token for '!' is '0':

![image](https://github.com/langchain-ai/langchain/assets/46486498/c7f2fc04-b89d-476f-9f40-2f08529e961b)

```
from langchain_openai import ChatOpenAI
logit_bias_dict = {'0': -100}

llm = ChatOpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    model="gpt-4o",
    temperature=0,
    model_kwargs={"logit_bias":logit_bias_dict},
)

messages = [("human", "Write me a furious message as though you are screaming")]
response = llm.invoke(messages) 
response.content
```

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

I get the following response, still with exclamation marks:

"ARE YOU KIDDING ME RIGHT NOW?! I CAN'T BELIEVE YOU WOULD DO SOMETHING SO ABSURD AND THOUGHTLESS!! THIS IS COMPLETELY UNACCEPTABLE AND I AM BEYOND FURIOUS!! HOW COULD YOU POSSIBLY THINK THIS WAS A GOOD IDEA?! YOU HAVE CROSSED THE LINE AND I AM DONE PUTTING UP WITH THIS NONSENSE!! GET YOUR ACT TOGETHER IMMEDIATELY OR THERE WILL BE SERIOUS CONSEQUENCES!!"

### Description

As you can see, it is not having the desired effect. I have also tried passing the logit bias dictionary to llm.invoke instead:

```
from langchain_openai import ChatOpenAI

logit_bias_dict = {'0': -100}

llm = ChatOpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    model="gpt-4o",
    temperature=0,

)

messages = [("human", "Write me a furious message as though you are screaming")]
response = llm.invoke(messages, **{"logit_bias": logit_bias_dict}) 
response.content
```

which also has no effect. Conversely this works fine with OpenAI directly.

I have also tried using 0 instead of '0' (i.e. an integer instead of a string) - also no difference.

### System Info

langchain                 0.2.1
langchain-community       0.2.1
langchain-core            0.2.3
langchain-openai          0.1.8
langchain-text-splitters  0.2.0


MacOS 

Python 3.12.3
--- end body ---
