You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Use this to review slides for accuracy
4
+
---
5
+
Review the given slides for consistency with the code samples in the repository.
6
+
7
+
Use the markitdown skill to convert the PDF to markdown first.
8
+
9
+
Point out any errors, inconsistencies, or areas that may need clarification. Provide specific feedback on how to improve the slides to better align with the code and concepts presented in the repository.
description: Use this prompt to update the Spanish translations in the repo.
4
+
model: GPT-5.2 (copilot)
5
+
---
6
+
7
+
Update the Spanish translations in the repo according to the guidelines in AGENTS.md. Ensure there are spanish equivalents of each english example. Make sure to keep the translations consistent with the original content and maintain the technical accuracy of the code.
description: Converts PDF files to Markdown using Microsoft's markitdown package. Use this skill when the user asks to convert a PDF to Markdown, extract text from a PDF, or read/parse PDF content.
4
+
argument-hint: "[path to file]"
5
+
---
6
+
7
+
# PDF to Markdown Conversion
8
+
9
+
This skill converts PDF files to Markdown format using [Microsoft's markitdown](https://github.com/microsoft/markitdown) package.
10
+
11
+
## When to use
12
+
13
+
- User asks to convert a PDF to Markdown
14
+
- User wants to extract text content from a PDF
15
+
- User needs to read or parse a PDF document
16
+
- User asks to summarize or analyze a PDF file
17
+
18
+
## How to use
19
+
20
+
Use `uvx` to run markitdown directly. Pick the dependency group matching the file type:
This repository contains many examples of using the Microsoft Agent Framework in Python (agent-framework), sometimes abbreviated as MAF.
4
+
5
+
The agent-framework GitHub repo is here:
6
+
https://github.com/microsoft/agent-framework
7
+
It contains both Python and .NET agent framework code, but we are only using the Python packages in this repo.
8
+
9
+
MAF is changing rapidly still, so we sometimes need to check the repo changelog and issues to see if there are any breaking changes that might affect our code.
MAF documentation is available on Microsoft Learn here:
14
+
https://learn.microsoft.com/agent-framework/
15
+
When available, the MS Learn MCP server can be used to explore the documentation, ask questions, and get code examples.
16
+
17
+
## Package management
18
+
19
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management. Use `uv` commands instead of `pip`:
20
+
21
+
```bash
22
+
uv add <package>
23
+
uv sync
24
+
```
25
+
26
+
## Spanish translations
27
+
28
+
There are Spanish equivalents of each example in /examples/spanish.
29
+
30
+
Each example .py file should have a corresponding file with the same name under /examples/spanish/ that is the translation of the original, but with the same code. Here's a guide on what should be translated vs. what should be left in English:
31
+
32
+
* Comments: Spanish
33
+
* Docstrings: Spanish
34
+
* System prompts (agent instructions): Spanish
35
+
* Tool descriptions (metadata like description=): English
36
+
* Parameter descriptions (Field(description=...)): English
37
+
* Identifiers (functions/classes/vars): English
38
+
* User-facing output/data (e.g., example responses, sample values): Spanish
39
+
* HITL control words: bilingual (approve/aprobar, exit/salir)
40
+
41
+
Use informal (tuteo) LATAM Spanish, tu not usted, puedes not podes, etc. The content is technical so if a word is best kept in English, then do so.
42
+
43
+
The /examples/spanish/README.md corresponds to the root README.md and should be kept in sync with it, but translated to Spanish.
44
+
45
+
## Debugging Azure Python SDK HTTP requests
46
+
47
+
When debugging HTTP interactions between Azure Python SDKs (like `azure-ai-evaluation`) and Azure services, there are three levels of logging you can enable:
48
+
49
+
### 1. Azure SDK logger (request headers and URLs)
50
+
51
+
Set the Azure SDK loggers to DEBUG level to see request URLs, headers, and status codes:
### 2. Raw HTTP wire data (request/response headers)
62
+
63
+
Enable `http.client` debug logging to see the raw HTTP wire protocol, including request and response headers:
64
+
65
+
```python
66
+
import http.client
67
+
http.client.HTTPConnection.debuglevel =1
68
+
```
69
+
70
+
Note: Response bodies will typically not be visible at this level because Azure SDKs use gzip compression, and `http.client` logs the raw compressed bytes.
71
+
72
+
### 3. Decompressed response bodies
73
+
74
+
To see actual response bodies, monkey-patch the Azure SDK's `HttpLoggingPolicy.on_response` method. This works because `response.http_response.body()` returns the decompressed content:
75
+
76
+
```python
77
+
from azure.core.pipeline.policies import HttpLoggingPolicy
Copy file name to clipboardExpand all lines: README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,8 @@ A related option is VS Code Dev Containers, which will open the project in your
58
58
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
59
59
4. Continue with the steps to run the examples
60
60
61
+
The dev container includes a Redis server, which is used by the `agent_history_redis.py` example.
62
+
61
63
### Local environment
62
64
63
65
1. Make sure the following tools are installed:
@@ -79,6 +81,18 @@ A related option is VS Code Dev Containers, which will open the project in your
79
81
uv sync
80
82
```
81
83
84
+
4. *Optional:* To run the `agent_history_redis.py` example, you need a Redis server running locally:
85
+
86
+
```shell
87
+
docker run -d -p 6379:6379 redis:7-alpine
88
+
```
89
+
90
+
5. *Optional:* To run the PostgreSQL examples (`agent_knowledge_postgres.py`, `agent_knowledge_pg.py`, `agent_knowledge_pg_rewrite.py`), you need PostgreSQL with pgvector running locally:
91
+
92
+
```shell
93
+
docker run -d -p 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=LocalPasswordOnly pgvector/pgvector:pg17
94
+
```
95
+
82
96
## Configuring model providers
83
97
84
98
These examples can be run with Azure AI Foundry, OpenAI.com, or GitHub Models, depending on the environment variables you set. All the scripts reference the environment variables from a `.env` file, and an example `.env.sample` file is provided. Host-specific instructions are below.
@@ -125,6 +139,12 @@ This project includes infrastructure as code (IaC) to provision Azure OpenAI dep
125
139
azd auth login --use-device-code
126
140
```
127
141
142
+
If you are using a tenant besides the default tenant, you may need to also login with Azure CLI to that tenant:
143
+
144
+
```shell
145
+
az login --tenant your-tenant-id
146
+
```
147
+
128
148
3. Provision the OpenAI account:
129
149
130
150
```shell
@@ -165,17 +185,22 @@ You can run the examples in this repository by executing the scripts in the `exa
165
185
| [agent_basic.py](examples/agent_basic.py) | A basic informational agent. |
166
186
| [agent_tool.py](examples/agent_tool.py) | An agent with a single weather tool. |
167
187
| [agent_tools.py](examples/agent_tools.py) | A weekend planning agent with multiple tools. |
188
+
| [agent_session.py](examples/agent_session.py) | In-memory sessions for multi-turn conversations with memory across messages. |
189
+
| [agent_history_redis.py](examples/agent_history_redis.py) | Persistent chat history with Redis for conversation history that survives restarts. |
168
190
| [agent_supervisor.py](examples/agent_supervisor.py) | A supervisor orchestrating activity and recipe sub-agents. |
169
191
| [workflow_magenticone.py](examples/workflow_magenticone.py) | A MagenticOne multi-agent workflow. |
170
192
| [workflow_hitl.py](examples/workflow_hitl.py) | Human-in-the-loop (HITL) for tool-enabled agents with human feedback. |
171
193
| [agent_middleware.py](examples/agent_middleware.py) | Agent, chat, and function middleware for logging, timing, and blocking. |
194
+
| [agent_knowledge_sqlite.py](examples/agent_knowledge_sqlite.py) | Knowledge retrieval (RAG) using a custom context provider with SQLite FTS5. |
195
+
| [agent_knowledge_postgres.py](examples/agent_knowledge_postgres.py) | Knowledge retrieval (RAG) with PostgreSQL hybrid search (pgvector + full-text) using Reciprocal Rank Fusion. |
172
196
| [agent_mcp_remote.py](examples/agent_mcp_remote.py) | An agent using a remote MCP server (Microsoft Learn) for documentation search. |
173
197
| [agent_mcp_local.py](examples/agent_mcp_local.py) | An agent connected to a local MCP server (e.g. for expense logging). |
174
198
| [openai_tool_calling.py](examples/openai_tool_calling.py) | Tool calling with the low-level OpenAI SDK, showing manual tool dispatch. |
175
199
| [workflow_basic.py](examples/workflow_basic.py) | A workflow-based agent. |
176
200
| [agent_otel_aspire.py](examples/agent_otel_aspire.py) | An agent with OpenTelemetry tracing, metrics, and structured logs exported to the [Aspire Dashboard](https://aspire.dev/dashboard/standalone/). |
177
201
| [agent_otel_appinsights.py](examples/agent_otel_appinsights.py) | An agent with OpenTelemetry tracing, metrics, and structured logs exported to [Azure Application Insights](https://learn.microsoft.com/azure/azure-monitor/app/app-insights-overview). Requires Azure provisioning via `azd provision`. |
178
202
| [agent_evaluation.py](examples/agent_evaluation.py) | Evaluate a travel planner agent using [Azure AI Evaluation](https://learn.microsoft.com/azure/ai-foundry/concepts/evaluation-evaluators/agent-evaluators) agent evaluators (IntentResolution, ToolCallAccuracy, TaskAdherence, ResponseCompleteness). Optionally set `AZURE_AI_PROJECT` in `.env` to log results to [Azure AI Foundry](https://learn.microsoft.com/azure/ai-foundry/how-to/develop/agent-evaluate-sdk). |
203
+
| [agent_redteam.py](examples/agent_redteam.py) | Red-team a financial advisor agent using [Azure AI Evaluation](https://learn.microsoft.com/azure/ai-foundry/how-to/develop/red-teaming-agent) to test resilience against adversarial attacks across risk categories (Violence, HateUnfairness, Sexual, SelfHarm). Requires `AZURE_AI_PROJECT` in `.env`. |
179
204
180
205
## Using the Aspire Dashboard for telemetry
181
206
@@ -190,7 +215,7 @@ The Aspire Dashboard runs automatically as a service alongside the dev container
190
215
2. Run the example:
191
216
192
217
```sh
193
-
uv run agent_otel_aspire.py
218
+
uv run examples/agent_otel_aspire.py
194
219
```
195
220
196
221
3. Open the dashboard at <http://localhost:18888> and explore:
0 commit comments