
LANGCHAIN — What Is Eden AI X Langchain?
I’m not a great programmer; I’m just a good programmer with great habits. — Kent Beck
Eden AI x LangChain is a powerful combination that provides seamless access to a wide range of AI capabilities, including Large Language Models (LLMs) and Embeddings. Eden AI simplifies access to AI models, offering a unified platform with a single API key and minimal code. It also integrates with LangChain, an open-source library that provides tools for building applications powered by LLMs.
Here’s a tutorial to help you get started with harnessing the combined power of LangChain and Eden AI to access multiple LLMs and Embeddings:
Tutorial 1: Get started with Eden AI to access multiple LLMs and Embeddings
Step 1: Installation
pip install langchainStep 2: Setting Up Your Eden AI Account
export EdenAI_API_KEY="your_api_key_here"Step 3: Importing Eden AI LLMs and Embeddings
from langchain.llms import EdenAI
from langchain.embeddings.edenai import EdenAiEmbeddingsStep 4: Using Eden AI LLMs
llm=EdenAI(provider="openai", params={"temperature" : 0.2,"max_tokens" : 250})
prompt = """how can i create ai powered chatbots with LLMS"""
llm(prompt)Step 5: Exploring Eden AI Embeddings
embeddings = EdenAiEmbeddings(provider="openai")
docs = ["Eden AI is integrated in LangChain", "AskYoda is Available"]
document_result = embeddings.embed_documents(docs)With the knowledge of how to use embeddings and LLMs, you now possess the capability to create an array of impressive functionalities, ranging from basic AI assistants to the development of custom chatbots.
Tutorial 2: Supercharge your app with advanced AI capabilities
Step 1: Preparing Your Environment
pip install langchainStep 2: Obtaining an Eden AI API Key Acquire an API key from the Eden AI platform.
Step 3: Importing Necessary Modules
from langchain.llms import EdenAI
from langchain.agents import initialize_agent, AgentType
from langchain.tools.edenai import (
EdenAiParsingIDTool,
EdenAiParsingInvoiceTool
)
import osStep 4: Setting Up your Eden AI API key
os.environ['EdenAI_API_KEY'] = "your_api_key_here"Step 5: Initializing the LLM
llm=EdenAI(provider="openai", model="text-davinci-003", params={"temperature" : 0.2,"max_tokens" : 250})Step 6: Setting Up Tools and the Agent
tools = [
EdenAiParsingIDTool(providers=["amazon","klippa"],language="en"),
EdenAiParsingInvoiceTool(providers=["amazon","google"],language="en"),
]
agent_chain = initialize_agent(
tools,
llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose=True,
return_intermediate_steps=True,
)Step 7: Executing the Agent Use the Agent to analyze identification or invoice documents.
Congratulations, you’ve now learned how to harness Eden AI and LangChain’s capabilities to simplify AI integration and supercharge your applications.





