Erste Schritte mit SmartRAG
Installieren und konfigurieren Sie SmartRAG in Ihrer .NET-Anwendung in nur wenigen Minuten
Installation
SmartRAG ist als NuGet-Paket verfügbar. Wählen Sie Ihre bevorzugte Installationsmethode:
.NET CLI
Package Manager
Package Reference
dotnet add package SmartRAG
Install-Package SmartRAG
<PackageReference Include="SmartRAG" Version="1.1.0" />
Grundkonfiguration
Konfigurieren Sie SmartRAG in Ihrer Program.cs
oder Startup.cs
:
// Program.cs
using SmartRAG;
var builder = WebApplication.CreateBuilder(args);
// SmartRAG-Services hinzufügen
builder.Services.AddSmartRAG(options =>
{
options.AIProvider = AIProvider.Anthropic;
options.StorageProvider = StorageProvider.Qdrant;
options.ApiKey = "your-api-key";
});
var app = builder.Build();
Schnelles Beispiel
Hier ist ein einfaches Beispiel zum Einstieg:
// Document-Service injizieren
public class DocumentController : ControllerBase
{
private readonly IDocumentService _documentService;
public DocumentController(IDocumentService documentService)
{
_documentService = documentService;
}
[HttpPost("upload")]
public async Task<IActionResult> UploadDocument(IFormFile file)
{
var document = await _documentService.UploadDocumentAsync(file);
return Ok(document);
}
[HttpPost("search")]
public async Task<IActionResult> Search([FromBody] string query)
{
var results = await _documentService.SearchAsync(query);
return Ok(results);
}
}
Nächste Schritte
Jetzt, da Sie SmartRAG installiert und konfiguriert haben, erkunden Sie diese Funktionen:
Konfiguration
Erfahren Sie mehr über erweiterte Konfigurationsoptionen und bewährte Praktiken.
KonfigurierenBenötigen Sie Hilfe?
Wenn Sie auf Probleme stoßen oder Unterstützung benötigen: