1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetSnapshotRidByUserMessageIdRequest {
4 #[prost(string, tag = "1")]
5 pub conversation_rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub message_id: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct GetSnapshotRidByUserMessageIdResponse {
11 #[prost(
12 oneof = "get_snapshot_rid_by_user_message_id_response::RestorePoint",
13 tags = "1, 2"
14 )]
15 pub restore_point: ::core::option::Option<
16 get_snapshot_rid_by_user_message_id_response::RestorePoint,
17 >,
18}
19pub mod get_snapshot_rid_by_user_message_id_response {
21 #[derive(Clone, PartialEq, ::prost::Oneof)]
22 pub enum RestorePoint {
23 #[prost(string, tag = "1")]
24 SnapshotRid(::prost::alloc::string::String),
25 #[prost(string, tag = "2")]
26 CommitId(::prost::alloc::string::String),
27 }
28}
29#[derive(Clone, Copy, PartialEq, ::prost::Message)]
30pub struct ReadOnlyMode {}
31#[derive(Clone, Copy, PartialEq, ::prost::Message)]
32pub struct EditMode {
33 #[prost(bool, optional, tag = "1")]
34 pub auto_accept: ::core::option::Option<bool>,
35}
36#[derive(Clone, Copy, PartialEq, ::prost::Message)]
37pub struct ConversationMode {
38 #[prost(oneof = "conversation_mode::Mode", tags = "1, 2")]
39 pub mode: ::core::option::Option<conversation_mode::Mode>,
40}
41pub mod conversation_mode {
43 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
44 pub enum Mode {
45 #[prost(message, tag = "1")]
46 ReadOnly(super::ReadOnlyMode),
47 #[prost(message, tag = "2")]
48 Edit(super::EditMode),
49 }
50}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct ToolApprovalResult {
53 #[prost(string, tag = "1")]
54 pub tool_call_id: ::prost::alloc::string::String,
55 #[prost(oneof = "tool_approval_result::Response", tags = "2, 3")]
56 pub response: ::core::option::Option<tool_approval_result::Response>,
57}
58pub mod tool_approval_result {
60 #[derive(Clone, PartialEq, ::prost::Oneof)]
61 pub enum Response {
62 #[prost(message, tag = "2")]
63 Approved(super::ToolApprovedResponse),
64 #[prost(message, tag = "3")]
65 Denied(super::ToolDeniedResponse),
66 }
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct ToolApprovedResponse {
70 #[prost(string, optional, tag = "1")]
71 pub override_args: ::core::option::Option<::prost::alloc::string::String>,
72}
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct ToolDeniedResponse {
75 #[prost(string, tag = "2")]
76 pub denial_reason: ::prost::alloc::string::String,
77}
78#[derive(Clone, Copy, PartialEq, ::prost::Message)]
79pub struct RetryRequest {}
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct UserPromptRequest {
82 #[prost(message, optional, tag = "1")]
83 pub message: ::core::option::Option<UserModelMessage>,
84 #[prost(message, repeated, tag = "2")]
85 pub images: ::prost::alloc::vec::Vec<ImagePart>,
86}
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct ToolApprovalRequest {
89 #[prost(message, repeated, tag = "1")]
90 pub tool_approvals: ::prost::alloc::vec::Vec<ToolApprovalResult>,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct StreamChatRequest {
94 #[prost(string, tag = "1")]
95 pub conversation_rid: ::prost::alloc::string::String,
96 #[deprecated]
97 #[prost(message, optional, tag = "2")]
98 pub message: ::core::option::Option<UserModelMessage>,
99 #[deprecated]
100 #[prost(message, repeated, tag = "3")]
101 pub images: ::prost::alloc::vec::Vec<ImagePart>,
102 #[deprecated]
103 #[prost(message, repeated, tag = "6")]
104 pub tool_approvals: ::prost::alloc::vec::Vec<ToolApprovalResult>,
105 #[prost(oneof = "stream_chat_request::RequestType", tags = "7, 8, 9")]
106 pub request_type: ::core::option::Option<stream_chat_request::RequestType>,
107 #[prost(oneof = "stream_chat_request::Context", tags = "4, 5, 10, 11")]
108 pub context: ::core::option::Option<stream_chat_request::Context>,
109}
110pub mod stream_chat_request {
112 #[derive(Clone, PartialEq, ::prost::Oneof)]
113 pub enum RequestType {
114 #[prost(message, tag = "7")]
115 Retry(super::RetryRequest),
116 #[prost(message, tag = "8")]
117 UserPrompt(super::UserPromptRequest),
118 #[prost(message, tag = "9")]
119 ToolApproval(super::ToolApprovalRequest),
120 }
121 #[derive(Clone, PartialEq, ::prost::Oneof)]
122 pub enum Context {
123 #[prost(message, tag = "4")]
124 Workbook(super::WorkbookContext),
125 #[prost(message, tag = "5")]
126 Global(super::GlobalContext),
127 #[prost(message, tag = "10")]
128 Checklist(super::ChecklistContext),
129 #[prost(message, tag = "11")]
130 Template(super::TemplateContext),
131 }
132}
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct WorkbookContext {
135 #[prost(string, tag = "1")]
136 pub workbook_rid: ::prost::alloc::string::String,
137 #[deprecated]
138 #[prost(message, optional, tag = "2")]
139 pub user_presence: ::core::option::Option<WorkbookUserPresence>,
140 #[prost(string, optional, tag = "3")]
141 pub active_tab_id: ::core::option::Option<::prost::alloc::string::String>,
142}
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct ChecklistContext {
145 #[prost(string, tag = "1")]
146 pub checklist_rid: ::prost::alloc::string::String,
147 #[prost(string, tag = "2")]
148 pub branch_name: ::prost::alloc::string::String,
149 #[prost(oneof = "checklist_context::ReferenceRid", tags = "3, 4")]
150 pub reference_rid: ::core::option::Option<checklist_context::ReferenceRid>,
151}
152pub mod checklist_context {
154 #[derive(Clone, PartialEq, ::prost::Oneof)]
155 pub enum ReferenceRid {
156 #[prost(string, tag = "3")]
157 Asset(::prost::alloc::string::String),
158 #[prost(string, tag = "4")]
159 Run(::prost::alloc::string::String),
160 }
161}
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct TemplateContext {
164 #[prost(string, tag = "1")]
165 pub template_rid: ::prost::alloc::string::String,
166 #[prost(string, tag = "2")]
167 pub branch_name: ::prost::alloc::string::String,
168 #[prost(oneof = "template_context::ReferenceRid", tags = "3, 4")]
169 pub reference_rid: ::core::option::Option<template_context::ReferenceRid>,
170}
171pub mod template_context {
173 #[derive(Clone, PartialEq, ::prost::Oneof)]
174 pub enum ReferenceRid {
175 #[prost(string, tag = "3")]
176 Asset(::prost::alloc::string::String),
177 #[prost(string, tag = "4")]
178 Run(::prost::alloc::string::String),
179 }
180}
181#[derive(Clone, Copy, PartialEq, ::prost::Message)]
182pub struct GlobalContext {}
183#[derive(Clone, Copy, PartialEq, ::prost::Message)]
184pub struct WorkbookUserPresence {
185 #[prost(int32, tag = "1")]
186 pub tab_index: i32,
187 #[prost(message, optional, tag = "2")]
188 pub range: ::core::option::Option<TimeRange>,
189}
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct CreateConversationRequest {
192 #[prost(string, tag = "1")]
193 pub title: ::prost::alloc::string::String,
194 #[prost(string, tag = "2")]
195 pub workspace_rid: ::prost::alloc::string::String,
196 #[prost(string, optional, tag = "3")]
197 pub old_conversation_rid: ::core::option::Option<::prost::alloc::string::String>,
198 #[prost(string, optional, tag = "4")]
199 pub previous_message_id: ::core::option::Option<::prost::alloc::string::String>,
200 #[prost(message, optional, tag = "5")]
201 pub conversation_mode: ::core::option::Option<ConversationMode>,
202}
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct CreateConversationResponse {
205 #[prost(string, tag = "1")]
206 pub new_conversation_rid: ::prost::alloc::string::String,
207}
208#[derive(Clone, PartialEq, ::prost::Message)]
209pub struct UpdateConversationMetadataRequest {
210 #[prost(string, optional, tag = "1")]
211 pub title: ::core::option::Option<::prost::alloc::string::String>,
212 #[prost(string, tag = "2")]
213 pub conversation_rid: ::prost::alloc::string::String,
214 #[prost(message, optional, tag = "3")]
215 pub conversation_mode: ::core::option::Option<ConversationMode>,
216}
217#[derive(Clone, Copy, PartialEq, ::prost::Message)]
218pub struct UpdateConversationMetadataResponse {}
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct DeleteConversationRequest {
221 #[prost(string, tag = "1")]
222 pub conversation_rid: ::prost::alloc::string::String,
223}
224#[derive(Clone, Copy, PartialEq, ::prost::Message)]
225pub struct DeleteConversationResponse {}
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct GetConversationRequest {
228 #[prost(string, tag = "1")]
229 pub conversation_rid: ::prost::alloc::string::String,
230 #[prost(string, optional, tag = "2")]
231 pub page_start_message_id: ::core::option::Option<::prost::alloc::string::String>,
232 #[prost(int32, optional, tag = "3")]
233 pub max_message_count: ::core::option::Option<i32>,
234}
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct CompactConversationRequest {
237 #[prost(string, tag = "1")]
238 pub conversation_rid: ::prost::alloc::string::String,
239}
240#[derive(Clone, Copy, PartialEq, ::prost::Message)]
241pub struct CompactConversationResponse {
242 #[prost(message, optional, tag = "1")]
243 pub context: ::core::option::Option<ContextStatus>,
244}
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct ModelMessageWithId {
247 #[prost(string, tag = "3")]
248 pub message_id: ::prost::alloc::string::String,
249 #[prost(message, repeated, tag = "5")]
250 pub tool_approval_requests: ::prost::alloc::vec::Vec<ToolCallDescription>,
251 #[prost(oneof = "model_message_with_id::Content", tags = "1, 2, 6")]
252 pub content: ::core::option::Option<model_message_with_id::Content>,
253 #[prost(oneof = "model_message_with_id::RestorePoint", tags = "4, 7")]
254 pub restore_point: ::core::option::Option<model_message_with_id::RestorePoint>,
255}
256pub mod model_message_with_id {
258 #[derive(Clone, PartialEq, ::prost::Oneof)]
259 pub enum Content {
260 #[prost(message, tag = "1")]
261 Message(super::ModelMessage),
262 #[prost(message, tag = "2")]
263 ToolAction(super::ToolAction),
264 #[prost(message, tag = "6")]
265 ToolActionConfirmation(super::ToolActionConfirmation),
266 }
267 #[derive(Clone, PartialEq, ::prost::Oneof)]
268 pub enum RestorePoint {
269 #[prost(string, tag = "4")]
270 SnapshotRid(::prost::alloc::string::String),
271 #[prost(string, tag = "7")]
272 CommitId(::prost::alloc::string::String),
273 }
274}
275#[derive(Clone, PartialEq, ::prost::Message)]
276pub struct GetConversationResponse {
277 #[prost(message, repeated, tag = "1")]
278 pub ordered_messages: ::prost::alloc::vec::Vec<ModelMessageWithId>,
279 #[prost(message, optional, tag = "2")]
280 pub conversation_metadata: ::core::option::Option<ConversationMetadata>,
281}
282#[derive(Clone, PartialEq, ::prost::Message)]
283pub struct GetConversationMetadataRequest {
284 #[prost(string, tag = "1")]
285 pub conversation_rid: ::prost::alloc::string::String,
286}
287#[derive(Clone, PartialEq, ::prost::Message)]
288pub struct GetConversationMetadataResponse {
289 #[prost(message, optional, tag = "1")]
290 pub conversation_metadata: ::core::option::Option<ConversationMetadata>,
291}
292#[derive(Clone, PartialEq, ::prost::Message)]
293pub struct GetConversationMessagesRequest {
294 #[prost(string, tag = "1")]
295 pub conversation_rid: ::prost::alloc::string::String,
296 #[prost(string, optional, tag = "2")]
297 pub page_start_message_id: ::core::option::Option<::prost::alloc::string::String>,
298 #[prost(int32, optional, tag = "3")]
299 pub max_message_count: ::core::option::Option<i32>,
300}
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct GetConversationMessagesResponse {
303 #[prost(message, repeated, tag = "1")]
304 pub ordered_messages: ::prost::alloc::vec::Vec<ModelMessageWithId>,
305 #[prost(string, optional, tag = "2")]
306 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
307}
308#[derive(Clone, PartialEq, ::prost::Message)]
309pub struct ListConversationsRequest {
310 #[prost(string, tag = "1")]
311 pub workspace_rid: ::prost::alloc::string::String,
312 #[prost(string, optional, tag = "2")]
313 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
314 #[prost(int32, optional, tag = "3")]
315 pub page_size: ::core::option::Option<i32>,
316}
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct ConversationMetadata {
319 #[prost(string, tag = "1")]
320 pub conversation_rid: ::prost::alloc::string::String,
321 #[prost(string, tag = "2")]
322 pub title: ::prost::alloc::string::String,
323 #[prost(message, optional, tag = "3")]
324 pub created_at: ::core::option::Option<
325 super::super::super::google::protobuf::Timestamp,
326 >,
327 #[prost(message, optional, tag = "4")]
328 pub last_updated_at: ::core::option::Option<
329 super::super::super::google::protobuf::Timestamp,
330 >,
331 #[prost(message, optional, tag = "5")]
332 pub mode: ::core::option::Option<ConversationMode>,
333 #[prost(message, optional, tag = "6")]
334 pub current_context: ::core::option::Option<ContextStatus>,
335}
336#[derive(Clone, PartialEq, ::prost::Message)]
337pub struct ListConversationsResponse {
338 #[prost(message, repeated, tag = "1")]
339 pub conversations: ::prost::alloc::vec::Vec<ConversationMetadata>,
340 #[prost(string, optional, tag = "2")]
341 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
342}
343#[derive(Clone, Copy, PartialEq, ::prost::Message)]
344pub struct TimeRange {
345 #[prost(message, optional, tag = "1")]
346 pub range_start: ::core::option::Option<Timestamp>,
347 #[prost(message, optional, tag = "2")]
348 pub range_end: ::core::option::Option<Timestamp>,
349}
350#[derive(Clone, Copy, PartialEq, ::prost::Message)]
351pub struct Timestamp {
352 #[prost(int32, tag = "1")]
353 pub seconds: i32,
354 #[prost(int32, tag = "2")]
355 pub nanoseconds: i32,
356}
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct ModelMessage {
359 #[prost(oneof = "model_message::Kind", tags = "1, 2")]
360 pub kind: ::core::option::Option<model_message::Kind>,
361}
362pub mod model_message {
364 #[derive(Clone, PartialEq, ::prost::Oneof)]
365 pub enum Kind {
366 #[prost(message, tag = "1")]
367 User(super::UserModelMessage),
368 #[prost(message, tag = "2")]
369 Assistant(super::AssistantModelMessage),
370 }
371}
372#[derive(Clone, PartialEq, ::prost::Message)]
373pub struct UserModelMessage {
374 #[prost(message, repeated, tag = "1")]
375 pub text: ::prost::alloc::vec::Vec<UserContentPart>,
376}
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct AssistantModelMessage {
379 #[prost(message, repeated, tag = "1")]
380 pub content_parts: ::prost::alloc::vec::Vec<AssistantContentPart>,
381}
382#[derive(Clone, PartialEq, ::prost::Message)]
383pub struct UserContentPart {
384 #[prost(oneof = "user_content_part::Part", tags = "1, 2")]
385 pub part: ::core::option::Option<user_content_part::Part>,
386}
387pub mod user_content_part {
389 #[derive(Clone, PartialEq, ::prost::Oneof)]
390 pub enum Part {
391 #[prost(message, tag = "1")]
392 Text(super::TextPart),
393 #[prost(message, tag = "2")]
394 Image(super::ImagePart),
395 }
396}
397#[derive(Clone, PartialEq, ::prost::Message)]
398pub struct AssistantContentPart {
399 #[prost(oneof = "assistant_content_part::Part", tags = "1, 2")]
400 pub part: ::core::option::Option<assistant_content_part::Part>,
401}
402pub mod assistant_content_part {
404 #[derive(Clone, PartialEq, ::prost::Oneof)]
405 pub enum Part {
406 #[prost(message, tag = "1")]
407 Text(super::TextPart),
408 #[prost(message, tag = "2")]
409 Reasoning(super::ReasoningPart),
410 }
411}
412#[derive(Clone, PartialEq, ::prost::Message)]
413pub struct TextPart {
414 #[prost(string, tag = "1")]
415 pub text: ::prost::alloc::string::String,
416}
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct ImagePart {
419 #[prost(string, tag = "2")]
420 pub media_type: ::prost::alloc::string::String,
421 #[prost(string, tag = "4")]
422 pub attachment_rid: ::prost::alloc::string::String,
423}
424#[derive(Clone, PartialEq, ::prost::Message)]
425pub struct ReasoningPart {
426 #[prost(string, tag = "1")]
427 pub reasoning: ::prost::alloc::string::String,
428}
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct StreamChatResponse {
431 #[prost(
432 oneof = "stream_chat_response::Response",
433 tags = "1, 2, 3, 4, 5, 6, 7, 8, 10, 11"
434 )]
435 pub response: ::core::option::Option<stream_chat_response::Response>,
436}
437pub mod stream_chat_response {
439 #[derive(Clone, PartialEq, ::prost::Oneof)]
440 pub enum Response {
441 #[prost(message, tag = "1")]
442 Finish(super::Finish),
443 #[prost(message, tag = "2")]
444 Error(super::Error),
445 #[prost(message, tag = "3")]
446 TextStart(super::TextStart),
447 #[prost(message, tag = "4")]
448 TextDelta(super::TextDelta),
449 #[prost(message, tag = "5")]
450 TextEnd(super::TextEnd),
451 #[prost(message, tag = "6")]
452 ReasoningStart(super::ReasoningStart),
453 #[prost(message, tag = "7")]
454 ReasoningDelta(super::ReasoningDelta),
455 #[prost(message, tag = "8")]
456 ReasoningEnd(super::ReasoningEnd),
457 #[prost(message, tag = "10")]
458 ToolAction(super::ToolAction),
459 #[prost(message, tag = "11")]
460 ToolActionConfirmation(super::ToolActionConfirmation),
461 }
462}
463#[derive(Clone, PartialEq, ::prost::Message)]
464pub struct ToolCallDescription {
465 #[prost(string, tag = "1")]
466 pub tool_call_id: ::prost::alloc::string::String,
467 #[prost(string, tag = "2")]
468 pub tool_name: ::prost::alloc::string::String,
469 #[prost(string, tag = "3")]
470 pub tool_args_json_string: ::prost::alloc::string::String,
471 #[prost(enumeration = "ToolCallStatus", tag = "4")]
472 pub status: i32,
473}
474#[derive(Clone, PartialEq, ::prost::Message)]
475pub struct Finish {
476 #[prost(string, repeated, tag = "1")]
477 pub ordered_message_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
478 #[prost(string, optional, tag = "2")]
479 pub new_title: ::core::option::Option<::prost::alloc::string::String>,
480 #[prost(message, repeated, tag = "3")]
481 pub tool_approval_requests: ::prost::alloc::vec::Vec<ToolCallDescription>,
482 #[prost(message, optional, tag = "4")]
483 pub updated_context: ::core::option::Option<ContextStatus>,
484}
485#[derive(Clone, PartialEq, ::prost::Message)]
486pub struct Error {
487 #[prost(string, tag = "1")]
488 pub message: ::prost::alloc::string::String,
489}
490#[derive(Clone, PartialEq, ::prost::Message)]
491pub struct TextStart {
492 #[prost(string, tag = "1")]
493 pub id: ::prost::alloc::string::String,
494}
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct TextDelta {
497 #[prost(string, tag = "1")]
498 pub id: ::prost::alloc::string::String,
499 #[prost(string, tag = "2")]
500 pub delta: ::prost::alloc::string::String,
501}
502#[derive(Clone, PartialEq, ::prost::Message)]
503pub struct TextEnd {
504 #[prost(string, tag = "1")]
505 pub id: ::prost::alloc::string::String,
506}
507#[derive(Clone, PartialEq, ::prost::Message)]
508pub struct ReasoningStart {
509 #[prost(string, tag = "1")]
510 pub id: ::prost::alloc::string::String,
511}
512#[derive(Clone, PartialEq, ::prost::Message)]
513pub struct ReasoningDelta {
514 #[prost(string, tag = "1")]
515 pub id: ::prost::alloc::string::String,
516 #[prost(string, tag = "2")]
517 pub delta: ::prost::alloc::string::String,
518}
519#[derive(Clone, PartialEq, ::prost::Message)]
520pub struct ReasoningEnd {
521 #[prost(string, tag = "1")]
522 pub id: ::prost::alloc::string::String,
523}
524#[derive(Clone, PartialEq, ::prost::Message)]
525pub struct ToolAction {
526 #[prost(string, tag = "2")]
527 pub tool_action_verb: ::prost::alloc::string::String,
528 #[prost(string, optional, tag = "3")]
529 pub tool_target: ::core::option::Option<::prost::alloc::string::String>,
530 #[prost(message, optional, tag = "5")]
531 pub tool_call_description: ::core::option::Option<ToolCallDescription>,
532 #[deprecated]
533 #[prost(string, tag = "1")]
534 pub id: ::prost::alloc::string::String,
535 #[deprecated]
536 #[prost(string, tag = "4")]
537 pub tool_name: ::prost::alloc::string::String,
538}
539#[derive(Clone, PartialEq, ::prost::Message)]
540pub struct ToolActionConfirmation {
541 #[prost(string, tag = "1")]
542 pub id: ::prost::alloc::string::String,
543 #[prost(oneof = "tool_action_confirmation::Outcome", tags = "2, 3")]
544 pub outcome: ::core::option::Option<tool_action_confirmation::Outcome>,
545}
546pub mod tool_action_confirmation {
548 #[derive(Clone, PartialEq, ::prost::Oneof)]
549 pub enum Outcome {
550 #[prost(message, tag = "2")]
551 Success(super::ToolActionSuccess),
552 #[prost(message, tag = "3")]
553 Failure(super::ToolActionFailure),
554 }
555}
556#[derive(Clone, PartialEq, ::prost::Message)]
557pub struct ToolActionSuccess {
558 #[prost(string, tag = "1")]
559 pub tool_success_message: ::prost::alloc::string::String,
560}
561#[derive(Clone, PartialEq, ::prost::Message)]
562pub struct ToolActionFailure {
563 #[prost(string, tag = "1")]
564 pub tool_error_message: ::prost::alloc::string::String,
565}
566#[derive(Clone, Copy, PartialEq, ::prost::Message)]
567pub struct ContextStatus {
568 #[prost(int32, tag = "1")]
569 pub curr_token_count: i32,
570 #[prost(int32, tag = "2")]
571 pub model_context_limit: i32,
572}
573#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
574#[repr(i32)]
575pub enum ToolCallStatus {
576 Unspecified = 0,
577 Approved = 1,
578 Denied = 2,
579 AwaitingApproval = 3,
580}
581impl ToolCallStatus {
582 pub fn as_str_name(&self) -> &'static str {
587 match self {
588 Self::Unspecified => "TOOL_CALL_STATUS_UNSPECIFIED",
589 Self::Approved => "TOOL_CALL_STATUS_APPROVED",
590 Self::Denied => "TOOL_CALL_STATUS_DENIED",
591 Self::AwaitingApproval => "TOOL_CALL_STATUS_AWAITING_APPROVAL",
592 }
593 }
594 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
596 match value {
597 "TOOL_CALL_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
598 "TOOL_CALL_STATUS_APPROVED" => Some(Self::Approved),
599 "TOOL_CALL_STATUS_DENIED" => Some(Self::Denied),
600 "TOOL_CALL_STATUS_AWAITING_APPROVAL" => Some(Self::AwaitingApproval),
601 _ => None,
602 }
603 }
604}
605pub mod ai_agent_service_client {
607 #![allow(
608 unused_variables,
609 dead_code,
610 missing_docs,
611 clippy::wildcard_imports,
612 clippy::let_unit_value,
613 )]
614 use tonic::codegen::*;
615 use tonic::codegen::http::Uri;
616 #[derive(Debug, Clone)]
617 pub struct AiAgentServiceClient<T> {
618 inner: tonic::client::Grpc<T>,
619 }
620 impl AiAgentServiceClient<tonic::transport::Channel> {
621 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
623 where
624 D: TryInto<tonic::transport::Endpoint>,
625 D::Error: Into<StdError>,
626 {
627 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
628 Ok(Self::new(conn))
629 }
630 }
631 impl<T> AiAgentServiceClient<T>
632 where
633 T: tonic::client::GrpcService<tonic::body::Body>,
634 T::Error: Into<StdError>,
635 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
636 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
637 {
638 pub fn new(inner: T) -> Self {
639 let inner = tonic::client::Grpc::new(inner);
640 Self { inner }
641 }
642 pub fn with_origin(inner: T, origin: Uri) -> Self {
643 let inner = tonic::client::Grpc::with_origin(inner, origin);
644 Self { inner }
645 }
646 pub fn with_interceptor<F>(
647 inner: T,
648 interceptor: F,
649 ) -> AiAgentServiceClient<InterceptedService<T, F>>
650 where
651 F: tonic::service::Interceptor,
652 T::ResponseBody: Default,
653 T: tonic::codegen::Service<
654 http::Request<tonic::body::Body>,
655 Response = http::Response<
656 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
657 >,
658 >,
659 <T as tonic::codegen::Service<
660 http::Request<tonic::body::Body>,
661 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
662 {
663 AiAgentServiceClient::new(InterceptedService::new(inner, interceptor))
664 }
665 #[must_use]
670 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
671 self.inner = self.inner.send_compressed(encoding);
672 self
673 }
674 #[must_use]
676 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
677 self.inner = self.inner.accept_compressed(encoding);
678 self
679 }
680 #[must_use]
684 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
685 self.inner = self.inner.max_decoding_message_size(limit);
686 self
687 }
688 #[must_use]
692 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
693 self.inner = self.inner.max_encoding_message_size(limit);
694 self
695 }
696 pub async fn stream_chat(
697 &mut self,
698 request: impl tonic::IntoRequest<super::StreamChatRequest>,
699 ) -> std::result::Result<
700 tonic::Response<tonic::codec::Streaming<super::StreamChatResponse>>,
701 tonic::Status,
702 > {
703 self.inner
704 .ready()
705 .await
706 .map_err(|e| {
707 tonic::Status::unknown(
708 format!("Service was not ready: {}", e.into()),
709 )
710 })?;
711 let codec = tonic::codec::ProstCodec::default();
712 let path = http::uri::PathAndQuery::from_static(
713 "/nominal.ai.v1.AIAgentService/StreamChat",
714 );
715 let mut req = request.into_request();
716 req.extensions_mut()
717 .insert(GrpcMethod::new("nominal.ai.v1.AIAgentService", "StreamChat"));
718 self.inner.server_streaming(req, path, codec).await
719 }
720 #[deprecated]
721 pub async fn get_conversation(
722 &mut self,
723 request: impl tonic::IntoRequest<super::GetConversationRequest>,
724 ) -> std::result::Result<
725 tonic::Response<super::GetConversationResponse>,
726 tonic::Status,
727 > {
728 self.inner
729 .ready()
730 .await
731 .map_err(|e| {
732 tonic::Status::unknown(
733 format!("Service was not ready: {}", e.into()),
734 )
735 })?;
736 let codec = tonic::codec::ProstCodec::default();
737 let path = http::uri::PathAndQuery::from_static(
738 "/nominal.ai.v1.AIAgentService/GetConversation",
739 );
740 let mut req = request.into_request();
741 req.extensions_mut()
742 .insert(
743 GrpcMethod::new("nominal.ai.v1.AIAgentService", "GetConversation"),
744 );
745 self.inner.unary(req, path, codec).await
746 }
747 pub async fn get_conversation_metadata(
748 &mut self,
749 request: impl tonic::IntoRequest<super::GetConversationMetadataRequest>,
750 ) -> std::result::Result<
751 tonic::Response<super::GetConversationMetadataResponse>,
752 tonic::Status,
753 > {
754 self.inner
755 .ready()
756 .await
757 .map_err(|e| {
758 tonic::Status::unknown(
759 format!("Service was not ready: {}", e.into()),
760 )
761 })?;
762 let codec = tonic::codec::ProstCodec::default();
763 let path = http::uri::PathAndQuery::from_static(
764 "/nominal.ai.v1.AIAgentService/GetConversationMetadata",
765 );
766 let mut req = request.into_request();
767 req.extensions_mut()
768 .insert(
769 GrpcMethod::new(
770 "nominal.ai.v1.AIAgentService",
771 "GetConversationMetadata",
772 ),
773 );
774 self.inner.unary(req, path, codec).await
775 }
776 pub async fn get_conversation_messages(
777 &mut self,
778 request: impl tonic::IntoRequest<super::GetConversationMessagesRequest>,
779 ) -> std::result::Result<
780 tonic::Response<super::GetConversationMessagesResponse>,
781 tonic::Status,
782 > {
783 self.inner
784 .ready()
785 .await
786 .map_err(|e| {
787 tonic::Status::unknown(
788 format!("Service was not ready: {}", e.into()),
789 )
790 })?;
791 let codec = tonic::codec::ProstCodec::default();
792 let path = http::uri::PathAndQuery::from_static(
793 "/nominal.ai.v1.AIAgentService/GetConversationMessages",
794 );
795 let mut req = request.into_request();
796 req.extensions_mut()
797 .insert(
798 GrpcMethod::new(
799 "nominal.ai.v1.AIAgentService",
800 "GetConversationMessages",
801 ),
802 );
803 self.inner.unary(req, path, codec).await
804 }
805 pub async fn list_conversations(
806 &mut self,
807 request: impl tonic::IntoRequest<super::ListConversationsRequest>,
808 ) -> std::result::Result<
809 tonic::Response<super::ListConversationsResponse>,
810 tonic::Status,
811 > {
812 self.inner
813 .ready()
814 .await
815 .map_err(|e| {
816 tonic::Status::unknown(
817 format!("Service was not ready: {}", e.into()),
818 )
819 })?;
820 let codec = tonic::codec::ProstCodec::default();
821 let path = http::uri::PathAndQuery::from_static(
822 "/nominal.ai.v1.AIAgentService/ListConversations",
823 );
824 let mut req = request.into_request();
825 req.extensions_mut()
826 .insert(
827 GrpcMethod::new("nominal.ai.v1.AIAgentService", "ListConversations"),
828 );
829 self.inner.unary(req, path, codec).await
830 }
831 pub async fn create_conversation(
832 &mut self,
833 request: impl tonic::IntoRequest<super::CreateConversationRequest>,
834 ) -> std::result::Result<
835 tonic::Response<super::CreateConversationResponse>,
836 tonic::Status,
837 > {
838 self.inner
839 .ready()
840 .await
841 .map_err(|e| {
842 tonic::Status::unknown(
843 format!("Service was not ready: {}", e.into()),
844 )
845 })?;
846 let codec = tonic::codec::ProstCodec::default();
847 let path = http::uri::PathAndQuery::from_static(
848 "/nominal.ai.v1.AIAgentService/CreateConversation",
849 );
850 let mut req = request.into_request();
851 req.extensions_mut()
852 .insert(
853 GrpcMethod::new("nominal.ai.v1.AIAgentService", "CreateConversation"),
854 );
855 self.inner.unary(req, path, codec).await
856 }
857 pub async fn update_conversation_metadata(
858 &mut self,
859 request: impl tonic::IntoRequest<super::UpdateConversationMetadataRequest>,
860 ) -> std::result::Result<
861 tonic::Response<super::UpdateConversationMetadataResponse>,
862 tonic::Status,
863 > {
864 self.inner
865 .ready()
866 .await
867 .map_err(|e| {
868 tonic::Status::unknown(
869 format!("Service was not ready: {}", e.into()),
870 )
871 })?;
872 let codec = tonic::codec::ProstCodec::default();
873 let path = http::uri::PathAndQuery::from_static(
874 "/nominal.ai.v1.AIAgentService/UpdateConversationMetadata",
875 );
876 let mut req = request.into_request();
877 req.extensions_mut()
878 .insert(
879 GrpcMethod::new(
880 "nominal.ai.v1.AIAgentService",
881 "UpdateConversationMetadata",
882 ),
883 );
884 self.inner.unary(req, path, codec).await
885 }
886 pub async fn delete_conversation(
887 &mut self,
888 request: impl tonic::IntoRequest<super::DeleteConversationRequest>,
889 ) -> std::result::Result<
890 tonic::Response<super::DeleteConversationResponse>,
891 tonic::Status,
892 > {
893 self.inner
894 .ready()
895 .await
896 .map_err(|e| {
897 tonic::Status::unknown(
898 format!("Service was not ready: {}", e.into()),
899 )
900 })?;
901 let codec = tonic::codec::ProstCodec::default();
902 let path = http::uri::PathAndQuery::from_static(
903 "/nominal.ai.v1.AIAgentService/DeleteConversation",
904 );
905 let mut req = request.into_request();
906 req.extensions_mut()
907 .insert(
908 GrpcMethod::new("nominal.ai.v1.AIAgentService", "DeleteConversation"),
909 );
910 self.inner.unary(req, path, codec).await
911 }
912 pub async fn get_snapshot_rid_by_user_message_id(
913 &mut self,
914 request: impl tonic::IntoRequest<super::GetSnapshotRidByUserMessageIdRequest>,
915 ) -> std::result::Result<
916 tonic::Response<super::GetSnapshotRidByUserMessageIdResponse>,
917 tonic::Status,
918 > {
919 self.inner
920 .ready()
921 .await
922 .map_err(|e| {
923 tonic::Status::unknown(
924 format!("Service was not ready: {}", e.into()),
925 )
926 })?;
927 let codec = tonic::codec::ProstCodec::default();
928 let path = http::uri::PathAndQuery::from_static(
929 "/nominal.ai.v1.AIAgentService/GetSnapshotRidByUserMessageId",
930 );
931 let mut req = request.into_request();
932 req.extensions_mut()
933 .insert(
934 GrpcMethod::new(
935 "nominal.ai.v1.AIAgentService",
936 "GetSnapshotRidByUserMessageId",
937 ),
938 );
939 self.inner.unary(req, path, codec).await
940 }
941 pub async fn compact_conversation(
942 &mut self,
943 request: impl tonic::IntoRequest<super::CompactConversationRequest>,
944 ) -> std::result::Result<
945 tonic::Response<super::CompactConversationResponse>,
946 tonic::Status,
947 > {
948 self.inner
949 .ready()
950 .await
951 .map_err(|e| {
952 tonic::Status::unknown(
953 format!("Service was not ready: {}", e.into()),
954 )
955 })?;
956 let codec = tonic::codec::ProstCodec::default();
957 let path = http::uri::PathAndQuery::from_static(
958 "/nominal.ai.v1.AIAgentService/CompactConversation",
959 );
960 let mut req = request.into_request();
961 req.extensions_mut()
962 .insert(
963 GrpcMethod::new(
964 "nominal.ai.v1.AIAgentService",
965 "CompactConversation",
966 ),
967 );
968 self.inner.unary(req, path, codec).await
969 }
970 }
971}
972#[derive(Clone, PartialEq, ::prost::Message)]
973pub struct ClassifyErrorRequest {
974 #[prost(string, tag = "1")]
975 pub error_message: ::prost::alloc::string::String,
976}
977#[derive(Clone, PartialEq, ::prost::Message)]
978pub struct ClassifyErrorResponse {
979 #[prost(enumeration = "ErrorClassification", tag = "1")]
980 pub classification: i32,
981 #[prost(string, tag = "2")]
982 pub reason: ::prost::alloc::string::String,
983}
984#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
985#[repr(i32)]
986pub enum ErrorClassification {
987 Unspecified = 0,
988 Client = 1,
989 Server = 2,
990}
991impl ErrorClassification {
992 pub fn as_str_name(&self) -> &'static str {
997 match self {
998 Self::Unspecified => "ERROR_CLASSIFICATION_UNSPECIFIED",
999 Self::Client => "ERROR_CLASSIFICATION_CLIENT",
1000 Self::Server => "ERROR_CLASSIFICATION_SERVER",
1001 }
1002 }
1003 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1005 match value {
1006 "ERROR_CLASSIFICATION_UNSPECIFIED" => Some(Self::Unspecified),
1007 "ERROR_CLASSIFICATION_CLIENT" => Some(Self::Client),
1008 "ERROR_CLASSIFICATION_SERVER" => Some(Self::Server),
1009 _ => None,
1010 }
1011 }
1012}
1013pub mod data_ingestion_error_classifier_service_client {
1015 #![allow(
1016 unused_variables,
1017 dead_code,
1018 missing_docs,
1019 clippy::wildcard_imports,
1020 clippy::let_unit_value,
1021 )]
1022 use tonic::codegen::*;
1023 use tonic::codegen::http::Uri;
1024 #[derive(Debug, Clone)]
1025 pub struct DataIngestionErrorClassifierServiceClient<T> {
1026 inner: tonic::client::Grpc<T>,
1027 }
1028 impl DataIngestionErrorClassifierServiceClient<tonic::transport::Channel> {
1029 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1031 where
1032 D: TryInto<tonic::transport::Endpoint>,
1033 D::Error: Into<StdError>,
1034 {
1035 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1036 Ok(Self::new(conn))
1037 }
1038 }
1039 impl<T> DataIngestionErrorClassifierServiceClient<T>
1040 where
1041 T: tonic::client::GrpcService<tonic::body::Body>,
1042 T::Error: Into<StdError>,
1043 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1044 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1045 {
1046 pub fn new(inner: T) -> Self {
1047 let inner = tonic::client::Grpc::new(inner);
1048 Self { inner }
1049 }
1050 pub fn with_origin(inner: T, origin: Uri) -> Self {
1051 let inner = tonic::client::Grpc::with_origin(inner, origin);
1052 Self { inner }
1053 }
1054 pub fn with_interceptor<F>(
1055 inner: T,
1056 interceptor: F,
1057 ) -> DataIngestionErrorClassifierServiceClient<InterceptedService<T, F>>
1058 where
1059 F: tonic::service::Interceptor,
1060 T::ResponseBody: Default,
1061 T: tonic::codegen::Service<
1062 http::Request<tonic::body::Body>,
1063 Response = http::Response<
1064 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1065 >,
1066 >,
1067 <T as tonic::codegen::Service<
1068 http::Request<tonic::body::Body>,
1069 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1070 {
1071 DataIngestionErrorClassifierServiceClient::new(
1072 InterceptedService::new(inner, interceptor),
1073 )
1074 }
1075 #[must_use]
1080 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1081 self.inner = self.inner.send_compressed(encoding);
1082 self
1083 }
1084 #[must_use]
1086 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1087 self.inner = self.inner.accept_compressed(encoding);
1088 self
1089 }
1090 #[must_use]
1094 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1095 self.inner = self.inner.max_decoding_message_size(limit);
1096 self
1097 }
1098 #[must_use]
1102 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1103 self.inner = self.inner.max_encoding_message_size(limit);
1104 self
1105 }
1106 pub async fn classify_error(
1107 &mut self,
1108 request: impl tonic::IntoRequest<super::ClassifyErrorRequest>,
1109 ) -> std::result::Result<
1110 tonic::Response<super::ClassifyErrorResponse>,
1111 tonic::Status,
1112 > {
1113 self.inner
1114 .ready()
1115 .await
1116 .map_err(|e| {
1117 tonic::Status::unknown(
1118 format!("Service was not ready: {}", e.into()),
1119 )
1120 })?;
1121 let codec = tonic::codec::ProstCodec::default();
1122 let path = http::uri::PathAndQuery::from_static(
1123 "/nominal.ai.v1.DataIngestionErrorClassifierService/ClassifyError",
1124 );
1125 let mut req = request.into_request();
1126 req.extensions_mut()
1127 .insert(
1128 GrpcMethod::new(
1129 "nominal.ai.v1.DataIngestionErrorClassifierService",
1130 "ClassifyError",
1131 ),
1132 );
1133 self.inner.unary(req, path, codec).await
1134 }
1135 }
1136}
1137#[derive(Clone, PartialEq, ::prost::Message)]
1138pub struct CreateOrUpdateKnowledgeBaseRequest {
1139 #[prost(string, tag = "1")]
1140 pub attachment_rid: ::prost::alloc::string::String,
1141 #[prost(string, tag = "2")]
1142 pub summary_description: ::prost::alloc::string::String,
1143 #[prost(enumeration = "KnowledgeBaseType", optional, tag = "3")]
1144 pub r#type: ::core::option::Option<i32>,
1145}
1146#[derive(Clone, PartialEq, ::prost::Message)]
1147pub struct CreateOrUpdateKnowledgeBaseResponse {
1148 #[prost(string, tag = "1")]
1149 pub knowledge_base_rid: ::prost::alloc::string::String,
1150}
1151#[derive(Clone, PartialEq, ::prost::Message)]
1152pub struct KnowledgeBase {
1153 #[prost(string, tag = "1")]
1154 pub knowledge_base_rid: ::prost::alloc::string::String,
1155 #[prost(string, tag = "2")]
1156 pub attachment_rid: ::prost::alloc::string::String,
1157 #[prost(string, tag = "3")]
1158 pub workspace_rid: ::prost::alloc::string::String,
1159 #[prost(string, tag = "4")]
1160 pub summary_description: ::prost::alloc::string::String,
1161 #[prost(enumeration = "KnowledgeBaseType", tag = "5")]
1162 pub r#type: i32,
1163 #[prost(int32, tag = "6")]
1164 pub version: i32,
1165}
1166#[derive(Clone, PartialEq, ::prost::Message)]
1167pub struct ListRequest {
1168 #[prost(string, tag = "1")]
1169 pub workspace_rid: ::prost::alloc::string::String,
1170}
1171#[derive(Clone, PartialEq, ::prost::Message)]
1172pub struct ListResponse {
1173 #[prost(message, repeated, tag = "1")]
1174 pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
1175}
1176#[derive(Clone, PartialEq, ::prost::Message)]
1177pub struct DeleteRequest {
1178 #[prost(string, tag = "1")]
1179 pub knowledge_base_rid: ::prost::alloc::string::String,
1180}
1181#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1182pub struct DeleteResponse {
1183 #[prost(bool, tag = "1")]
1184 pub success: bool,
1185}
1186#[derive(Clone, PartialEq, ::prost::Message)]
1187pub struct GetBatchRequest {
1188 #[prost(string, repeated, tag = "1")]
1189 pub knowledge_base_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1190}
1191#[derive(Clone, PartialEq, ::prost::Message)]
1192pub struct GetBatchResponse {
1193 #[prost(message, repeated, tag = "1")]
1194 pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
1195}
1196#[derive(Clone, PartialEq, ::prost::Message)]
1197pub struct GenerateSummaryDescriptionRequest {
1198 #[prost(string, tag = "1")]
1199 pub attachment_rid: ::prost::alloc::string::String,
1200}
1201#[derive(Clone, PartialEq, ::prost::Message)]
1202pub struct GenerateSummaryDescriptionResponse {
1203 #[prost(string, tag = "1")]
1204 pub summary_description: ::prost::alloc::string::String,
1205}
1206#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1207#[repr(i32)]
1208pub enum KnowledgeBaseType {
1209 Unspecified = 0,
1210 Prompt = 1,
1211 Embedding = 2,
1212}
1213impl KnowledgeBaseType {
1214 pub fn as_str_name(&self) -> &'static str {
1219 match self {
1220 Self::Unspecified => "KNOWLEDGE_BASE_TYPE_UNSPECIFIED",
1221 Self::Prompt => "KNOWLEDGE_BASE_TYPE_PROMPT",
1222 Self::Embedding => "KNOWLEDGE_BASE_TYPE_EMBEDDING",
1223 }
1224 }
1225 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1227 match value {
1228 "KNOWLEDGE_BASE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1229 "KNOWLEDGE_BASE_TYPE_PROMPT" => Some(Self::Prompt),
1230 "KNOWLEDGE_BASE_TYPE_EMBEDDING" => Some(Self::Embedding),
1231 _ => None,
1232 }
1233 }
1234}
1235pub mod knowledge_base_service_client {
1237 #![allow(
1238 unused_variables,
1239 dead_code,
1240 missing_docs,
1241 clippy::wildcard_imports,
1242 clippy::let_unit_value,
1243 )]
1244 use tonic::codegen::*;
1245 use tonic::codegen::http::Uri;
1246 #[derive(Debug, Clone)]
1247 pub struct KnowledgeBaseServiceClient<T> {
1248 inner: tonic::client::Grpc<T>,
1249 }
1250 impl KnowledgeBaseServiceClient<tonic::transport::Channel> {
1251 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1253 where
1254 D: TryInto<tonic::transport::Endpoint>,
1255 D::Error: Into<StdError>,
1256 {
1257 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1258 Ok(Self::new(conn))
1259 }
1260 }
1261 impl<T> KnowledgeBaseServiceClient<T>
1262 where
1263 T: tonic::client::GrpcService<tonic::body::Body>,
1264 T::Error: Into<StdError>,
1265 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1266 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1267 {
1268 pub fn new(inner: T) -> Self {
1269 let inner = tonic::client::Grpc::new(inner);
1270 Self { inner }
1271 }
1272 pub fn with_origin(inner: T, origin: Uri) -> Self {
1273 let inner = tonic::client::Grpc::with_origin(inner, origin);
1274 Self { inner }
1275 }
1276 pub fn with_interceptor<F>(
1277 inner: T,
1278 interceptor: F,
1279 ) -> KnowledgeBaseServiceClient<InterceptedService<T, F>>
1280 where
1281 F: tonic::service::Interceptor,
1282 T::ResponseBody: Default,
1283 T: tonic::codegen::Service<
1284 http::Request<tonic::body::Body>,
1285 Response = http::Response<
1286 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1287 >,
1288 >,
1289 <T as tonic::codegen::Service<
1290 http::Request<tonic::body::Body>,
1291 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1292 {
1293 KnowledgeBaseServiceClient::new(InterceptedService::new(inner, interceptor))
1294 }
1295 #[must_use]
1300 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1301 self.inner = self.inner.send_compressed(encoding);
1302 self
1303 }
1304 #[must_use]
1306 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1307 self.inner = self.inner.accept_compressed(encoding);
1308 self
1309 }
1310 #[must_use]
1314 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1315 self.inner = self.inner.max_decoding_message_size(limit);
1316 self
1317 }
1318 #[must_use]
1322 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1323 self.inner = self.inner.max_encoding_message_size(limit);
1324 self
1325 }
1326 pub async fn create_or_update_knowledge_base(
1327 &mut self,
1328 request: impl tonic::IntoRequest<super::CreateOrUpdateKnowledgeBaseRequest>,
1329 ) -> std::result::Result<
1330 tonic::Response<super::CreateOrUpdateKnowledgeBaseResponse>,
1331 tonic::Status,
1332 > {
1333 self.inner
1334 .ready()
1335 .await
1336 .map_err(|e| {
1337 tonic::Status::unknown(
1338 format!("Service was not ready: {}", e.into()),
1339 )
1340 })?;
1341 let codec = tonic::codec::ProstCodec::default();
1342 let path = http::uri::PathAndQuery::from_static(
1343 "/nominal.ai.v1.KnowledgeBaseService/CreateOrUpdateKnowledgeBase",
1344 );
1345 let mut req = request.into_request();
1346 req.extensions_mut()
1347 .insert(
1348 GrpcMethod::new(
1349 "nominal.ai.v1.KnowledgeBaseService",
1350 "CreateOrUpdateKnowledgeBase",
1351 ),
1352 );
1353 self.inner.unary(req, path, codec).await
1354 }
1355 pub async fn list(
1356 &mut self,
1357 request: impl tonic::IntoRequest<super::ListRequest>,
1358 ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
1359 self.inner
1360 .ready()
1361 .await
1362 .map_err(|e| {
1363 tonic::Status::unknown(
1364 format!("Service was not ready: {}", e.into()),
1365 )
1366 })?;
1367 let codec = tonic::codec::ProstCodec::default();
1368 let path = http::uri::PathAndQuery::from_static(
1369 "/nominal.ai.v1.KnowledgeBaseService/List",
1370 );
1371 let mut req = request.into_request();
1372 req.extensions_mut()
1373 .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "List"));
1374 self.inner.unary(req, path, codec).await
1375 }
1376 pub async fn delete(
1377 &mut self,
1378 request: impl tonic::IntoRequest<super::DeleteRequest>,
1379 ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
1380 self.inner
1381 .ready()
1382 .await
1383 .map_err(|e| {
1384 tonic::Status::unknown(
1385 format!("Service was not ready: {}", e.into()),
1386 )
1387 })?;
1388 let codec = tonic::codec::ProstCodec::default();
1389 let path = http::uri::PathAndQuery::from_static(
1390 "/nominal.ai.v1.KnowledgeBaseService/Delete",
1391 );
1392 let mut req = request.into_request();
1393 req.extensions_mut()
1394 .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "Delete"));
1395 self.inner.unary(req, path, codec).await
1396 }
1397 pub async fn get_batch(
1398 &mut self,
1399 request: impl tonic::IntoRequest<super::GetBatchRequest>,
1400 ) -> std::result::Result<
1401 tonic::Response<super::GetBatchResponse>,
1402 tonic::Status,
1403 > {
1404 self.inner
1405 .ready()
1406 .await
1407 .map_err(|e| {
1408 tonic::Status::unknown(
1409 format!("Service was not ready: {}", e.into()),
1410 )
1411 })?;
1412 let codec = tonic::codec::ProstCodec::default();
1413 let path = http::uri::PathAndQuery::from_static(
1414 "/nominal.ai.v1.KnowledgeBaseService/GetBatch",
1415 );
1416 let mut req = request.into_request();
1417 req.extensions_mut()
1418 .insert(
1419 GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "GetBatch"),
1420 );
1421 self.inner.unary(req, path, codec).await
1422 }
1423 pub async fn generate_summary_description(
1424 &mut self,
1425 request: impl tonic::IntoRequest<super::GenerateSummaryDescriptionRequest>,
1426 ) -> std::result::Result<
1427 tonic::Response<super::GenerateSummaryDescriptionResponse>,
1428 tonic::Status,
1429 > {
1430 self.inner
1431 .ready()
1432 .await
1433 .map_err(|e| {
1434 tonic::Status::unknown(
1435 format!("Service was not ready: {}", e.into()),
1436 )
1437 })?;
1438 let codec = tonic::codec::ProstCodec::default();
1439 let path = http::uri::PathAndQuery::from_static(
1440 "/nominal.ai.v1.KnowledgeBaseService/GenerateSummaryDescription",
1441 );
1442 let mut req = request.into_request();
1443 req.extensions_mut()
1444 .insert(
1445 GrpcMethod::new(
1446 "nominal.ai.v1.KnowledgeBaseService",
1447 "GenerateSummaryDescription",
1448 ),
1449 );
1450 self.inner.unary(req, path, codec).await
1451 }
1452 }
1453}
1454#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1455pub struct GetProviderStatusRequest {}
1456#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1457pub struct GetProviderStatusResponse {
1458 #[prost(message, optional, tag = "1")]
1459 pub timestamp: ::core::option::Option<
1460 super::super::super::google::protobuf::Timestamp,
1461 >,
1462 #[prost(message, optional, tag = "2")]
1463 pub last_status: ::core::option::Option<ProviderStatus>,
1464 #[deprecated]
1465 #[prost(message, optional, tag = "3")]
1466 pub aggregated_status_over_last_30m: ::core::option::Option<ProviderStatus>,
1467 #[prost(message, optional, tag = "4")]
1468 pub aggregated_status: ::core::option::Option<ProviderStatus>,
1469}
1470#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1471pub struct ProviderStatus {
1472 #[prost(oneof = "provider_status::Status", tags = "1, 2")]
1473 pub status: ::core::option::Option<provider_status::Status>,
1474}
1475pub mod provider_status {
1477 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
1478 pub enum Status {
1479 #[prost(message, tag = "1")]
1480 Healthy(super::Healthy),
1481 #[prost(message, tag = "2")]
1482 Degraded(super::Degraded),
1483 }
1484}
1485#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1486pub struct Healthy {}
1487#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1488pub struct Degraded {
1489 #[prost(enumeration = "DegradationReason", tag = "1")]
1490 pub reason: i32,
1491}
1492#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1493pub struct ProviderMetrics {
1494 #[prost(int32, tag = "1")]
1495 pub time_to_first_token_ms: i32,
1496 #[prost(int32, tag = "2")]
1497 pub total_time_ms: i32,
1498}
1499#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1500#[repr(i32)]
1501pub enum DegradationReason {
1502 Unspecified = 0,
1503 HighLatency = 1,
1504 Failures = 2,
1505 HighLatencyAndFailures = 3,
1506 Unavailable = 4,
1507}
1508impl DegradationReason {
1509 pub fn as_str_name(&self) -> &'static str {
1514 match self {
1515 Self::Unspecified => "DEGRADATION_REASON_UNSPECIFIED",
1516 Self::HighLatency => "DEGRADATION_REASON_HIGH_LATENCY",
1517 Self::Failures => "DEGRADATION_REASON_FAILURES",
1518 Self::HighLatencyAndFailures => {
1519 "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES"
1520 }
1521 Self::Unavailable => "DEGRADATION_REASON_UNAVAILABLE",
1522 }
1523 }
1524 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1526 match value {
1527 "DEGRADATION_REASON_UNSPECIFIED" => Some(Self::Unspecified),
1528 "DEGRADATION_REASON_HIGH_LATENCY" => Some(Self::HighLatency),
1529 "DEGRADATION_REASON_FAILURES" => Some(Self::Failures),
1530 "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES" => {
1531 Some(Self::HighLatencyAndFailures)
1532 }
1533 "DEGRADATION_REASON_UNAVAILABLE" => Some(Self::Unavailable),
1534 _ => None,
1535 }
1536 }
1537}
1538pub mod model_provider_health_service_client {
1540 #![allow(
1541 unused_variables,
1542 dead_code,
1543 missing_docs,
1544 clippy::wildcard_imports,
1545 clippy::let_unit_value,
1546 )]
1547 use tonic::codegen::*;
1548 use tonic::codegen::http::Uri;
1549 #[derive(Debug, Clone)]
1550 pub struct ModelProviderHealthServiceClient<T> {
1551 inner: tonic::client::Grpc<T>,
1552 }
1553 impl ModelProviderHealthServiceClient<tonic::transport::Channel> {
1554 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1556 where
1557 D: TryInto<tonic::transport::Endpoint>,
1558 D::Error: Into<StdError>,
1559 {
1560 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1561 Ok(Self::new(conn))
1562 }
1563 }
1564 impl<T> ModelProviderHealthServiceClient<T>
1565 where
1566 T: tonic::client::GrpcService<tonic::body::Body>,
1567 T::Error: Into<StdError>,
1568 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1569 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1570 {
1571 pub fn new(inner: T) -> Self {
1572 let inner = tonic::client::Grpc::new(inner);
1573 Self { inner }
1574 }
1575 pub fn with_origin(inner: T, origin: Uri) -> Self {
1576 let inner = tonic::client::Grpc::with_origin(inner, origin);
1577 Self { inner }
1578 }
1579 pub fn with_interceptor<F>(
1580 inner: T,
1581 interceptor: F,
1582 ) -> ModelProviderHealthServiceClient<InterceptedService<T, F>>
1583 where
1584 F: tonic::service::Interceptor,
1585 T::ResponseBody: Default,
1586 T: tonic::codegen::Service<
1587 http::Request<tonic::body::Body>,
1588 Response = http::Response<
1589 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1590 >,
1591 >,
1592 <T as tonic::codegen::Service<
1593 http::Request<tonic::body::Body>,
1594 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1595 {
1596 ModelProviderHealthServiceClient::new(
1597 InterceptedService::new(inner, interceptor),
1598 )
1599 }
1600 #[must_use]
1605 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1606 self.inner = self.inner.send_compressed(encoding);
1607 self
1608 }
1609 #[must_use]
1611 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1612 self.inner = self.inner.accept_compressed(encoding);
1613 self
1614 }
1615 #[must_use]
1619 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1620 self.inner = self.inner.max_decoding_message_size(limit);
1621 self
1622 }
1623 #[must_use]
1627 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1628 self.inner = self.inner.max_encoding_message_size(limit);
1629 self
1630 }
1631 pub async fn get_provider_status(
1632 &mut self,
1633 request: impl tonic::IntoRequest<super::GetProviderStatusRequest>,
1634 ) -> std::result::Result<
1635 tonic::Response<super::GetProviderStatusResponse>,
1636 tonic::Status,
1637 > {
1638 self.inner
1639 .ready()
1640 .await
1641 .map_err(|e| {
1642 tonic::Status::unknown(
1643 format!("Service was not ready: {}", e.into()),
1644 )
1645 })?;
1646 let codec = tonic::codec::ProstCodec::default();
1647 let path = http::uri::PathAndQuery::from_static(
1648 "/nominal.ai.v1.ModelProviderHealthService/GetProviderStatus",
1649 );
1650 let mut req = request.into_request();
1651 req.extensions_mut()
1652 .insert(
1653 GrpcMethod::new(
1654 "nominal.ai.v1.ModelProviderHealthService",
1655 "GetProviderStatus",
1656 ),
1657 );
1658 self.inner.unary(req, path, codec).await
1659 }
1660 }
1661}