File tree Expand file tree Collapse file tree
src/lang2sql/frontends/discord Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,12 +150,41 @@ async def connect(interaction: discord.Interaction, dsn: str) -> None:
150150 handlers .connect (to_identity (_interaction_context (interaction )), dsn ),
151151 )
152152
153- @tree .command (name = "ingest" , description = "Propose definitions from a document" )
154- async def ingest (interaction : discord .Interaction , ref : str ) -> None :
153+ @tree .command (
154+ name = "ingest" ,
155+ description = "문서에서 비즈니스 용어 후보 추출 (ref: 파일명, content: 텍스트 직접 입력)" ,
156+ )
157+ async def ingest (
158+ interaction : discord .Interaction ,
159+ ref : str = "" ,
160+ content : str = "" ,
161+ ) -> None :
155162 await self ._run (
156163 interaction ,
157164 handlers .ingest (
158- to_identity (_interaction_context (interaction )), ref = ref
165+ to_identity (_interaction_context (interaction )),
166+ ref = ref or None ,
167+ content = content or None ,
168+ ),
169+ )
170+
171+ @tree .command (
172+ name = "confirm_ingest" ,
173+ description = "ingest로 추출한 후보를 시멘틱 레이어에 등록" ,
174+ )
175+ async def confirm_ingest (
176+ interaction : discord .Interaction ,
177+ ref : str ,
178+ accept : str = "all" ,
179+ layer : str = "channel" ,
180+ ) -> None :
181+ await self ._run (
182+ interaction ,
183+ handlers .confirm_ingest (
184+ to_identity (_interaction_context (interaction )),
185+ ref = ref ,
186+ accept = accept ,
187+ layer = layer ,
159188 ),
160189 )
161190
Original file line number Diff line number Diff line change @@ -247,6 +247,23 @@ async def ingest(
247247 result = await ctx .tools .dispatch ("ingest_doc" , args , ctx , "cmd:ingest" )
248248 return OutboundMessage (text = result .content )
249249
250+ async def confirm_ingest (
251+ self ,
252+ identity : Identity ,
253+ ref : str ,
254+ accept : str = "all" ,
255+ layer : str = "channel" ,
256+ ) -> OutboundMessage :
257+ """ingest_doc로 추출한 후보를 검토 후 시멘틱 레이어에 등록."""
258+ ctx = await self ._concierge .build_context (identity )
259+ result = await ctx .tools .dispatch (
260+ "confirm_ingest" ,
261+ {"ref" : ref , "accept" : accept , "layer" : layer },
262+ ctx ,
263+ "cmd:confirm_ingest" ,
264+ )
265+ return OutboundMessage (text = result .content )
266+
250267
251268def _fmt_ts (ts : float ) -> str :
252269 """Format an epoch timestamp as a short UTC string for audit listings."""
You can’t perform that action at this time.
0 commit comments