Class OpenAISummaryCopilot
OpenAISummaryCopilot sınıfı
AI modellerini kullanarak belge özetleri alma işlevselliği sağlar. OpenAI istemcisi oluşturma, seçenekleri yapılandırma ve özet yardımcı pilotunu kullanma örneği.
// Create AI client.
var openAiClient = OpenAIClient
.CreateWithApiKey(ApiKey) // Create OpenAI client with the API key.
.WithProject("proj_RoywW1DLqDC89GoAW5ngoVN8") // Configure optional parameters.
.Build();
// Create copilot options.
var options = OpenAISummaryCopilotOptions
.Create() // Create options like this, or...
//.Create(options => { options.Model = OpenAIModels.Gpt35Turbo; }) // ...create using delegate.
.WithTemperature(0.5) // Configure other optional parameters.
.WithDocument("DocumentInputPath") // .WithDocument methods allows to add text, pdf and paths to documents.
.WithDocuments(new List<TextDocument>()); // .WithDocuments methods allows to add text, pdf and path collections.
// Create summary copilot.
var summaryCopilot = AICopilotFactory.CreateSummaryCopilot(openAiClient, options);
// Get summary text.
string summaryText = await summaryCopilot.GetSummaryAsync();
// Get summary document.
Document summaryDocument = await summaryCopilot.GetSummaryDocumentAsync();
// Get summary document with page info.
Document summaryDocumentWithPageInfo = await summaryCopilot.GetSummaryDocumentAsync(new PageInfo());
// Save summary as PDF document.
await summaryCopilot.SaveSummaryAsync("outputPath");
// Save summary with specified format.
await summaryCopilot.SaveSummaryAsync("outputPath", SaveFormat.DocX);
public class OpenAISummaryCopilot : ISummaryCopilot
Yapıcılar
Ad | Açıklama |
---|
OpenAISummaryCopilot(IOpenAIClient, ISummaryCopilotOptions<OpenAISummaryCopilotOptions>) | OpenAISummaryCopilot sınıfının yeni bir örneğini başlatır. |
Özellikler
Yöntemler
Ayrıca Bakınız