Azure.AI.Agents.Persistent (.NET)
Build persistent AI agents with Azure AI SDK for .NET
Developers need to integrate persistent AI agents into .NET applications with proper thread management and streaming. This skill provides complete SDK patterns for agent CRUD, conversation flows, function calling, and file search using Azure AI Agents.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "Azure.AI.Agents.Persistent (.NET)". Create a math tutor agent with code interpreter enabled
Resultado esperado:
Agent created successfully with ID 'asst_abc123'. The agent is configured with gpt-4o-mini model and CodeInterpreterTool. Instructions: 'You are a personal math tutor. Write and run code to answer math questions.' Ready to create threads and process user messages.
Usando "Azure.AI.Agents.Persistent (.NET)". Stream a response from the agent for user question about solving 3x + 11 = 14
Resultado esperado:
Streaming output: 'To solve 3x + 11 = 14, I need to isolate x. First, subtract 11 from both sides: 3x = 3. Then divide by 3: x = 1. Let me verify this with code.' Run completed with final answer showing x equals 1.
Auditoría de seguridad
SeguroDocumentation-only skill with no executable code. Static analysis found 0 security issues with risk score 0/100. The SKILL.md file contains legitimate Azure SDK usage examples for agent creation, thread management, streaming, and function calling. No security concerns identified.
Puntuación de calidad
Lo que puedes crear
Build a Math Tutor Agent
Create a persistent agent that solves math problems using code interpreter. Users submit questions via thread messages, and the agent executes Python code to compute answers with step-by-step explanations.
Document Search Assistant
Implement an agent with vector store file search to answer questions from uploaded documentation. Upload files, create vector stores, and query through natural language conversations.
Weather Bot with Function Calling
Build an agent that calls external weather APIs through function definitions. Define tool schemas, handle RequiresAction responses, and return formatted weather data to users.
Prueba estos prompts
Create a persistent AI agent using Azure.AI.Agents.Persistent SDK. The agent should use gpt-4o-mini model with instructions to act as a helpful assistant. Show authentication with DefaultAzureCredential and basic agent creation code.
Show me how to stream agent responses in real-time using CreateRunStreamingAsync. Include handling for MessageContentUpdate and run status events like RunCreated and RunCompleted.
Create an agent with a custom function tool for getting weather data. Define the FunctionToolDefinition with JSON schema parameters, handle RequiresAction status, and submit tool outputs back to the run.
Set up file search capabilities for an agent. Upload a document file, create a vector store with the file ID, configure FileSearchToolResource, and create an agent that can search documents to answer questions.
Mejores prácticas
- Always dispose clients using 'using' statements or explicit disposal to release resources
- Poll agent runs with 500ms delays between status checks to avoid rate limiting
- Delete threads, agents, and vector stores when finished to clean up resources
Evitar
- Do not skip error handling for RequestFailedException when calling agent APIs
- Avoid hardcoding credentials or endpoint URLs directly in application code
- Avoid tight polling loops without delays which can trigger rate limits
Preguntas frecuentes
What is the difference between PersistentAgentsClient and Azure.AI.Projects?
How do I handle function calling in a streaming run?
What authentication methods are supported?
How long do threads and messages persist?
Can I use multiple tools with a single agent?
What are the rate limits for agent operations?
Detalles del desarrollador
Autor
sickn33Licencia
MIT
Repositorio
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-agents-persistent-dotnetRef.
main
Estructura de archivos
📄 SKILL.md