Skip to content

Commit dcc8e29

Browse files
densumeshskeptrunedev
authored andcommitted
cleanup: add back only_used_docs_used for now
1 parent 35218e5 commit dcc8e29

File tree

6 files changed

+224
-21
lines changed

6 files changed

+224
-21
lines changed

clients/ts-sdk/openapi.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11670,6 +11670,11 @@
1167011670
"description": "No result message for when there are no chunks found above the score threshold.",
1167111671
"nullable": true
1167211672
},
11673+
"only_include_docs_used": {
11674+
"type": "boolean",
11675+
"description": "Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.",
11676+
"nullable": true
11677+
},
1167311678
"page_size": {
1167411679
"type": "integer",
1167511680
"format": "int64",
@@ -12766,6 +12771,11 @@
1276612771
"description": "No result message for when there are no chunks found above the score threshold.",
1276712772
"nullable": true
1276812773
},
12774+
"only_include_docs_used": {
12775+
"type": "boolean",
12776+
"description": "Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.",
12777+
"nullable": true
12778+
},
1276912779
"page_size": {
1277012780
"type": "integer",
1277112781
"format": "int64",
@@ -19323,6 +19333,11 @@
1932319333
"description": "No result message for when there are no chunks found above the score threshold.",
1932419334
"nullable": true
1932519335
},
19336+
"only_include_docs_used": {
19337+
"type": "boolean",
19338+
"description": "Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.",
19339+
"nullable": true
19340+
},
1932619341
"page_size": {
1932719342
"type": "integer",
1932819343
"format": "int64",
@@ -22473,7 +22488,7 @@
2247322488
},
2247422489
"is_ecommerce": {
2247522490
"type": "boolean",
22476-
"description": "Whether of not the suggested queries are being generated for ecomm. If true, the suggested queries will be generated for ecomm. If false, the suggested queries will be generated for non-ecomm.",
22491+
"description": "Whether of not the suggested queries are being generated for ecommerce.",
2247722492
"nullable": true
2247822493
},
2247922494
"is_followup": {

clients/ts-sdk/src/types.gen.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,10 @@ export type CreateMessageReqPayload = {
10861086
* No result message for when there are no chunks found above the score threshold.
10871087
*/
10881088
no_result_message?: (string) | null;
1089+
/**
1090+
* Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.
1091+
*/
1092+
only_include_docs_used?: (boolean) | null;
10891093
/**
10901094
* Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None.
10911095
*/
@@ -1594,6 +1598,10 @@ export type EditMessageReqPayload = {
15941598
* No result message for when there are no chunks found above the score threshold.
15951599
*/
15961600
no_result_message?: (string) | null;
1601+
/**
1602+
* Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.
1603+
*/
1604+
only_include_docs_used?: (boolean) | null;
15971605
/**
15981606
* Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None.
15991607
*/
@@ -3695,6 +3703,10 @@ export type RegenerateMessageReqPayload = {
36953703
* No result message for when there are no chunks found above the score threshold.
36963704
*/
36973705
no_result_message?: (string) | null;
3706+
/**
3707+
* Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.
3708+
*/
3709+
only_include_docs_used?: (boolean) | null;
36983710
/**
36993711
* Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None.
37003712
*/
@@ -4525,7 +4537,7 @@ export type SuggestedQueriesReqPayload = {
45254537
context?: (string) | null;
45264538
filters?: ((ChunkFilter) | null);
45274539
/**
4528-
* Whether of not the suggested queries are being generated for ecomm. If true, the suggested queries will be generated for ecomm. If false, the suggested queries will be generated for non-ecomm.
4540+
* Whether of not the suggested queries are being generated for ecommerce.
45294541
*/
45304542
is_ecommerce?: (boolean) | null;
45314543
/**

server/src/data/models.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,6 +4547,7 @@ impl ApiKeyRequestParams {
45474547
typo_options: self.typo_options.or(payload.typo_options),
45484548
metadata: payload.metadata,
45494549
use_agentic_search: payload.use_agentic_search,
4550+
only_include_docs_used: payload.only_include_docs_used,
45504551
}
45514552
}
45524553

@@ -9432,6 +9433,7 @@ impl<'de> Deserialize<'de> for CreateMessageReqPayload {
94329433
use_quote_negated_terms: Option<bool>,
94339434
remove_stop_words: Option<bool>,
94349435
typo_options: Option<TypoOptions>,
9436+
pub only_include_docs_used: Option<bool>,
94359437
}
94369438

94379439
let mut helper = Helper::deserialize(deserializer)?;
@@ -9472,6 +9474,7 @@ impl<'de> Deserialize<'de> for CreateMessageReqPayload {
94729474
remove_stop_words: helper.remove_stop_words,
94739475
typo_options: helper.typo_options,
94749476
use_agentic_search: helper.use_agentic_search,
9477+
only_include_docs_used: helper.only_include_docs_used,
94759478
})
94769479
}
94779480
}
@@ -9506,6 +9509,7 @@ impl<'de> Deserialize<'de> for RegenerateMessageReqPayload {
95069509
pub typo_options: Option<TypoOptions>,
95079510
pub rag_context: Option<String>,
95089511
pub use_agentic_search: Option<bool>,
9512+
pub only_include_docs_used: Option<bool>,
95099513
}
95109514

95119515
let mut helper = Helper::deserialize(deserializer)?;
@@ -9543,6 +9547,7 @@ impl<'de> Deserialize<'de> for RegenerateMessageReqPayload {
95439547
typo_options: helper.typo_options,
95449548
rag_context: helper.rag_context,
95459549
use_agentic_search: helper.use_agentic_search,
9550+
only_include_docs_used: helper.only_include_docs_used,
95469551
})
95479552
}
95489553
}
@@ -9581,6 +9586,7 @@ impl<'de> Deserialize<'de> for EditMessageReqPayload {
95819586
pub typo_options: Option<TypoOptions>,
95829587
pub rag_context: Option<String>,
95839588
pub use_agentic_search: Option<bool>,
9589+
pub only_include_docs_used: Option<bool>,
95849590
}
95859591

95869592
let mut helper = Helper::deserialize(deserializer)?;
@@ -9622,6 +9628,7 @@ impl<'de> Deserialize<'de> for EditMessageReqPayload {
96229628
typo_options: helper.typo_options,
96239629
rag_context: helper.rag_context,
96249630
use_agentic_search: helper.use_agentic_search,
9631+
only_include_docs_used: helper.only_include_docs_used,
96259632
})
96269633
}
96279634
}

server/src/handlers/message_handler.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ pub struct CreateMessageReqPayload {
106106
pub context_options: Option<ContextOptions>,
107107
/// No result message for when there are no chunks found above the score threshold.
108108
pub no_result_message: Option<String>,
109+
/// Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.
110+
pub only_include_docs_used: Option<bool>,
109111
/// The currency to use for the completion. If not specified, this defaults to "USD".
110112
pub currency: Option<String>,
111113
/// Search_type can be either "semantic", "fulltext", or "hybrid". "hybrid" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using scores from a cross encoder model. "semantic" will pull in one page (10 chunks) of the nearest cosine distant vectors. "fulltext" will pull in one page (10 chunks) of full-text results based on SPLADE. Default is "hybrid".
@@ -271,6 +273,7 @@ pub async fn create_message(
271273
&dataset_config,
272274
previous_messages,
273275
create_message_data.use_agentic_search.unwrap_or(false),
276+
create_message_data.only_include_docs_used.unwrap_or(false),
274277
new_message,
275278
dataset_org_plan_sub.dataset.id,
276279
&create_message_pool,
@@ -406,6 +409,8 @@ pub struct RegenerateMessageReqPayload {
406409
pub context_options: Option<ContextOptions>,
407410
/// No result message for when there are no chunks found above the score threshold.
408411
pub no_result_message: Option<String>,
412+
/// Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.
413+
pub only_include_docs_used: Option<bool>,
409414
/// The currency symbol to use for the completion. If not specified, this defaults to "$".
410415
pub currency: Option<String>,
411416
/// Search_type can be either "semantic", "fulltext", or "hybrid". "hybrid" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using scores from a cross encoder model. "semantic" will pull in one page (10 chunks) of the nearest cosine distant vectors. "fulltext" will pull in one page (10 chunks) of full-text results based on SPLADE. Default is "hybrid".
@@ -460,6 +465,8 @@ pub struct EditMessageReqPayload {
460465
pub context_options: Option<ContextOptions>,
461466
/// No result message for when there are no chunks found above the score threshold.
462467
pub no_result_message: Option<String>,
468+
/// Only include docs used is a boolean that indicates whether or not to only include the docs that were used in the completion. If true, the completion will only include the docs that were used in the completion. If false, the completion will include all of the docs.
469+
pub only_include_docs_used: Option<bool>,
463470
/// The currency symbol to use for the completion. If not specified, this defaults to "$".
464471
pub currency: Option<String>,
465472
/// Search_type can be either "semantic", "fulltext", or "hybrid". "hybrid" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using scores from a cross encoder model. "semantic" will pull in one page (10 chunks) of the nearest cosine distant vectors. "fulltext" will pull in one page (10 chunks) of full-text results based on SPLADE. Default is "hybrid".
@@ -517,6 +524,7 @@ impl From<EditMessageReqPayload> for CreateMessageReqPayload {
517524
metadata: data.metadata,
518525
rag_context: data.rag_context,
519526
use_agentic_search: data.use_agentic_search,
527+
only_include_docs_used: data.only_include_docs_used,
520528
}
521529
}
522530
}
@@ -548,6 +556,7 @@ impl From<RegenerateMessageReqPayload> for CreateMessageReqPayload {
548556
metadata: data.metadata,
549557
rag_context: data.rag_context,
550558
use_agentic_search: data.use_agentic_search,
559+
only_include_docs_used: data.only_include_docs_used,
551560
}
552561
}
553562
}

0 commit comments

Comments
 (0)