Skip to main content

Posts

Showing posts from May, 2024

How To Chat With Multiple CSV Files Together - Azure OpenAI + LangChain

When dealing with multiple CSV files having different columns, it’s essential to have an efficient method for querying and extracting relevant information. Azure OpenAI and LangChain provide a robust combination for handling such scenarios.  In this article, we’ll explore how to load multiple CSV files, process them, and ask questions across all of them. Let’s get started by installing the required packages. Install Required Packages Here are the ones which you need to install: ! pip install openai ! pip install langchain ! pip install pandas ! pip install langchain_experimental ! pip install langchain_openai ! pip install tabulate Import Required Packages Here are the packages which we need to import to get started: from langchain_openai import AzureOpenAI from langchain_experimental.agents import create_csv_agent Read Configuration First of all, we need to set few variables with information from Azure portal and Azure OpenAI Studio : api_type = "azure" api_base = "

Functions And Plugins In Semantic Kernel

It's been a while since Semantic Kernel is around and in the last few months, a lot of many things have changed, specifically from the implementation point of view. Hence, I thought of summarize the key functions to help you understand better, which are also listed in Evan's blog.. As of today, there are 3 different ways to add plugins into the Semantic Kernel. Here are those: From a directory: Need to provide parent_directory and plugin_name  Using KernelPlugin instance  Using KernelFunction: Need to create a custom class or a dictionary where methods are decorated with kernel_function Similarly, there are few different ways to add functions in Semantic Kernel: KernelFunction.from_prompt a.k.a KernelFunctionFromPrompt(function_name, plugin_name, description, prompt, template_format, prompt_template, prompt_template_config, prompt_execution_settings)  KernelFunctionFromPrompt.from_yaml(yaml_str, plugin_name (optional)) KernelFunctionFromPrompt.from_directory(path, plugin_name (