mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
|
from __future__ import annotations
|
||
|
|
||
|
import sys
|
||
|
from typing import List
|
||
|
|
||
|
from langchain_core.tools import BaseTool
|
||
|
|
||
|
from langchain_community.agent_toolkits.base import BaseToolkit
|
||
|
from langchain_community.tools.azure_cognitive_services import (
|
||
|
AzureCogsFormRecognizerTool,
|
||
|
AzureCogsImageAnalysisTool,
|
||
|
AzureCogsSpeech2TextTool,
|
||
|
AzureCogsText2SpeechTool,
|
||
|
AzureCogsTextAnalyticsHealthTool,
|
||
|
)
|
||
|
|
||
|
|
||
|
class AzureCognitiveServicesToolkit(BaseToolkit):
|
||
|
"""Toolkit for Azure Cognitive Services."""
|
||
|
|
||
|
def get_tools(self) -> List[BaseTool]:
|
||
|
"""Get the tools in the toolkit."""
|
||
|
|
||
|
tools: List[BaseTool] = [
|
||
|
AzureCogsFormRecognizerTool(),
|
||
|
AzureCogsSpeech2TextTool(),
|
||
|
AzureCogsText2SpeechTool(),
|
||
|
AzureCogsTextAnalyticsHealthTool(),
|
||
|
]
|
||
|
|
||
|
# TODO: Remove check once azure-ai-vision supports MacOS.
|
||
|
if sys.platform.startswith("linux") or sys.platform.startswith("win"):
|
||
|
tools.append(AzureCogsImageAnalysisTool())
|
||
|
return tools
|