Repository: langchain
Issue: AzureMLEndpointClient 400 Bad Request with Azure ML Inference Endpoint
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

```
import os
import json
from typing import Optional, List
from langchain_community.llms.azureml_endpoint import AzureMLEndpointClient

class AzureMLLanguageModel:
    """Using AzureML Endpoint to serve as a node in a LangGraph workflow. via AzureMLEndpointClient"""
    
    def __init__(self):
        endpoint_url = "https://models.inference.ai.azure.com"
        api_key = os.getenv("AZURE_ML_API_KEY")
        deployment_name = "Meta-Llama-3.1-70B-Instruct"
        
        if not all([endpoint_url, api_key, deployment_name]):
            raise ValueError("Azure ML configuration is incomplete.")
        
        self.client = AzureMLEndpointClient(
            endpoint_url=endpoint_url,
            endpoint_api_key=api_key,
            deployment_name=deployment_name,
            timeout=500
        )

    def generate(self, prompt: str, temperature: float = 0.7, max_tokens: Optional[int] = None, stop_sequences: Optional[List[str]] = None) -> str:
        """Generate text from prompt."""
        # Adjust the request payload structure
        request_payload = json.dumps({
            "inputs": {
                "input_string": [prompt]
            },
            "parameters": {
                "temperature": temperature,
                "max_tokens": max_tokens or 1000,
                "stop": stop_sequences
            }
        }).encode('utf-8')
        
        print("Request Payload:", request_payload)
        try:
            # Call the Azure ML endpoint
            response_bytes = self.client.call(body=request_payload)
            response_json = json.loads(response_bytes)
            print(response_json)
            # Handle the response based on your model's output format
            # if "choices" in response_json:
            #     return response_json["choices"][0]["text"]
            # elif "output" in response_json:
            #     return response_json["output"]
            # else:
            #     return str(response_json)
                
        except Exception as e:
            print(f"Error generating text: {e}")
            return ""

# Example usage
model = AzureMLLanguageModel()
text = model.generate("Write a poem about AI")
print(text)

```

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

```
    response_bytes = self.client.call(body=request_payload)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\Learning\researcher agent\.venv\Lib\site-packages\langchain_community\llms\azureml_endpoint.py", line 57, in call
    response = urllib.request.urlopen(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kolad\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kolad\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kolad\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "C:\Users\kolad\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kolad\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "C:\Users\kolad\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
```

### Description


When attempting to use the `AzureMLEndpointClient` with Azure ML's inference endpoint (models.inference.ai.azure.com), I'm consistently receiving a 400 Bad Request error. The client seems to be missing some required configuration or payload formatting specific to Azure ML's inference endpoints.

Current Behavior
- Sending requests to Azure ML inference endpoint results in 400 Bad Request

i have tried and successfully gotten back response from that endpoint using the Azure inferance lib, i am just trying to convert that into a langchain suitable node, for a project i am working on, 

### System Info

> OS Version:  10.0.27754
> Python Version:  3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]

Package Information
-------------------
> langchain_core: 0.3.21
> langchain: 0.3.9
> langchain_community: 0.3.8
> langsmith: 0.1.147
> langchain_text_splitters: 0.3.2
> langgraph_sdk: 0.1.40

Optional packages not installed
-------------------------------
> langserve

Other Dependencies
------------------
> aiohttp: 3.11.9
> async-timeout: Installed. No version info available.
> dataclasses-json: 0.6.7
> httpx: 0.28.0
> httpx-sse: 0.4.0
> jsonpatch: 1.33
> langsmith-pyo3: Installed. No version info available.
> numpy: 1.26.4
> orjson: 3.10.12
> packaging: 24.2
> pydantic: 2.10.2
> pydantic-settings: 2.6.1
> PyYAML: 6.0.2
> requests: 2.32.3
> requests-toolbelt: 1.0.0
> SQLAlchemy: 2.0.35
> tenacity: 9.0.0
> typing-extensions: 4.12.2