SlidesAIAgent
SlidesAIAgent class
Provides AI-powered features for processing presentations.
SlidesAIAgent
Name | Description |
---|---|
SlidesAIAgent(OpenAIWebClient) | SlidesAIAgent function |
Parameters:
Name | Type | Description |
---|---|---|
null | OpenAIWebClient | aiClient |
Returns: SlidesAIAgent
Error
Error | Condition |
---|---|
ArgumentNullException | AI client instance is not provided |
translate
Name | Description |
---|---|
translate (Presentation, String) | Translates a presentation to the specified language using AI. |
Parameters:
Name | Type | Description |
---|---|---|
presentation | Presentation | Target presentation |
language | String | Target language |
Returns: void
Exception
Error | Condition |
---|---|
OperationCanceledException | if translation fails Example usage: Presentation presentation = new Presentation(“Presentation.pptx”); try { IAIWebClient aiWebClient = new OpenAIWebClient(“gpt-4o-mini”, “apiKey”, null); SlidesAIAgent aiAgent = new SlidesAIAgent(aiWebClient); aiAgent.translate(presentation, “spanish”); presentation.save(“translated.pptx”, SaveFormat.Pptx); } finally { if (presentation != null) presentation.dispose(); } |