|
| 1 | +commit 007d45e5b1f813debf643958c9527131b5eaee90 |
| 2 | +Author: 王泽松 <zesong.wang1@bytedance.com> |
| 3 | +Date: Thu Sep 25 15:51:05 2025 +0000 |
| 4 | + |
| 5 | + feat: kb outer |
| 6 | + |
| 7 | + * feat: max keyword |
| 8 | + * feat: max keyword |
| 9 | + * feat: kb outer |
| 10 | + * feat: kb outer |
| 11 | + |
| 12 | + See merge request: !10464 |
| 13 | + |
| 14 | +diff --git a/idl/grpc/responses.proto b/idl/grpc/responses.proto |
| 15 | +index 66f1b4cda9..9f10d2f508 100644 |
| 16 | +--- a/idl/grpc/responses.proto |
| 17 | ++++ b/idl/grpc/responses.proto |
| 18 | +@@ -26,6 +26,7 @@ message AnnotationType { |
| 19 | + enum Enum { |
| 20 | + unspecified = 0; |
| 21 | + url_citation = 1; |
| 22 | ++ doc_citation = 2; |
| 23 | + } |
| 24 | + } |
| 25 | + |
| 26 | +@@ -47,8 +48,8 @@ message CoverImage { |
| 27 | + |
| 28 | + message Annotation { |
| 29 | + AnnotationType.Enum type = 1; |
| 30 | +- string title = 2; |
| 31 | +- string url = 3; |
| 32 | ++ optional string title = 2; |
| 33 | ++ optional string url = 3; |
| 34 | + |
| 35 | + // openai does not have |
| 36 | + optional string logo_url = 4; |
| 37 | +@@ -58,6 +59,12 @@ message Annotation { |
| 38 | + optional CoverImage cover_image = 8; |
| 39 | + optional string summary = 9; |
| 40 | + optional string freshness_info = 10; |
| 41 | ++ |
| 42 | ++ // knowledge search citations |
| 43 | ++ optional string doc_id = 11; |
| 44 | ++ optional string doc_name = 12; |
| 45 | ++ optional int32 chunk_id = 13; |
| 46 | ++ repeated google.protobuf.Struct chunk_attachment = 14; |
| 47 | + } |
| 48 | + |
| 49 | + |
| 50 | +@@ -76,6 +83,7 @@ message ItemType { |
| 51 | + mcp_approval_response = 10; |
| 52 | + mcp_list_tools = 11; |
| 53 | + mcp_call = 12; |
| 54 | ++ knowledge_search_call = 13; |
| 55 | + } |
| 56 | + } |
| 57 | + |
| 58 | +@@ -166,6 +174,7 @@ message ToolType { |
| 59 | + web_search = 3; |
| 60 | + image_process = 4; |
| 61 | + mcp = 5; |
| 62 | ++ knowledge_search = 6; |
| 63 | + } |
| 64 | + } |
| 65 | + |
| 66 | +@@ -239,6 +248,11 @@ message EventType { |
| 67 | + response_mcp_call_completed = 39; |
| 68 | + response_mcp_call_failed = 40; |
| 69 | + response_mcp_approval_request = 41; |
| 70 | ++ |
| 71 | ++ response_knowledge_search_call_in_progress = 42; |
| 72 | ++ response_knowledge_search_call_searching = 43; |
| 73 | ++ response_knowledge_search_call_completed = 44; |
| 74 | ++ response_knowledge_search_call_failed = 45; |
| 75 | + } |
| 76 | + } |
| 77 | + |
| 78 | +@@ -318,6 +332,7 @@ message InputItem { |
| 79 | + ItemFunctionMcpListTools mcp_list_tools = 11; |
| 80 | + ItemFunctionMcpCall function_mcp_call = 12; |
| 81 | + ItemFunctionWebSearch function_web_search_call = 13; |
| 82 | ++ ItemFunctionKnowledgeSearch function_knowledge_search = 14; |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | +@@ -474,6 +489,14 @@ message ItemFunctionMcpCall { |
| 87 | + optional string id = 8; |
| 88 | + } |
| 89 | + |
| 90 | ++message ItemFunctionKnowledgeSearch { |
| 91 | ++ ItemType.Enum type = 1; |
| 92 | ++ repeated string queries = 2; |
| 93 | ++ string knowledge_resource_id = 3; |
| 94 | ++ ItemStatus.Enum status = 4; |
| 95 | ++ optional string id = 5; |
| 96 | ++} |
| 97 | ++ |
| 98 | + message ActionType { |
| 99 | + enum Enum { |
| 100 | + unspecified = 0; |
| 101 | +@@ -489,7 +512,6 @@ message Action { |
| 102 | + message OutputContentItemText { |
| 103 | + ContentItemType.Enum type = 1; |
| 104 | + string text = 2; |
| 105 | +- // other output specific field like annotation |
| 106 | + repeated Annotation annotations = 3; |
| 107 | + } |
| 108 | + |
| 109 | +@@ -558,6 +580,7 @@ message ResponsesTool { |
| 110 | + ToolWebSearch tool_web_search = 2; |
| 111 | + ToolImageProcess tool_image_process = 3; |
| 112 | + ToolMcp tool_mcp = 4; |
| 113 | ++ ToolKnowledgeSearch tool_knowledge_search = 5; |
| 114 | + } |
| 115 | + } |
| 116 | + |
| 117 | +@@ -586,6 +609,7 @@ message ToolWebSearch { |
| 118 | + optional int64 limit = 2; |
| 119 | + optional UserLocation user_location = 3; |
| 120 | + repeated SourceType.Enum sources = 4; |
| 121 | ++ optional int32 max_keyword = 5; |
| 122 | + } |
| 123 | + |
| 124 | + message ImageProcessPointOptions { |
| 125 | +@@ -666,6 +690,17 @@ message ToolMcp { |
| 126 | + optional string server_description = 7; |
| 127 | + } |
| 128 | + |
| 129 | ++message ToolKnowledgeSearch { |
| 130 | ++ ToolType.Enum type = 1; |
| 131 | ++ string knowledge_resource_id = 2; |
| 132 | ++ optional string description = 3; |
| 133 | ++ optional int64 limit = 4; |
| 134 | ++ optional double dense_weight = 5; |
| 135 | ++ optional google.protobuf.Struct doc_filter = 6; |
| 136 | ++ optional google.protobuf.Struct ranking_options = 7; |
| 137 | ++ optional int32 max_keyword = 8; |
| 138 | ++} |
| 139 | ++ |
| 140 | + message ToolFunction { |
| 141 | + string name = 1; |
| 142 | + optional bool strict = 2; |
| 143 | +@@ -716,6 +751,7 @@ message OutputItem { |
| 144 | + ItemFunctionMcpApprovalRequest function_mcp_approval_request = 7; |
| 145 | + ItemFunctionMcpListTools function_mcp_list_tools = 8; |
| 146 | + ItemFunctionMcpCall function_mcp_call = 9; |
| 147 | ++ ItemFunctionKnowledgeSearch function_knowledge_search = 10; |
| 148 | + } |
| 149 | + } |
| 150 | + |
| 151 | +@@ -747,12 +783,14 @@ message Usage { |
| 152 | + message ToolUsage { |
| 153 | + optional int64 web_search = 1; |
| 154 | + optional int64 mcp = 2; |
| 155 | ++ optional int64 knowledge_search = 3; |
| 156 | + } |
| 157 | + |
| 158 | + |
| 159 | + message ToolUsageDetail { |
| 160 | + map<string, int64> web_search = 1; |
| 161 | + map<string, int64> mcp = 2; |
| 162 | ++ map<string, int64> knowledge_search = 3; |
| 163 | + } |
| 164 | + |
| 165 | + message InputTokensDetails { |
| 166 | +@@ -790,8 +828,11 @@ message Event { |
| 167 | + ResponseMcpCallArgumentsDoneEvent response_mcp_call_arguments_done = 22; |
| 168 | + ResponseMcpCallCompletedEvent response_mcp_call_completed = 23; |
| 169 | + ResponseMcpCallFailedEvent response_mcp_call_failed = 24; |
| 170 | +- |
| 171 | + ResponseMcpApprovalRequestEvent response_mcp_approval_request = 25; |
| 172 | ++ ResponseKnowledgeSearchCallInProgressEvent response_knowledge_search_call_in_progress = 26; |
| 173 | ++ ResponseKnowledgeSearchCallSearchingEvent response_knowledge_search_call_searching = 27; |
| 174 | ++ ResponseKnowledgeSearchCallCompletedEvent response_knowledge_search_call_completed = 28; |
| 175 | ++ ResponseKnowledgeSearchCallFailedEvent response_knowledge_search_call_failed = 29; |
| 176 | + } |
| 177 | + } |
| 178 | + |
| 179 | +@@ -942,6 +983,34 @@ message ResponseMcpCallFailedEvent { |
| 180 | + int64 sequence_number = 4; // @inject_tag: json:"sequence_number" |
| 181 | + } |
| 182 | + |
| 183 | ++message ResponseKnowledgeSearchCallInProgressEvent { |
| 184 | ++ EventType.Enum type = 1; |
| 185 | ++ string item_id = 2; |
| 186 | ++ int64 output_index = 3; |
| 187 | ++ int64 sequence_number = 4; // @inject_tag: json:"sequence_number" |
| 188 | ++} |
| 189 | ++ |
| 190 | ++message ResponseKnowledgeSearchCallSearchingEvent { |
| 191 | ++ EventType.Enum type = 1; |
| 192 | ++ string item_id = 2; |
| 193 | ++ int64 output_index = 3; |
| 194 | ++ int64 sequence_number = 4; // @inject_tag: json:"sequence_number" |
| 195 | ++} |
| 196 | ++ |
| 197 | ++message ResponseKnowledgeSearchCallCompletedEvent { |
| 198 | ++ EventType.Enum type = 1; |
| 199 | ++ string item_id = 2; |
| 200 | ++ int64 output_index = 3; |
| 201 | ++ int64 sequence_number = 4; // @inject_tag: json:"sequence_number" |
| 202 | ++} |
| 203 | ++ |
| 204 | ++message ResponseKnowledgeSearchCallFailedEvent { |
| 205 | ++ EventType.Enum type = 1; |
| 206 | ++ string item_id = 2; |
| 207 | ++ int64 output_index = 3; |
| 208 | ++ int64 sequence_number = 4; // @inject_tag: json:"sequence_number" |
| 209 | ++} |
| 210 | ++ |
| 211 | + message ResponseEvent { |
| 212 | + EventType.Enum type = 1; |
| 213 | + ResponseObject response = 2; |
0 commit comments