Overview
AI Dev Kit provides a Fluent API that makes it incredibly easy to generate AI content with just a few lines of code.
What is the Fluent API?
The Fluent API is a set of extension methods that let you chain configuration calls in a natural, readable way:
string response = await "Explain quantum computing"
.GENCompletion()
.SetModel(OpenAIModel.GPT4o)
.ExecuteAsync();Key Concepts
1. Request Objects
All .GENXxx() methods create request objects that configure your AI generation task:
// This creates a ChatCompletionRequest, but doesn't send anything yet
ChatCompletionRequest request = "Hello, AI!".GENCompletion();2. Method Chaining
You can chain multiple configuration methods before execution:
var request = "Generate a logo"
.GENImage()
.SetModel(OpenAIModel.DallE3)
.SetSize(ImageSize._1024x1024)
.SetQuality(ImageQuality.HD);3. Execution
Nothing happens until you call .ExecuteAsync():
Available Request Types
Text Generation
Image Generation
Audio Generation
Video Generation
Embeddings & Moderation
File Operations
Model Operations
Voice Operations
Utilities
Next Steps
Fluent API Pattern - Deep dive into the pattern
Request vs Execute - Understanding the execution model
Provider Query Types - Advanced query options
Last updated