LangChain
Connect LangDB to LangChain using OpenAI-compatible setup to enhance LLM workflows with full tracing and streamlined monitoring.
2
Add LangDB to your Code
from langchain_openai import ChatOpenAI
api_base = "https://api.us-east-1.langdb.ai"
api_key = "xxxx" # LangDB API Key
default_headers = {
"x-project-id": "xxxxx", ### LangDB Project ID
}
llm = ChatOpenAI(
model_name='gpt-4o' ,
temperature=0.3,
openai_api_base=api_base,
default_headers=default_headers,
disable_streaming=True )
# Your LangChain Code hereWas this helpful?