the key in directly via the edenai_api_key named parameter when initiating the EdenAI LLM class:from langchain.llms import EdenAIllm = EdenAI(edenai_api_key="...",provider="openai", temperature=0.2, max_tokens=250)Calling a model‚ÄãThe EdenAI API brings together various providers, each offering multiple models.To access a specific model, you can simply add 'model' during instantiation.For instance, let's explore the models provided by OpenAI, such as GPT3.5 text generation‚Äãfrom langchain.prompts import PromptTemplatefrom langchain.chains import LLMChainllm=EdenAI(feature="text",provider="openai",model="text-davinci-003",temperature=0.2, max_tokens=250)prompt = """User: Answer the following yes/no question by reasoning step by step. Can a dog drive a car?Assistant:"""llm(prompt)image generation‚Äãimport base64from io import BytesIOfrom PIL import Imageimport jsondef print_base64_image(base64_string):    # Decode the base64 string into binary data    decoded_data = base64.b64decode(base64_string)    # Create an in-memory stream to read the binary data    image_stream = BytesIO(decoded_data)    # Open the image using PIL    image = Image.open(image_stream)    # Display the image    image.show()text2image = EdenAI(    feature="image" ,    provider= "openai",    resolution="512x512")image_output = text2image("A cat riding a motorcycle by Picasso")print_base64_image(image_output)text generation with callback‚Äãfrom langchain.llms import EdenAIfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandlerllm = EdenAI(    callbacks=[StreamingStdOutCallbackHandler()],    feature="text",provider="openai", temperature=0.2,max_tokens=250)prompt = """User: Answer the following yes/no question by reasoning step by step. Can a dog drive a car?Assistant:"""print(llm(prompt))Chaining Calls‚Äãfrom langchain.chains import SimpleSequentialChainfrom langchain.prompts import PromptTemplatefrom langchain.chains import LLMChainllm = EdenAI(feature="text",
Eden AI is revolutionizing the AI landscape by uniting the best AI providers, empowering users to unlock limitless possibilities and tap into the true potential of artificial intelligence. With an all-in-one comprehensive and hassle-free platform, it allows users to deploy AI features to production lightning fast, enabling effortless access to the full breadth of AI capabilities via a single API. (website//edenai.co/)
Eden AI is revolutionizing the AI landscape by uniting the best AI providers, empowering users to unlock limitless possibilities and tap into the true potential of artificial intelligence. With an all-in-one comprehensive and hassle-free platform, it allows users to deploy AI features to production lightning fast, enabling effortless access to the full breadth of AI capabilities via a single API. (website//edenai.co/) ->: the key in directly via the edenai_api_key named parameter when initiating the EdenAI LLM class:from langchain.llms import EdenAIllm = EdenAI(edenai_api_key="...",provider="openai", temperature=0.2, max_tokens=250)Calling a model‚ÄãThe EdenAI API brings together various providers, each offering multiple models.To access a specific model, you can simply add 'model' during instantiation.For instance, let's explore the models provided by OpenAI, such as GPT3.5 text generation‚Äãfrom langchain.prompts import PromptTemplatefrom langchain.chains import LLMChainllm=EdenAI(feature="text",provider="openai",model="text-davinci-003",temperature=0.2, max_tokens=250)prompt = """User: Answer the following yes/no question by reasoning step by step. Can a dog drive a car?Assistant:"""llm(prompt)image generation‚Äãimport base64from io import BytesIOfrom PIL import Imageimport jsondef print_base64_image(base64_string):    # Decode the base64 string into binary data    decoded_data = base64.b64decode(base64_string)    # Create an in-memory stream to read the binary data    image_stream = BytesIO(decoded_data)    # Open the image using PIL    image = Image.open(image_stream)    # Display the image    image.show()text2image = EdenAI(    feature="image" ,    provider= "openai",    resolution="512x512")image_output = text2image("A cat riding a motorcycle by Picasso")print_base64_image(image_output)text generation with callback‚Äãfrom langchain.llms import EdenAIfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandlerllm = EdenAI(    callbacks=[StreamingStdOutCallbackHandler()],    feature="text",provider="openai", temperature=0.2,max_tokens=250)prompt = """User: Answer the following yes/no question by reasoning step by step. Can a dog drive a car?Assistant:"""print(llm(prompt))Chaining Calls‚Äãfrom langchain.chains import SimpleSequentialChainfrom langchain.prompts import PromptTemplatefrom langchain.chains import LLMChainllm = EdenAI(feature="text",