Error: 'OpenAICallbackHandler' object has no attribute 'on_retry'`
Labels: name: area: agent, name: auto:bug

### System Info

**LangChain:** 0.0.248
**Python:**  3.10.10
**OS version:** Linux 5.10.178-162.673.amzn2.x86_64

### Who can help?

@agola11

### Information

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

### Related Components

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

### Reproduction

**Code:**
```
            try:
                with get_openai_callback() as cb:
                    llm_chain = LLMChain(llm=llm, prompt=prompt_main)
                    all_text = str(template) + str(prompt) + str(usescases) + str(transcript)
                    threshold = (llm.get_num_tokens(text=all_text) + 800)
                    dataframe_copy.loc[index, "Total Tokens"] = threshold
                    if int(threshold) <= 4000:
                        chatgpt_output = llm_chain.run({"prompt":prompt, "use_cases_dictionary":usescases, "transcript":transcript})
                        chatgpt_output = text_post_processing(chatgpt_output)
                        dataframe_copy.loc[index, "ChatGPT Output"] = chatgpt_output
                        dataframe_copy.loc[index, "Cost (USD)"] = cb.total_cost
                    else:
                        dataframe_copy.loc[index, "ChatGPT Output"] = " "
                        dataframe_copy.loc[index, "Cost (USD)"] = " "
            except Exception as e:
                dataframe_copy.loc[index, "ChatGPT Output"] = " "
                dataframe_copy.loc[index, "Cost (USD)"] = " "
                continue
```


**Error Message:**
`Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIError: Bad gateway. {"error":{"code":502,"message":"Bad gateway.","param":null,"type":"cf_bad_gateway"}} 502 {'error': {'code': 502, 'message': 'Bad gateway.', 'param': None, 'type': 'cf_bad_gateway'}} {'Date': 'Mon, 31 Jul 2023 20:24:53 GMT', 'Content-Type': 'application/json', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN', 'Referrer-Policy': 'same-origin', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Server': 'cloudflare', 'CF-RAY': '7ef889a50eaca7f3-SYD', 'alt-svc': 'h3=":443"; ma=86400'}.
Error in OpenAICallbackHandler.on_retry callback: 'OpenAICallbackHandler' object has no attribute 'on_retry'`
![bug](https://github.com/langchain-ai/langchain/assets/43797457/9b8025e0-f486-48bb-9d74-fdaa6cef4574)



### Expected behavior

I went through the callback [documentation ](https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.openai_info.OpenAICallbackHandler.html) and yes the "on_retry" method wasn't included over there. So I guess the team needs to modify the core code for OpenAICallbackHandler because it's calling "on_retry" for some reason.