AICompletionResult¶
Represents the answer of an AI completion.
Capabilities¶
Properties¶
- AICompletionResult.Content: The text of the answer, exactly as the model returned it. Empty when the model returned only files.
- AICompletionResult.Data: The answer parsed as JSON when Content is valid JSON; otherwise the text itself. Unlike ToJson, it never throws, so check its type before reading properties.
- AICompletionResult.Files: The files returned by the model, in the order the model returned them. Empty for text-only answers.
- AICompletionResult.Model: The name of the model that answered the request.
- AICompletionResult.Provider: The name of the provider that answered the request.
Methods¶
- AICompletionResult.ToBase64: Returns Content encoded as UTF-8 and then as Base64, for example to store the answer as a file. Use the
ToBase64method of an item of Files for binary content. - AICompletionResult.ToJson: Parses Content as JSON.
- AICompletionResult.ToXml: Parses Content as XML.