@@ -13,7 +13,23 @@ use rand::prelude::SliceRandom;
1313
1414use crate :: models:: { CommunityReport , Entity } ;
1515
16- use super :: context_builder:: GlobalSearchContextBuilderParams ;
16+ #[ derive( Debug , Clone ) ]
17+ pub struct CommunityContextBuilderParams {
18+ pub use_community_summary : bool ,
19+ pub column_delimiter : String ,
20+ pub shuffle_data : bool ,
21+ pub include_community_rank : bool ,
22+ pub min_community_rank : u32 ,
23+ pub community_rank_name : String ,
24+ pub include_community_weight : bool ,
25+ pub community_weight_name : String ,
26+ pub normalize_community_weight : bool ,
27+ pub max_tokens : usize ,
28+ pub context_name : String ,
29+ // conversation_history: Option<ConversationHistory>,
30+ // conversation_history_user_turns_only: bool,
31+ // conversation_history_max_turns: Option<i32>,
32+ }
1733
1834pub struct GlobalCommunityContext {
1935 community_reports : Vec < CommunityReport > ,
@@ -34,11 +50,11 @@ impl GlobalCommunityContext {
3450 }
3551 }
3652
37- pub async fn build_context (
53+ pub fn build_context (
3854 & self ,
39- context_builder_params : GlobalSearchContextBuilderParams ,
55+ context_builder_params : CommunityContextBuilderParams ,
4056 ) -> anyhow:: Result < ( Vec < String > , HashMap < String , DataFrame > ) > {
41- let GlobalSearchContextBuilderParams {
57+ let CommunityContextBuilderParams {
4258 use_community_summary,
4359 column_delimiter,
4460 shuffle_data,
0 commit comments