translate method
translate
Translates a presentation to the specified language using AI (synchronous version).
def translate(self, presentation, language):
...
| Parameter | Type | Description |
|---|---|---|
| presentation | IPresentation | Target presentation |
| language | str | Target language |
Remarks
The example below uses the default AsposeAIWebClient, which is created by the
parameterless SlidesAIAgent.#ctor constructor and connects to Aspose’s own LLM.
To use a different AI provider, supply your own LLM, or customize the connection
(for example, by providing your own HttpClient), pass an IAIWebClient
implementation to the Aspose.Slides.AI.SlidesAIAgent.#ctor(Aspose.Slides.A constructor. Available
implementations include:
Exceptions
| Exception | Description |
|---|---|
| RuntimeError(Proxy error(ArgumentNullException)) | Presentation instance is not provided |
| RuntimeError(Proxy error(ArgumentException)) | Language value can’t be None or empty |
See Also
- class
AsposeAIWebClient - class
IAIWebClient - class
IPresentation - class
OpenAICompatibleWebClient - class
OpenAIWebClient - class
SlidesAIAgent - module
aspose.slides.ai - library
Aspose.Slides