When adding azure ai for embedding, langgraph studio fails to render the graph #5

Open
opened 2026-02-16 06:17:57 -05:00 by yindo · 0 comments
Owner

Originally created by @EliorKedar1 on GitHub (Feb 23, 2025).

added azure ai embedding model:


def make_text_encoder(model: str) -> Embeddings:
    """Connect to the configured text encoder."""
    provider, model = model.split("/", maxsplit=1)
    match provider:
        case "openai":
            from langchain_openai import OpenAIEmbeddings

            return OpenAIEmbeddings(model=model)
        case "cohere":
            from langchain_cohere import CohereEmbeddings

            return CohereEmbeddings(model=model)  # type: ignore
        case "azure":
            from langchain_azure_ai.embeddings import AzureAIEmbeddingsModel

            return AzureAIEmbeddingsModel(
                endpoint=os.getenv("AZURE_INFERENCE_ENDPOINT"),
                credential=os.getenv("AZURE_OPENAI_API_KEY"),
                model_name=model,
            )
        case _:
            raise ValueError(f"Unsupported embedding provider: {provider}")

added the dependency:

dependencies = [
"langgraph>=0.2.6",
"langchain-openai>=0.1.22",
"langchain>=0.2.14",
"langchain-fireworks>=0.1.7",
"python-dotenv>=1.0.1",
"msgspec>=0.18.6",
"langchain-mongodb>=0.1.9",
"langchain-azure-ai>=0.1.1",
]

Image

WF executed successfully without the rendered graph...

Originally created by @EliorKedar1 on GitHub (Feb 23, 2025). added azure ai embedding model: ```python def make_text_encoder(model: str) -> Embeddings: """Connect to the configured text encoder.""" provider, model = model.split("/", maxsplit=1) match provider: case "openai": from langchain_openai import OpenAIEmbeddings return OpenAIEmbeddings(model=model) case "cohere": from langchain_cohere import CohereEmbeddings return CohereEmbeddings(model=model) # type: ignore case "azure": from langchain_azure_ai.embeddings import AzureAIEmbeddingsModel return AzureAIEmbeddingsModel( endpoint=os.getenv("AZURE_INFERENCE_ENDPOINT"), credential=os.getenv("AZURE_OPENAI_API_KEY"), model_name=model, ) case _: raise ValueError(f"Unsupported embedding provider: {provider}") ``` added the dependency: dependencies = [ "langgraph>=0.2.6", "langchain-openai>=0.1.22", "langchain>=0.2.14", "langchain-fireworks>=0.1.7", "python-dotenv>=1.0.1", "msgspec>=0.18.6", "langchain-mongodb>=0.1.9", "langchain-azure-ai>=0.1.1", ] ![Image](https://github.com/user-attachments/assets/4e169415-7e51-49f3-8f7b-a12d5e022ace) WF executed successfully without the rendered graph...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/rag-research-agent-template#5