Skip to main content
Ctrl+K
🦜🔗 LangChain  documentation - Home 🦜🔗 LangChain  documentation - Home
  • Reference
Ctrl+K
Docs
  • GitHub
  • X / Twitter
Ctrl+K
  • Reference
Docs
  • GitHub
  • X / Twitter

Section Navigation

Base packages

  • Core
  • Langchain
  • Text Splitters
  • Community
  • Experimental

Integrations

  • AI21
  • Anthropic
  • AstraDB
  • AWS
  • Azure Ai
    • chat_message_histories
    • chat_models
    • embeddings
    • query_constructors
    • retrievers
    • utils
      • JSONObjectEncoder
      • cosine_similarity
      • cosine_similarity_top_k
      • get_endpoint_from_project
    • vectorstores
  • Azure Dynamic Sessions
  • Cerebras
  • Chroma
  • Cohere
  • Deepseek
  • Elasticsearch
  • Exa
  • Fireworks
  • Google Community
  • Google GenAI
  • Google VertexAI
  • Groq
  • Huggingface
  • IBM
  • Milvus
  • MistralAI
  • MongoDB
  • Neo4J
  • Nomic
  • Nvidia Ai Endpoints
  • Ollama
  • OpenAI
  • Perplexity
  • Pinecone
  • Postgres
  • Prompty
  • Qdrant
  • Redis
  • Sema4
  • Snowflake
  • Sqlserver
  • Standard Tests
  • Tavily
  • Together
  • Unstructured
  • Upstage
  • Weaviate
  • XAI
  • LangChain Python API Reference
  • langchain-azure-ai: 0.1.4
  • utils

utils#

Classes

utils.utils.JSONObjectEncoder(*[, skipkeys, ...])

Custom JSON encoder for objects in LangChain.

Functions

utils.math.cosine_similarity(X, Y)

Row-wise cosine similarity between two equal-width matrices.

utils.math.cosine_similarity_top_k(X, Y[, ...])

Row-wise cosine similarity with optional top-k and score threshold filtering.

utils.utils.get_endpoint_from_project(...)

Retrieves the default inference endpoint and credentials from a project.

© Copyright 2025, LangChain Inc.