CrewAI

Connect LangDB to CrewAI using OpenAI-compatible setup to enhance LLM workflows with full tracing and streamlined monitoring.

LangDB integrates seamlessly with popular libraries like CrewAI, providing tracing support to capture detailed logs for workflows. Below is a complete example of using CrewAI with LangDB.

1

Install CrewAI

pip install crewai
2

Add LangDB to your Code

from crewai import LLM
project_id = "xxxx" ## LangDB Project ID
default_headers = {"x-project-id": project_id}
os.environ["OPENAI_API_KEY"] = (
    "xxxx"  ## LangDB API Key
)
llm_writer = LLM(model="gpt-4o-mini", 
                 base_url=api_base, 
                 extra_headers=default_headers)

# Your CrewAi code here

Check out full examples here.

Was this helpful?