{"id":21713,"library":"promptflow-tools","title":"Prompt Flow Built-in Tools","description":"Built-in tools for Microsoft Prompt flow, providing ready-to-use tools like LLM (OpenAI, Azure OpenAI), Python, SerpAPI, and more. Currently at version 1.6.1, with the parent promptflow package at 1.17.1. Regular releases track the promptflow SDK.","status":"active","version":"1.6.1","language":"python","source_language":"en","source_url":"https://github.com/microsoft/promptflow","tags":["promptflow","tools","llm","openai","azure","microsoft"],"install":[{"cmd":"pip install promptflow-tools","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core SDK required to run tools","package":"promptflow","optional":false},{"reason":"Required for OpenAI/LLM tools","package":"openai","optional":true},{"reason":"Required for Azure OpenAI tools","package":"azure-ai-inference","optional":true}],"imports":[{"note":"Wrong package name (hyphen vs underscore) and class name","wrong":"from promptflow_tools.azure_openai import AzureOpenAI","symbol":"AzureOpenAITool","correct":"from promptflow.tools.azure_openai import AzureOpenAITool"},{"note":"Wrong package name and class name","wrong":"from promptflow_tools.openai import OpenAI","symbol":"OpenAITool","correct":"from promptflow.tools.openai import OpenAITool"},{"note":"PythonTool is in the python submodule, not top-level","wrong":"from promptflow.tools import PythonTool","symbol":"PythonTool","correct":"from promptflow.tools.python import PythonTool"},{"note":"Wrong package name and class name","wrong":"from promptflow_tools.serpapi import SerpAPI","symbol":"SerpAPITool","correct":"from promptflow.tools.serpapi import SerpAPITool"}],"quickstart":{"code":"from promptflow.tools.azure_openai import AzureOpenAITool\nfrom promptflow.core import Flow\n\n# Use environment variables for credentials\nazure_openai = AzureOpenAITool(\n    api_key=os.environ.get('AZURE_OPENAI_API_KEY', ''),\n    api_base=os.environ.get('AZURE_OPENAI_ENDPOINT', ''),\n    api_version='2023-12-01-preview'\n)\n\n# Create a simple flow\nflow = Flow()\nflow.add_node(azure_openai, inputs={'prompt': 'Hello'})\nprint(flow)\n","lang":"python","description":"Initialize an Azure OpenAI tool and attach it to a flow."},"warnings":[{"fix":"Use 'from promptflow.tools.azure_openai import AzureOpenAITool' (note the dot-separated path with 'promptflow.tools').","message":"Import paths changed in promptflow-tools 1.0.0: all tools moved from 'promptflow.tools.<name>' to relative paths; top-level promptflow_tools is no longer importable.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use the 'XxxTool' naming convention: e.g., 'AzureOpenAITool', 'OpenAITool', 'PythonTool'.","message":"The tools classes have been renamed from generic names like 'OpenAI' to 'OpenAITool'. Using old class names will raise ImportError.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For promptflow >=1.12.0, import from 'promptflow.tools' directly without installing promptflow-tools separately.","message":"The 'promptflow-tools' package is being deprecated in favor of built-in tools in 'promptflow'. Future releases of promptflow (>=1.12.0) include tools directly, so separate installation may become unnecessary.","severity":"deprecated","affected_versions":">=1.12.0"},{"fix":"Install optional dependencies: 'pip install openai' and/or 'pip install azure-ai-inference'.","message":"OpenAI and Azure OpenAI tools require the 'openai' and 'azure-ai-inference' packages respectively. Missing dependencies cause runtime errors on tool instantiation.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from promptflow.tools.<tool_name> import <ToolClass>' instead.","cause":"Upgraded to promptflow-tools 1.0.0+ where the package structure changed; top-level 'promptflow_tools' no longer exists.","error":"ModuleNotFoundError: No module named 'promptflow_tools'"},{"fix":"Change import to 'from promptflow.tools.azure_openai import AzureOpenAITool'.","cause":"Class renamed from 'AzureOpenAI' to 'AzureOpenAITool' in version 1.0.0.","error":"ImportError: cannot import name 'AzureOpenAI' from 'promptflow.tools.azure_openai'"},{"fix":"Create a Flow, add the tool as a node, and run the flow: 'flow = Flow(); flow.add_node(tool, inputs=...); flow.run()'.","cause":"Trying to call .run() directly; tools must be added to a flow and executed via the flow engine.","error":"AttributeError: 'AzureOpenAITool' object has no attribute 'run'"},{"fix":"Provide api_version as a string, e.g., '2023-12-01-preview'.","cause":"AzureOpenAITool requires api_version to be specified, but it was omitted. Unlike the older 'AzureOpenAI' class, the new tool enforces this parameter.","error":"KeyError: 'api_version' is required when using Azure OpenAI tool"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}