Registry / llm-agents / promptflow

promptflow

JSON →
library1.18.5pypypi✓ verified 87d ago

Prompt Flow is a development tool designed to streamline the end-to-end development cycle of Large Language Model (LLM)-based AI applications, covering ideation, prototyping, testing, evaluation, and production deployment. It provides a Python SDK and CLI for building, testing, and managing AI workflows. The current version is 1.18.4, with frequent minor releases delivering new features and improvements.

pip install promptflow
INSTALL
IMPORT
SIG · PROMPTFLOW
P
promptflow
llm-agentspythonv1.18.5
Install
25.4s avg
Import
6722ms
Disk
357MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.18.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 7.104s · 346.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 25.4s · import 6.339s · 337MB
357MB installed
● package 357MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tool
from promptflow import tool
Decorator used to define a Python function as a Prompt Flow tool.
AzureOpenAIConnection
from promptflow.connections import AzureOpenAIConnection
Used to establish a connection to Azure OpenAI services within a flow.
PromptFlowClient
from promptflow.client import PromptFlowClient
The primary client for programmatically interacting with Prompt Flow, managing runs, connections, and flows.

This quickstart demonstrates how to define a Python function as a Prompt Flow tool using the `@tool` decorator. Tools are the building blocks of Prompt Flow applications. For full flow orchestration and interaction with LLMs via connections, the `PromptFlowClient` or the CLI is typically used.

import os from promptflow import tool @tool def summarize_text(text: str, max_length: int = 100) -> str: """ A simple tool that summarizes text by truncating it. In a real Prompt Flow, this might invoke an LLM via a connection. """ if len(text) <= max_length: return text return text[:max_length-3] + "..." # You can test a tool directly as a Python function: long_text = "This is a very long piece of text that needs to be summarized. It contains many words and details." print(f"Original: {long_text}") print(f"Summarized: {summarize_text(long_text, max_length=30)}") # To interact with Prompt Flow programmatically, initialize the client: # client = PromptFlowClient(subscription_id=os.environ.get("AZURE_SUBSCRIPTION_ID", ""), # resource_group_name=os.environ.get("AZURE_RESOURCE_GROUP_NAME", ""), # workspace_name=os.environ.get("AZURE_WORKSPACE_NAME", "")) # You would then use the client to manage flows, connections, and runs.
pf --version
Debug
Known issues
breakingPrompt Flow versions 1.14.0 and later require Python 3.9 or higher. If you are on an older Python version (e.g., 3.8), you must upgrade your environment before installing or upgrading to `promptflow>=1.14.0`.
fix
Upgrade your Python environment to 3.9, 3.10, 3.11, or 3.12.
affects: >=1.14.0
breakingBreaking changes were introduced in connection-related classes (`AzureOpenAIConnection`, `OpenAIConnection`, `TestConnection`, `ConnectionProvider`) in versions 1.10.0 and 1.13.0. This might require updates to existing flow YAMLs or Python code that defines or uses connections.
fix
Review the official Prompt Flow documentation and CHANGELOG for specific migration steps related to connection types you are using. Update connection definitions in YAMLs or Python code accordingly.
affects: 1.10.0, 1.13.0
gotchaPrompt Flow is under active and rapid development. While minor version increments often introduce new features, they can also include breaking changes to existing APIs (e.g., client methods, flow definition syntax, tool inputs/outputs). Always review the `CHANGELOG.md` file in the GitHub repository when planning an upgrade, especially across minor versions.
fix
Consult the `CHANGELOG.md` before upgrading to understand potential breaking changes. Consider pinning exact versions in production environments and thoroughly testing upgrades.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'promptflow.tools'
This error occurs because required Prompt Flow sub-packages or custom tools are not installed in the execution environment, particularly when deploying flows to Docker, pipelines, or after package version changes.
fix
Ensure all necessary Prompt Flow sub-packages (e.g., `promptflow-tools`, `promptflow-core`, `promptflow-devkit`, `promptflow-azure`) are explicitly listed in your `requirements.txt` file and installed in the target environment. For version upgrades (especially to >=1.8.0), perform a clean uninstall of old sub-packages before installing the new version: `pip uninstall -y promptflow promptflow-core promptflow-devkit promptflow-azure && pip install promptflow promptflow-tools --upgrade`.
ConnectionNotFoundError: Connection 'YourConnectionName' is not found.
The Prompt Flow cannot locate the specified connection, either because it doesn't exist in the current environment (local or Azure workspace), or the executing identity lacks permissions to access it, or connection details like keys were regenerated and not updated in the deployment.
fix
Verify the connection name is correct and the connection is created and accessible in your environment (e.g., `pf connection list` locally or check Azure workspace connections). For cloud deployments, ensure the endpoint identity has appropriate roles (like 'Azure AI Developer' or 'Contributor') to access connections. If keys were regenerated, manually update the connection configuration in the deployed flow or redeploy.
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' (often in promptflow.tracing._trace.py)
This specific TypeError indicates an issue within Prompt Flow's internal tracing logic during deployment, where a `None` value is encountered unexpectedly when an integer (e.g., for token counts) is required, often after successful local testing.
fix
To work around this issue, disable Prompt Flow's tracing by setting the environment variable `PF_DISABLE_TRACING` to `true` in your deployment configuration. Additionally, ensure compatibility of `openai` and `marshmallow` packages; pinning `openai==1.44.1` is a known workaround in some cases.
AttributeError: 'NoneType' object has no attribute 'content' (in _openai_utils.py during Azure OpenAI Async Streaming)
This error occurs during Azure OpenAI's asynchronous streaming with content filtering, where intermediate delta chunks might arrive with `None` for the `content` attribute, which the `promptflow-tracing` library does not gracefully handle.
fix
This often points to a bug in the `promptflow-tracing` library. Update `promptflow-tracing` to its latest version, along with `promptflow`, as updates frequently include fixes for such issues. If the problem persists, disabling tracing via `PF_DISABLE_TRACING=true` can serve as a temporary workaround until a patch is released.
Upgrade
Version history
1.18.5latest on PyPI · released May 1, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
2
Amazon
1
Resources
promptflow — pip install promptflow · libregistry