@@ -37,7 +37,7 @@ class CellWithErrorSelection(BaseModel):
37
37
# the type of message used to chat with the agent
38
38
class ChatRequest (BaseModel ):
39
39
prompt : str
40
- selection : Optional [Selection ]
40
+ selection : Optional [Selection ] = None
41
41
42
42
43
43
class StopRequest (BaseModel ):
@@ -54,7 +54,7 @@ class StopRequest(BaseModel):
54
54
55
55
class ClearRequest (BaseModel ):
56
56
type : Literal ["clear" ] = "clear"
57
- target : Optional [str ]
57
+ target : Optional [str ] = None
58
58
"""
59
59
Message ID of the HumanChatMessage to delete an exchange at.
60
60
If not provided, this requests the backend to clear all messages.
@@ -67,8 +67,8 @@ class ChatUser(BaseModel):
67
67
initials : str
68
68
name : str
69
69
display_name : str
70
- color : Optional [str ]
71
- avatar_url : Optional [str ]
70
+ color : Optional [str ] = None
71
+ avatar_url : Optional [str ] = None
72
72
73
73
74
74
class ChatClient (ChatUser ):
@@ -148,7 +148,7 @@ class HumanChatMessage(BaseModel):
148
148
`prompt` and `selection`."""
149
149
prompt : str
150
150
"""The prompt typed into the chat input by the user."""
151
- selection : Optional [Selection ]
151
+ selection : Optional [Selection ] = None
152
152
"""The selection included with the prompt, if any."""
153
153
client : ChatClient
154
154
@@ -238,8 +238,8 @@ class IndexMetadata(BaseModel):
238
238
239
239
240
240
class DescribeConfigResponse (BaseModel ):
241
- model_provider_id : Optional [str ]
242
- embeddings_provider_id : Optional [str ]
241
+ model_provider_id : Optional [str ] = None
242
+ embeddings_provider_id : Optional [str ] = None
243
243
send_with_shift_enter : bool
244
244
fields : Dict [str , Dict [str , Any ]]
245
245
# when sending config over REST API, do not include values of the API keys,
@@ -248,7 +248,7 @@ class DescribeConfigResponse(BaseModel):
248
248
# timestamp indicating when the configuration file was last read. should be
249
249
# passed to the subsequent UpdateConfig request.
250
250
last_read : int
251
- completions_model_provider_id : Optional [str ]
251
+ completions_model_provider_id : Optional [str ] = None
252
252
completions_fields : Dict [str , Dict [str , Any ]]
253
253
254
254
@@ -258,16 +258,16 @@ def forbid_none(cls, v):
258
258
259
259
260
260
class UpdateConfigRequest (BaseModel ):
261
- model_provider_id : Optional [str ]
262
- embeddings_provider_id : Optional [str ]
263
- send_with_shift_enter : Optional [bool ]
264
- api_keys : Optional [Dict [str , str ]]
265
- fields : Optional [Dict [str , Dict [str , Any ]]]
261
+ model_provider_id : Optional [str ] = None
262
+ embeddings_provider_id : Optional [str ] = None
263
+ send_with_shift_enter : Optional [bool ] = None
264
+ api_keys : Optional [Dict [str , str ]] = None
265
+ fields : Optional [Dict [str , Dict [str , Any ]]] = None
266
266
# if passed, this will raise an Error if the config was written to after the
267
267
# time specified by `last_read` to prevent write-write conflicts.
268
- last_read : Optional [int ]
269
- completions_model_provider_id : Optional [str ]
270
- completions_fields : Optional [Dict [str , Dict [str , Any ]]]
268
+ last_read : Optional [int ] = None
269
+ completions_model_provider_id : Optional [str ] = None
270
+ completions_fields : Optional [Dict [str , Dict [str , Any ]]] = None
271
271
272
272
_validate_send_wse = validator ("send_with_shift_enter" , allow_reuse = True )(
273
273
forbid_none
@@ -280,12 +280,12 @@ class GlobalConfig(BaseModel):
280
280
"""Model used to represent the config by ConfigManager. This is exclusive to
281
281
the backend and should never be sent to the client."""
282
282
283
- model_provider_id : Optional [str ]
284
- embeddings_provider_id : Optional [str ]
283
+ model_provider_id : Optional [str ] = None
284
+ embeddings_provider_id : Optional [str ] = None
285
285
send_with_shift_enter : bool
286
286
fields : Dict [str , Dict [str , Any ]]
287
287
api_keys : Dict [str , str ]
288
- completions_model_provider_id : Optional [str ]
288
+ completions_model_provider_id : Optional [str ] = None
289
289
completions_fields : Dict [str , Dict [str , Any ]]
290
290
291
291
0 commit comments