QianfanChatEndpoint function call not work for agent.
Labels: name: area: agent, name: auto:bug, name: area: models

### System Info

I attempted to create an AI agent bot by utilizing the QianfanChatEndpoint. However, I encountered an issue when I attempted to define a tool for making calls.

Subsequent to consulting with a contributor from the QianfanChatEndpoint project, it was determined that it is imperative to merge the following pull request for resolution: [link to the GitHub pull request](https://github.com/langchain-ai/langchain/pull/11107). Once this fix is implemented, my agent will work fine with Function Call integration.

@hwchase17
@agola11

### Who can help?

@hwchase17
@agola11

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [X] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

```
"""Example demo for agent.py
"""
import os
from typing import Any, Dict, List

from langchain.agents import tool
from langchain.agents.format_scratchpad import format_to_openai_functions
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser
from langchain.chat_models import QianfanChatEndpoint
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder

# from langchain.tools.render import format_tool_to_openai_function

prompt = ChatPromptTemplate.from_messages(
    [
        (
            "system",
            "You are very powerful assistant, but bad at get"
            "today's temperature of location.",
        ),
        ("user", "{input}"),
        MessagesPlaceholder(variable_name="agent_scratchpad"),
    ]
)


@tool
def get_current_weather(location: str) -> str:
    """Returns current temperature of location."""
    return "25" 


tools = [get_current_weather]

if __name__ == "__main__":
    os.environ["QIANFAN_AK"] = "ak"
    os.environ["QIANFAN_SK"] = "sk"
    llm = QianfanChatEndpoint(model="ERNIE-Bot")  # 仅EB支持
    llm_with_tools = llm.bind(
        # functions=functions
        functions=[
            {
                "name": "get_current_weather",
                "description": "获得指定地点的天气",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "省，市名，例如：河北省，石家庄",
                        },
                        "unit": {"type": "string", "enum": ["摄氏度", "华氏度"]},
                    },
                    "required": ["location"],
                },
            }
        ]
    )

    p = {
        "input": lambda x: x["input"],
        "agent_scratchpad": lambda x: format_to_openai_functions(
            x["intermediate_steps"]
        ),
    }
    agent: Dict = p | prompt | llm_with_tools | OpenAIFunctionsAgentOutputParser()

    # main loop
    from langchain.schema.agent import AgentFinish

    intermediate_steps: List[Any] = []
    while True:
        output = agent.invoke(
            {"input": "上海市今天天气如何？", "intermediate_steps": intermediate_steps}
        )

        if isinstance(output, AgentFinish):
            final_result = output.return_values["output"]
            break
        else:
            print(output.tool, output.tool_input)
            tool = {
                "get_current_weather": get_current_weather,
            }[output.tool]
            observation = tool.run(output.tool_input)
            # observation = "{\"temperature\": \"25\", \"description\": \"晴朗\"}"
            intermediate_steps.append((output, observation))
    print("result", final_result)
```

### Expected behavior

上海市今天气温25度