New
google_generative_ai version 0.4.1
- Concatenate multiple
TextPartinto thetextString in case the model replies with more than one part. - Fix handling of
formatargument toSchema.numberandSchema.integer. - Export
UsageMetadata. - Include the full
GenerateContentRequest(previously omittedsafetySettings,generationConfig,tools,toolConfig, andsystemInstruction) incountTokensrequests. This aligns the token count with the token count the backend will see in practice for agenerateContentrequest. - Add a
textgetter onCandidateto make it easer to retrieve the text from candidates other than the first in a response.