GenerateContentError
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public enum GenerateContentError : Error
Errors that occur when generating content from a model.
-
An internal error occurred. See the underlying error for more context.
Declaration
Swift
case internalError(underlying: Error)
-
An error occurred when constructing the prompt. Examine the related error for details.
Declaration
Swift
case promptImageContentError(underlying: Error)
-
A prompt was blocked. See the response’s
promptFeedback.blockReason
for more information.Declaration
Swift
case promptBlocked(response: GenerateContentResponse)
-
A response didn’t fully complete. See the
FinishReason
for more information.Declaration
Swift
case responseStoppedEarly(reason: FinishReason, response: GenerateContentResponse)