Files
langchain/libs/partners/openai
Mason Daugherty 3b48f48458 fix(core): use asyncio.get_running_loop() in async contexts (#38157)
Closes #35726

---

Several async functions called `asyncio.get_event_loop()`, which has
been deprecated since Python 3.10. Inside `async def` bodies the loop is
always running, so `asyncio.get_running_loop()` is the correct,
warning-free replacement with no behavior change.

This updates the call in `_ahandle_event_for_handler` (core callbacks),
`_render_mermaid_using_pyppeteer` (core runnables graph), and
`async_api_key_wrapper` (`langchain-openai` client utils). Users running
on modern Python no longer see `DeprecationWarning`s from these paths.

Made by [Open SWE](https://openswe.vercel.app)

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-06-22 22:26:16 -04:00
..
2026-06-22 18:42:29 -04:00
2026-06-22 18:42:29 -04:00

langchain-openai

PyPI - Version PyPI - License PyPI - Downloads Twitter

Looking for the JS/TS version? Check out LangChain.js.

Quick Install

uv add langchain-openai

🤔 What is this?

This package contains the LangChain integrations for OpenAI through their openai SDK.

📖 Documentation

For full documentation, see the API reference. For conceptual guides, tutorials, and examples on using these classes, see the LangChain Docs.

📕 Releases & Versioning

See our Releases and Versioning policies.

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.

Resources

  • LangChain Academy — comprehensive, free courses on LangChain libraries and products, made by the LangChain team
  • Code of Conduct — community guidelines and standards