Prompt — Azure OpenAI Library

Welcome to the documentation for Prompt, a lightweight .NET 8 library for Azure OpenAI chat completions.

Overview

Prompt provides a clean, minimal API for integrating Azure OpenAI into .NET applications. It handles the boilerplate — connection pooling, retry policies, environment configuration — so you can focus on building.

Key Features

  • Single-call promptsMain.GetResponseAsync() for quick one-shot interactions
  • Multi-turn conversationsConversation maintains full message history across turns
  • Template enginePromptTemplate with {{variable}} placeholders and composition
  • Prompt chainingPromptChain pipes outputs between steps for multi-step reasoning
  • Model presetsPromptOptions with factory methods for code generation, creative writing, summarization, and data extraction
  • Automatic retries — Exponential backoff for 429 rate-limit and 503 service errors
  • Serialization — Save/load conversations, templates, and chains as JSON
  • Thread-safe — Singleton client with connection pooling, safe for concurrent use

Quick Start

dotnet add package prompt-llm-aoi
using Prompt;

// One-shot prompt
string? response = await Main.GetResponseAsync("Explain quantum computing.");
Console.WriteLine(response);

Documentation

Guide Description
Getting Started Installation, configuration, and first prompt
Conversations Multi-turn dialogue with history and serialization
Templates Reusable prompts with {{variables}} and composition
Prompt Chains Multi-step reasoning pipelines
Model Options Temperature, tokens, penalties, and presets
Routing & Orchestration Intent-based routing and DAG workflow orchestration
Streaming Real-time parsing of streaming responses
Autonomous Optimization AutoImprover, Autopilot, Evolution Engine, Feedback Loop
Resilience & Intelligence 19 autonomous engines: Antifragile, BlackSwan, Chaos, CircuitBreaker, SelfHealer, Swarm, and more
Error Handling Exception types, retry behavior, and production patterns
Migration Guide Upgrading between versions with breaking change details
API Reference Full class and method documentation