mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Update installation instructions (#1026)
* Update installation instructions * address comments
This commit is contained in:
committed by
GitHub
Unverified
parent
2d20e644df
commit
f7e9490494
+8
-9
@@ -3,19 +3,18 @@
|
||||
## Quick Install
|
||||
|
||||
```bash
|
||||
# Base package including workflow support
|
||||
# Install agent-framework-core and all sub packages
|
||||
pip install agent-framework
|
||||
# Optional: Add Azure AI integration (Foundry)
|
||||
pip install agent-framework[azure-ai]
|
||||
# Optional: Add Microsoft integrations, currently only CopilotStudioAgents
|
||||
pip install agent-framework[microsoft]
|
||||
# Optional: Both
|
||||
pip install agent-framework[microsoft,azure-ai]
|
||||
# All-in-one
|
||||
pip install agent-framework[all]
|
||||
# Install only core and Azure AI integration
|
||||
pip install agent-framework-azure-ai
|
||||
# Install only core and Microsoft Copilot Studio integration
|
||||
pip install agent-framework-copilotstudio
|
||||
# Install only core, Microsoft Copilot Studio and Azure AI integration
|
||||
pip install agent-framework-microsoft agent-framework-azure-ai
|
||||
```
|
||||
|
||||
Supported Platforms:
|
||||
|
||||
- Python: 3.10+
|
||||
- OS: Windows, macOS, Linux
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Get Started with Microsoft Agent Framework A2A
|
||||
|
||||
Please install this package as the extra for `agent-framework`:
|
||||
Please install this package via pip:
|
||||
|
||||
```bash
|
||||
pip install agent-framework[a2a]
|
||||
pip install agent-framework-a2a
|
||||
```
|
||||
|
||||
## A2A Agent Integration
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Get Started with Microsoft Agent Framework Azure AI
|
||||
|
||||
Please install this package as the extra for `agent-framework`:
|
||||
Please install this package via pip:
|
||||
|
||||
```bash
|
||||
pip install agent-framework[azure_ai]
|
||||
pip install agent-framework-azure-ai
|
||||
```
|
||||
|
||||
and see the [README](https://github.com/microsoft/agent-framework/tree/main/python/README.md) for more information.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Get Started with Microsoft Agent Framework Copilot Studio
|
||||
|
||||
Please install this package as the extra for `agent-framework`:
|
||||
Please install this package via pip:
|
||||
|
||||
```bash
|
||||
pip install agent-framework[copilotstudio]
|
||||
pip install agent-framework-copilotstudio
|
||||
```
|
||||
|
||||
## Copilot Studio Agent
|
||||
|
||||
@@ -13,11 +13,9 @@ Highlights
|
||||
## Quick Install
|
||||
|
||||
```bash
|
||||
pip install agent-framework[all]
|
||||
pip install agent-framework-core
|
||||
# Optional: Add Azure AI integration
|
||||
pip install agent-framework-azure-ai
|
||||
# Optional: Both
|
||||
pip install agent-framework-azure-ai agent-framework-copilotstudio
|
||||
```
|
||||
|
||||
Supported Platforms:
|
||||
|
||||
@@ -14,8 +14,7 @@ def __getattr__(name: str) -> Any:
|
||||
return getattr(importlib.import_module(PACKAGE_NAME), name)
|
||||
except ModuleNotFoundError as exc:
|
||||
raise ModuleNotFoundError(
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, "
|
||||
f"please do `pip install agent-framework[{PACKAGE_EXTRA}]`"
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, please do `pip install agent-framework-{PACKAGE_EXTRA}`"
|
||||
) from exc
|
||||
raise AttributeError(f"Module {PACKAGE_NAME} has no attribute {name}.")
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
import importlib
|
||||
from typing import Any
|
||||
|
||||
_IMPORTS: dict[str, tuple[str, list[str]]] = {
|
||||
"AzureAIAgentClient": ("agent_framework_azure_ai", ["azure_ai", "azure"]),
|
||||
"AzureOpenAIAssistantsClient": ("agent_framework.azure._assistants_client", []),
|
||||
"AzureOpenAIChatClient": ("agent_framework.azure._chat_client", []),
|
||||
"AzureAISettings": ("agent_framework_azure_ai", ["azure_ai", "azure"]),
|
||||
"AzureOpenAISettings": ("agent_framework.azure._shared", []),
|
||||
"AzureOpenAIResponsesClient": ("agent_framework.azure._responses_client", []),
|
||||
"get_entra_auth_token": ("agent_framework.azure._entra_id_authentication", []),
|
||||
_IMPORTS: dict[str, tuple[str, str]] = {
|
||||
"AzureAIAgentClient": ("agent_framework_azure_ai", "azure-ai"),
|
||||
"AzureOpenAIAssistantsClient": ("agent_framework.azure._assistants_client", "core"),
|
||||
"AzureOpenAIChatClient": ("agent_framework.azure._chat_client", "core"),
|
||||
"AzureAISettings": ("agent_framework_azure_ai", "azure-ai"),
|
||||
"AzureOpenAISettings": ("agent_framework.azure._shared", "core"),
|
||||
"AzureOpenAIResponsesClient": ("agent_framework.azure._responses_client", "core"),
|
||||
"get_entra_auth_token": ("agent_framework.azure._entra_id_authentication", "core"),
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ def __getattr__(name: str) -> Any:
|
||||
return getattr(importlib.import_module(package_name), name)
|
||||
except ModuleNotFoundError as exc:
|
||||
raise ModuleNotFoundError(
|
||||
f"The {' or '.join(package_extra)} extra is not installed, "
|
||||
f"please use `pip install agent-framework[{package_extra[0]}]`, "
|
||||
f"please use `pip install agent-framework-{package_extra}`, "
|
||||
"or update your requirements.txt or pyproject.toml file."
|
||||
) from exc
|
||||
raise AttributeError(f"Module `azure` has no attribute {name}.")
|
||||
|
||||
@@ -25,8 +25,7 @@ def __getattr__(name: str) -> Any:
|
||||
return getattr(importlib.import_module(PACKAGE_NAME), name)
|
||||
except ModuleNotFoundError as exc:
|
||||
raise ModuleNotFoundError(
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, "
|
||||
f"please do `pip install agent-framework[{PACKAGE_EXTRA}]`"
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, please do `pip install agent-framework-{PACKAGE_EXTRA}`"
|
||||
) from exc
|
||||
raise AttributeError(f"Module {PACKAGE_NAME} has no attribute {name}.")
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ def __getattr__(name: str) -> Any:
|
||||
return getattr(importlib.import_module(PACKAGE_NAME), name)
|
||||
except ModuleNotFoundError as exc:
|
||||
raise ModuleNotFoundError(
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, "
|
||||
f"please do `pip install agent-framework[{PACKAGE_EXTRA}]`"
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, please do `pip install agent-framework-{PACKAGE_EXTRA}`"
|
||||
) from exc
|
||||
raise AttributeError(f"Module {PACKAGE_NAME} has no attribute {name}.")
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ def __getattr__(name: str) -> Any:
|
||||
except ModuleNotFoundError as exc:
|
||||
raise ModuleNotFoundError(
|
||||
f"The {' or '.join(package_extra)} extra is not installed, "
|
||||
f"please use `pip install agent-framework[{package_extra[0]}]`, "
|
||||
f"please use `pip install agent-framework-{package_extra[0]}`, "
|
||||
"or update your requirements.txt or pyproject.toml file."
|
||||
) from exc
|
||||
raise AttributeError(f"Module `azure` has no attribute {name}.")
|
||||
|
||||
@@ -14,8 +14,7 @@ def __getattr__(name: str) -> Any:
|
||||
return getattr(importlib.import_module(PACKAGE_NAME), name)
|
||||
except ModuleNotFoundError as exc:
|
||||
raise ModuleNotFoundError(
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, "
|
||||
f"please do `pip install agent-framework[{PACKAGE_EXTRA}]`"
|
||||
f"The '{PACKAGE_EXTRA}' extra is not installed, please do `pip install agent-framework-{PACKAGE_EXTRA}`"
|
||||
) from exc
|
||||
raise AttributeError(f"Module {PACKAGE_NAME} has no attribute {name}.")
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Get Started with Microsoft Agent Framework Mem0
|
||||
|
||||
Please install this package as the extra for `agent-framework`:
|
||||
Please install this package via pip:
|
||||
|
||||
```bash
|
||||
pip install agent-framework[mem0]
|
||||
pip install agent-framework-mem0
|
||||
```
|
||||
|
||||
## Memory Context Provider
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Get Started with Microsoft Agent Framework Redis
|
||||
|
||||
Please install this package as the extra for `agent-framework`:
|
||||
Please install this package via pip:
|
||||
|
||||
```bash
|
||||
pip install agent-framework[redis]
|
||||
pip install agent-framework-redis
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
@@ -22,7 +22,7 @@ This folder contains an example demonstrating how to use the Redis context provi
|
||||
### Install the package
|
||||
|
||||
```bash
|
||||
pip install "agent-framework[redis]"
|
||||
pip install "agent-framework-redis"
|
||||
```
|
||||
|
||||
## Running Redis
|
||||
|
||||
@@ -20,7 +20,7 @@ realistic scenarios:
|
||||
|
||||
Requirements:
|
||||
- A Redis instance with RediSearch enabled (e.g., Redis Stack)
|
||||
- agent-framework with the Redis extra installed: pip install "agent-framework[redis]"
|
||||
- agent-framework with the Redis extra installed: pip install "agent-framework-redis"
|
||||
- Optionally an OpenAI API key if enabling embeddings for hybrid search
|
||||
|
||||
Run:
|
||||
|
||||
@@ -7,7 +7,7 @@ conversational details. Pass it as a constructor argument to create_agent.
|
||||
|
||||
Requirements:
|
||||
- A Redis instance with RediSearch enabled (e.g., Redis Stack)
|
||||
- agent-framework with the Redis extra installed: pip install "agent-framework[redis]"
|
||||
- agent-framework with the Redis extra installed: pip install "agent-framework-redis"
|
||||
- Optionally an OpenAI API key if enabling embeddings for hybrid search
|
||||
|
||||
Run:
|
||||
|
||||
@@ -19,7 +19,7 @@ Redis context provider. It covers three scenarios:
|
||||
|
||||
Requirements:
|
||||
- A Redis instance with RediSearch enabled (e.g., Redis Stack)
|
||||
- agent-framework with the Redis extra installed: pip install "agent-framework[redis]"
|
||||
- agent-framework with the Redis extra installed: pip install "agent-framework-redis"
|
||||
- Optionally an OpenAI API key for the chat client in this demo
|
||||
|
||||
Run:
|
||||
@@ -30,15 +30,15 @@ import asyncio
|
||||
import os
|
||||
import uuid
|
||||
|
||||
from agent_framework_redis._provider import RedisProvider
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
from redisvl.utils.vectorize import OpenAITextVectorizer
|
||||
from agent_framework_redis._provider import RedisProvider
|
||||
from redisvl.extensions.cache.embeddings import EmbeddingsCache
|
||||
|
||||
from redisvl.utils.vectorize import OpenAITextVectorizer
|
||||
|
||||
# Please set the OPENAI_API_KEY and OPENAI_CHAT_MODEL_ID environment variables to use the OpenAI vectorizer
|
||||
# Recommend default for OPENAI_CHAT_MODEL_ID is gpt-4o-mini
|
||||
|
||||
|
||||
async def example_global_thread_scope() -> None:
|
||||
"""Example 1: Global thread_id scope (memories shared across all operations)."""
|
||||
print("1. Global Thread Scope Example:")
|
||||
@@ -70,7 +70,8 @@ async def example_global_thread_scope() -> None:
|
||||
"Before answering, always check for stored context containing information"
|
||||
),
|
||||
tools=[],
|
||||
context_providers=provider)
|
||||
context_providers=provider,
|
||||
)
|
||||
|
||||
# Store a preference in the global scope
|
||||
query = "Remember that I prefer technical responses with code examples when discussing programming."
|
||||
@@ -108,7 +109,7 @@ async def example_per_operation_thread_scope() -> None:
|
||||
api_config={"api_key": os.getenv("OPENAI_API_KEY")},
|
||||
cache=EmbeddingsCache(name="openai_embeddings_cache", redis_url="redis://localhost:6379"),
|
||||
)
|
||||
|
||||
|
||||
provider = RedisProvider(
|
||||
redis_url="redis://localhost:6379",
|
||||
index_name="redis_threads_dynamic",
|
||||
@@ -123,7 +124,7 @@ async def example_per_operation_thread_scope() -> None:
|
||||
vector_algorithm="hnsw",
|
||||
vector_distance_metric="cosine",
|
||||
)
|
||||
|
||||
|
||||
agent = client.create_agent(
|
||||
name="ScopedMemoryAssistant",
|
||||
instructions="You are an assistant with thread-scoped memory.",
|
||||
@@ -176,7 +177,7 @@ async def example_multiple_agents() -> None:
|
||||
api_config={"api_key": os.getenv("OPENAI_API_KEY")},
|
||||
cache=EmbeddingsCache(name="openai_embeddings_cache", redis_url="redis://localhost:6379"),
|
||||
)
|
||||
|
||||
|
||||
personal_provider = RedisProvider(
|
||||
redis_url="redis://localhost:6379",
|
||||
index_name="redis_threads_agents",
|
||||
@@ -188,13 +189,13 @@ async def example_multiple_agents() -> None:
|
||||
vector_algorithm="hnsw",
|
||||
vector_distance_metric="cosine",
|
||||
)
|
||||
|
||||
|
||||
personal_agent = client.create_agent(
|
||||
name="PersonalAssistant",
|
||||
instructions="You are a personal assistant that helps with personal tasks.",
|
||||
context_providers=personal_provider,
|
||||
)
|
||||
|
||||
|
||||
work_provider = RedisProvider(
|
||||
redis_url="redis://localhost:6379",
|
||||
index_name="redis_threads_agents",
|
||||
@@ -206,7 +207,7 @@ async def example_multiple_agents() -> None:
|
||||
vector_algorithm="hnsw",
|
||||
vector_distance_metric="cosine",
|
||||
)
|
||||
|
||||
|
||||
work_agent = client.create_agent(
|
||||
name="WorkAssistant",
|
||||
instructions="You are a work assistant that helps with professional tasks.",
|
||||
|
||||
Reference in New Issue
Block a user