Azure AI Services Toolkit
This toolkit is used to interact with the Azure AI Services API
to achieve some multimodal capabilities.
Currently There are five tools bundled in this toolkit:
- AzureAiServicesImageAnalysisTool: used to extract caption, objects, tags, and text from images.
- AzureAiServicesDocumentIntelligenceTool: used to extract text, tables, and key-value pairs from documents.
- AzureAiServicesSpeechToTextTool: used to transcribe speech to text.
- AzureAiServicesTextToSpeechTool: used to synthesize text to speech.
- AzureAiServicesTextAnalyticsForHealthTool: used to extract healthcare entities.
First, you need to set up an Azure account and create an AI Services resource. You can follow the instructions here to create a resource.
Then, you need to get the endpoint, key and region of your resource, and set them as environment variables. You can find them in the "Keys and Endpoint" page of your resource.
%pip install --upgrade --quiet azure-ai-formrecognizer > /dev/null
%pip install --upgrade --quiet azure-cognitiveservices-speech > /dev/null
%pip install --upgrade --quiet azure-ai-textanalytics > /dev/null
%pip install --upgrade --quiet azure-ai-vision-imageanalysis > /dev/null
%pip install -qU langchain-community
import os
os.environ["OPENAI_API_KEY"] = "sk-"
os.environ["AZURE_AI_SERVICES_KEY"] = ""
os.environ["AZURE_AI_SERVICES_ENDPOINT"] = ""
os.environ["AZURE_AI_SERVICES_REGION"] = ""
Create the Toolkit
from langchain_community.agent_toolkits import AzureAiServicesToolkit
toolkit = AzureAiServicesToolkit()
[tool.name for tool in toolkit.get_tools()]
['azure_ai_services_document_intelligence',
'azure_ai_services_image_analysis',
'azure_ai_services_speech_to_text',
'azure_ai_services_text_to_speech',
'azure_ai_services_text_analytics_for_health']