[PR #1160] [MERGED] docs: Adding in Docs for using Azure Default Credential Callable with OpenAI #1341

Closed
opened 2026-02-17 17:22:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1160
Author: @marlenezw
Created: 10/28/2025
Status: Merged
Merged: 10/28/2025
Merged by: @ccurme

Base: mainHead: openai_callable_docs


📝 Commits (7)

  • 200d8a4 updating docs
  • 839e15b fixing linting
  • ef84516 Apply suggestion from @Copilot
  • 51a44a9 Apply suggestion from @Copilot
  • aa6065e remoing stray ellipses
  • 1333acb Update src/oss/python/integrations/text_embedding/openai.mdx
  • ee385eb cosmetic changes

📊 Changes

3 files changed (+199 additions, -11 deletions)

View changed files

📝 src/oss/python/integrations/chat/azure_chat_openai.mdx (+8 -4)
📝 src/oss/python/integrations/chat/openai.mdx (+96 -7)
📝 src/oss/python/integrations/text_embedding/openai.mdx (+95 -0)

📄 Description

Overview

This PR adds documentation for the new callable API key feature in ChatOpenAI, OpenAI, and OpenAIEmbeddings classes, introduced in langchain-ai/langchain#33532.

The documentation covers:

  • Using ChatOpenAI and OpenAIEmbeddings with Azure OpenAI's new v1 API endpoints
  • Microsoft Entra ID (formerly Azure AD) authentication with automatic token refresh
  • Custom callable API keys for dynamic key retrieval (sync and async)

Type of change

Type: Update existing documentation

Related issues/PRs

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using make lint_md
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed (not applicable - added sections to existing pages)
  • I have gotten approval from the relevant reviewers
  • (Internal team members only / optional) I have created a preview deployment using the Create Preview Branch workflow

Additional notes

Changes made:

  1. src/oss/python/integrations/chat/openai.mdx:

    • Added comprehensive "Using with Azure OpenAI" section with three subsections:
      • Using Azure OpenAI v1 API with API Key
      • Using Azure OpenAI with Microsoft Entra ID
      • Custom callable API keys (sync and async)
    • Fixed typo ("instaed" → "instead")
  2. src/oss/python/integrations/chat/azure_chat_openai.mdx:

    • Added info box explaining the new Azure OpenAI v1 API option
    • Cross-referenced the ChatOpenAI documentation for v1 API usage
    • Clarified that AzureChatOpenAI remains supported for traditional API versions
  3. src/oss/python/integrations/text_embedding/openai.mdx:

    • Added "Using with Azure OpenAI" section mirroring the structure in ChatOpenAI docs
    • Included examples for API key auth, Entra ID auth, and custom callables

Key features documented:

  • Callable API keys: Functions (sync or async) can now be passed as the api_key parameter
  • Azure v1 API: Direct usage of ChatOpenAI with Azure endpoints using /openai/v1/ path
  • Token providers: Automatic token refresh using get_bearer_token_provider from Azure Identity
  • Async support: Proper handling of async callables with async methods

All markdown linting issues have been addressed, and no new linting errors were introduced.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1160 **Author:** [@marlenezw](https://github.com/marlenezw) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/28/2025 **Merged by:** [@ccurme](https://github.com/ccurme) **Base:** `main` ← **Head:** `openai_callable_docs` --- ### 📝 Commits (7) - [`200d8a4`](https://github.com/langchain-ai/docs/commit/200d8a416a074cecf2b8af6fbcd007660d31481b) updating docs - [`839e15b`](https://github.com/langchain-ai/docs/commit/839e15bae913dde7249faa977b2e0d3f6b080379) fixing linting - [`ef84516`](https://github.com/langchain-ai/docs/commit/ef845166e3bf05fca8fe55bfd004ab7a4562cc54) Apply suggestion from @Copilot - [`51a44a9`](https://github.com/langchain-ai/docs/commit/51a44a91991841d96a6caf240e54de1403092e72) Apply suggestion from @Copilot - [`aa6065e`](https://github.com/langchain-ai/docs/commit/aa6065ee9673fffff21b0016a309e04a830bffc2) remoing stray ellipses - [`1333acb`](https://github.com/langchain-ai/docs/commit/1333acb2cfd766daa2d70042ac3e82d7919138a8) Update src/oss/python/integrations/text_embedding/openai.mdx - [`ee385eb`](https://github.com/langchain-ai/docs/commit/ee385eb1c214023aeae64481a694e78af012af6f) cosmetic changes ### 📊 Changes **3 files changed** (+199 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/python/integrations/chat/azure_chat_openai.mdx` (+8 -4) 📝 `src/oss/python/integrations/chat/openai.mdx` (+96 -7) 📝 `src/oss/python/integrations/text_embedding/openai.mdx` (+95 -0) </details> ### 📄 Description ## Overview This PR adds documentation for the new callable API key feature in `ChatOpenAI`, `OpenAI`, and `OpenAIEmbeddings` classes, introduced in [langchain-ai/langchain#33532](https://github.com/langchain-ai/langchain/pull/33532). The documentation covers: - Using `ChatOpenAI` and `OpenAIEmbeddings` with Azure OpenAI's new v1 API endpoints - Microsoft Entra ID (formerly Azure AD) authentication with automatic token refresh - Custom callable API keys for dynamic key retrieval (sync and async) ## Type of change **Type:** Update existing documentation ## Related issues/PRs - Feature PR: https://github.com/langchain-ai/langchain/pull/33532 - Microsoft Docs: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/api-version-lifecycle?tabs=python#next-generation-api-1 ## Checklist - [x] I have read the [contributing guidelines](README.md) - [x] I have tested my changes locally using `make lint_md` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed (not applicable - added sections to existing pages) - [ ] I have gotten approval from the relevant reviewers - [ ] (Internal team members only / optional) I have created a preview deployment using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml) ## Additional notes ### Changes made: 1. **`src/oss/python/integrations/chat/openai.mdx`**: - Added comprehensive "Using with Azure OpenAI" section with three subsections: - Using Azure OpenAI v1 API with API Key - Using Azure OpenAI with Microsoft Entra ID - Custom callable API keys (sync and async) - Fixed typo ("instaed" → "instead") 2. **`src/oss/python/integrations/chat/azure_chat_openai.mdx`**: - Added info box explaining the new Azure OpenAI v1 API option - Cross-referenced the ChatOpenAI documentation for v1 API usage - Clarified that `AzureChatOpenAI` remains supported for traditional API versions 3. **`src/oss/python/integrations/text_embedding/openai.mdx`**: - Added "Using with Azure OpenAI" section mirroring the structure in ChatOpenAI docs - Included examples for API key auth, Entra ID auth, and custom callables ### Key features documented: - **Callable API keys**: Functions (sync or async) can now be passed as the `api_key` parameter - **Azure v1 API**: Direct usage of `ChatOpenAI` with Azure endpoints using `/openai/v1/` path - **Token providers**: Automatic token refresh using `get_bearer_token_provider` from Azure Identity - **Async support**: Proper handling of async callables with async methods All markdown linting issues have been addressed, and no new linting errors were introduced. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:11 -05:00
yindo closed this issue 2026-02-17 17:22:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1341