Gemini Api в Android: поле «лицензия» требуется для типа с серийным именем.JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Gemini Api в Android: поле «лицензия» требуется для типа с серийным именем.

Сообщение Anonymous »

Я пробую код шаблона для шаблона Gemini API Starter при создании нового проекта в Android Studio.
Шаблон по умолчанию использует модель «gemini-pro», которая устарела. давным-давно (шаблон не обновили), поэтому я изменил его на Gemini-1.5-flash.
Но я получаю ошибку синтаксического анализа:

Код: Выделить всё

com.google.ai.client.generativeai.type.SerializationException: Something went wrong while trying to deserialize a response from the server.
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.type.GoogleGenerativeAIException$Companion.from(Exceptions.kt:39)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.GenerativeModel.generateContent(GenerativeModel.kt:88)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.GenerativeModel$generateContent$1.invokeSuspend(Unknown Source:15)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W  Caused by: io.ktor.serialization.JsonConvertException: Illegal input: Field 'license' is required for type with serial name 'com.google.ai.client.generativeai.internal.api.server.CitationSources', but it was missing at path:  $ . c a n d i d a t e s [ 0 ] . c i t a t i o n M e t a d a t a . c i t a t i o n S o u r c e s [ 0 ] < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 4 9     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   i o . k t o r . s e r i a l i z a t i o n . k o t l i n x . K o t l i n x S e r i a l i z a t i o n C o n v e r t e r . d e s e r i a l i z e ( K o t l i n x S e r i a l i z a t i o n C o n v e r t e r . k t : 9 0 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 4 9     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   i o . k t o r . s e r i a l i z a t i o n . C o n t e n t C o n v e r t e r K t $ d e s e r i a l i z e $ $ i n l i n e d $ m a p $ 1 $ 2 . e m i t ( E m i t t e r s . k t : 2 2 4 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 4 9     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . c o r o u t i n e s . f l o w . F l o w K t _ _ B u i l d e r s K t $ a s F l o w $ $ i n l i n e d $ u n s a f e F l o w $ 3 . c o l l e c t ( S a f e C o l l e c t o r . c o m m o n . k t : 1 1 6 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 4 9     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   i o . k t o r . s e r i a l i z a t i o n . C o n t e n t C o n v e r t e r K t $ d e s e r i a l i z e $ $ i n l i n e d $ m a p $ 1 . c o l l e c t ( S a f e C o l l e c t o r . c o m m o n . k t : 1 1 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 4 9     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . c o r o u t i n e s . f l o w . F l o w K t _ _ R e d u c e K t . f i r s t O r N u l l ( R e d u c e . k t : 2 4 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 4 9     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . c o r o u t i n e s . f l o w . F l o w K t . f i r s t O r N u l l ( U n k n o w n Source:1)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.serialization.ContentConverterKt.deserialize(ContentConverter.kt:123)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.contentnegotiation.ContentNegotiation.convertResponse$ktor_client_content_negotiation(ContentNegotiation.kt:230)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invokeSuspend(ContentNegotiation.kt:262)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invoke(Unknown Source:13)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invoke(Unknown Source:6)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.HttpClient$4.invokeSuspend(HttpClient.kt:177)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.HttpClient$4.invoke(Unknown Source:11)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.HttpClient$4.invoke(Unknown Source:6)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.proceedWith(SuspendFunctionGun.kt:88)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invokeSuspend(HttpCallValidator.kt:142)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invoke(Unknown Source:13)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invoke(Unknown Source:6)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:98)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:88)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.APIController.generateContent(APIController.kt:198)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.APIController$generateContent$1.invokeSuspend(Unknown Source:15)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W      ...  6 more
2024-12-03 22:11:32.349  7350-7395  System.err              com.ayusch.genaitest                 W  Caused by: kotlinx.serialization.MissingFieldException: Field 'license' is required for type with serial name 'com.google.ai.client.generativeai.internal.api.server.CitationSources', but it was missing at path:  $ . c a n d i d a t e s [ 0 ] . c i t a t i o n M e t a d a t a . c i t a t i o n S o u r c e s [ 0 ] < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . j s o n . i n t e r n a l . S t r e a m i n g J s o n D e c o d e r . d e c o d e S e r i a l i z a b l e V a l u e ( S t r e a m i n g J s o n D e c o d e r . k t : 9 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . e n c o d i n g . A b s t r a c t D e c o d e r . d e c o d e S e r i a l i z a b l e V a l u e ( A b s t r a c t D e c o d e r . k t : 4 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . e n c o d i n g . A b s t r a c t D e c o d e r . d e c o d e S e r i a l i z a b l e E l e m e n t ( A b s t r a c t D e c o d e r . k t : 7 0 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . j s o n . i n t e r n a l . S t r e a m i n g J s o n D e c o d e r . d e c o d e S e r i a l i z a b l e E l e m e n t ( S t r e a m i n g J s o n D e c o d e r . k t : 1 6 5 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . e n c o d i n g . C o m p o s i t e D e c o d e r $ D e f a u l t I m p l s . d e c o d e S e r i a l i z a b l e E l e m e n t $ d e f a u l t ( D e c o d i n g . k t : 5 3 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . i n t e r n a l . C o l l e c t i o n L i k e S e r i a l i z e r . r e a d E l e m e n t ( C o l l e c t i o n S e r i a l i z e r s . k t : 8 0 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . i n t e r n a l . A b s t r a c t C o l l e c t i o n S e r i a l i z e r . r e a d E l e m e n t $ d e f a u l t ( C o l l e c t i o n S e r i a l i z e r s . k t : 5 1 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . i n t e r n a l . A b s t r a c t C o l l e c t i o n S e r i a l i z e r . m e r g e ( C o l l e c t i o n S e r i a l i z e r s . k t : 3 6 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . i n t e r n a l . A b s t r a c t C o l l e c t i o n S e r i a l i z e r . d e s e r i a l i z e ( C o l l e c t i o n S e r i a l i z e r s . k t : 4 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . j s o n . i n t e r n a l . S t r e a m i n g J s o n D e c o d e r . d e c o d e S e r i a l i z a b l e V a l u e ( S t r e a m i n g J s o n D e c o d e r . k t : 7 0 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . e n c o d i n g . A b s t r a c t D e c o d e r . d e c o d e S e r i a l i z a b l e V a l u e ( A b s t r a c t D e c o d e r . k t : 4 3 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . e n c o d i n g . A b s t r a c t D e c o d e r . d e c o d e S e r i a l i z a b l e E l e m e n t ( A b s t r a c t D e c o d e r . k t : 7 0 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   k o t l i n x . s e r i a l i z a t i o n . j s o n . i n t e r n a l . S t r e a m i n g J s o n D e c o d e r . d e c o d e S e r i a l i z a b l e E l e m e n t ( S t r e a m i n g J s o n D e c o d e r . k t : 1 6 5 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5     S y s t e m . e r r                             c o m . a y u s c h . g e n a i t e s t                                   W             a t   c o m . g o o g l e . a i . c l i e n t . g e n e r a t i v e a i . i n t e r n a l . a p i . s e r v e r . C i t a t i o n M e t a d a t a $ $ s e r i a l i z e r . d e s e r i a l i z e ( T y p e s . k t : 5 9 ) < b r   / > 2 0 2 4 - 1 2 - 0 3   2 2 : 1 1 : 3 2 . 3 5 0     7 3 5 0 - 7 3 9 5    System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.server.CitationMetadata$$serializer.deserialize(Types.kt:59)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:79)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.server.Candidate$$serializer.deserialize(Types.kt:51)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.server.Candidate$$serializer.deserialize(Types.kt:51)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:165)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:533)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:79)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.GenerateContentResponse$$serializer.deserialize(Response.kt:26)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.GenerateContentResponse$$serializer.deserialize(Response.kt:26)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.Json.decodeFromString(Json.kt:107)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:82)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      ...  36 more
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W  Caused by: kotlinx.serialization.MissingFieldException: Field 'license' is required for type with serial name 'com.google.ai.client.generativeai.internal.api.server.CitationSources', but it was missing
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.server.CitationSources.(Types.kt:64)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.server.CitationSources$$serializer.deserialize(Types.kt:64)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at com.google.ai.client.generativeai.internal.api.server.CitationSources$$serializer.deserialize(Types.kt:64)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70)
2024-12-03 22:11:32.350  7350-7395  System.err              com.ayusch.genaitest                 W      ... 72 more

Кто-нибудь сталкивался с этим?
Видел похожий вопрос, где API не возвращал обязательное поле, но оно предположительно было исправлено (было еще одно поле): Gemini Api Android: SerializationException при десериализации ответа с сервера
Заранее спасибо

Подробнее здесь: https://stackoverflow.com/questions/792 ... erial-name
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»