@@ -1137,8 +1137,11 @@ def from_dict(cls, generation_config_dict: Dict[str, Any]) -> "GenerationConfig"
1137
1137
)
1138
1138
return cls ._from_gapic (raw_generation_config = raw_generation_config )
1139
1139
1140
+ def to_dict (self ) -> Dict [str , Any ]:
1141
+ return type (self ._raw_generation_config ).to_dict (self ._raw_generation_config )
1142
+
1140
1143
def __repr__ (self ):
1141
- return self ._raw_tool .__repr__ ()
1144
+ return self ._raw_generation_config .__repr__ ()
1142
1145
1143
1146
1144
1147
class Tool :
@@ -1249,6 +1252,9 @@ def from_dict(cls, tool_dict: Dict[str, Any]) -> "Tool":
1249
1252
raw_tool = gapic_tool_types .Tool (tool_dict )
1250
1253
return cls ._from_gapic (raw_tool = raw_tool )
1251
1254
1255
+ def to_dict (self ) -> Dict [str , Any ]:
1256
+ return type (self ._raw_tool ).to_dict (self ._raw_tool )
1257
+
1252
1258
def __repr__ (self ):
1253
1259
return self ._raw_tool .__repr__ ()
1254
1260
@@ -1378,6 +1384,9 @@ def from_dict(cls, response_dict: Dict[str, Any]) -> "GenerationResponse":
1378
1384
)
1379
1385
return cls ._from_gapic (raw_response = raw_response )
1380
1386
1387
+ def to_dict (self ) -> Dict [str , Any ]:
1388
+ return type (self ._raw_response ).to_dict (self ._raw_response )
1389
+
1381
1390
def __repr__ (self ):
1382
1391
return self ._raw_response .__repr__ ()
1383
1392
@@ -1414,6 +1423,9 @@ def from_dict(cls, candidate_dict: Dict[str, Any]) -> "Candidate":
1414
1423
raw_candidate = gapic_content_types .Candidate (candidate_dict )
1415
1424
return cls ._from_gapic (raw_candidate = raw_candidate )
1416
1425
1426
+ def to_dict (self ) -> Dict [str , Any ]:
1427
+ return type (self ._raw_candidate ).to_dict (self ._raw_candidate )
1428
+
1417
1429
def __repr__ (self ):
1418
1430
return self ._raw_candidate .__repr__ ()
1419
1431
@@ -1480,6 +1492,9 @@ def from_dict(cls, content_dict: Dict[str, Any]) -> "Content":
1480
1492
raw_content = gapic_content_types .Content (content_dict )
1481
1493
return cls ._from_gapic (raw_content = raw_content )
1482
1494
1495
+ def to_dict (self ) -> Dict [str , Any ]:
1496
+ return type (self ._raw_content ).to_dict (self ._raw_content )
1497
+
1483
1498
def __repr__ (self ):
1484
1499
return self ._raw_content .__repr__ ()
1485
1500
@@ -1584,7 +1599,7 @@ def from_function_response(name: str, response: Dict[str, Any]) -> "Part":
1584
1599
)
1585
1600
1586
1601
def to_dict (self ) -> Dict [str , Any ]:
1587
- return self ._raw_part .to_dict ()
1602
+ return type ( self ._raw_part ) .to_dict (self . _raw_part )
1588
1603
1589
1604
@property
1590
1605
def text (self ) -> str :
0 commit comments