33from typing import Any , Dict
44
55import jentic
6+
67try :
78 import click # type: ignore
89except Exception : # pragma: no cover - graceful fallback if click missing
@@ -78,7 +79,10 @@ def default_for(name: str, prop_schema: Dict[str, Any]) -> Any:
7879 for name , prop_schema in properties .items ():
7980 if name in inputs :
8081 continue
81- if any (k in name .lower () for k in ["query" , "q" , "search" , "topic" , "keywords" , "limit" , "count" ]):
82+ if any (
83+ k in name .lower ()
84+ for k in ["query" , "q" , "search" , "topic" , "keywords" , "limit" , "count" ]
85+ ):
8286 inputs [name ] = default_for (name , prop_schema )
8387
8488 return inputs
@@ -89,7 +93,9 @@ async def concept_find_articles_about_ai(client: jentic.Jentic) -> int:
8993
9094 query = "find articles about AI"
9195 print (f"Searching: { query } " )
92- search_response = await client .search (jentic .SearchRequest (query = query , limit = 5 , filter_by_credentials = False ))
96+ search_response = await client .search (
97+ jentic .SearchRequest (query = query , limit = 5 , filter_by_credentials = False )
98+ )
9399
94100 if not search_response .results :
95101 print ("No results found." )
@@ -181,6 +187,8 @@ async def concept_send_discord_message(
181187 print (f"Output: { out_preview } " )
182188
183189 return 0 if exec_resp .success else 1
190+
191+
184192def main () -> None :
185193 if click is None :
186194 print ("This CLI requires 'click'. Install it with: pip install click" )
@@ -206,7 +214,9 @@ def cli(ctx: Any, agent_key: str, environment: str) -> None: # noqa: ANN401 - c
206214 ctx .obj ["agent_key" ] = agent_key
207215 ctx .obj ["environment" ] = environment
208216
209- @cli .command ("articles-ai" , help = "Run the 'find articles about AI' concept (search → load → execute)" )
217+ @cli .command (
218+ "articles-ai" , help = "Run the 'find articles about AI' concept (search → load → execute)"
219+ )
210220 @click .pass_context
211221 def articles_ai (ctx : Any ) -> None : # noqa: ANN401 - click runtime
212222 config = jentic .AgentConfig (
@@ -240,4 +250,3 @@ def discord_send(ctx: Any, message: str | None, channel_id: str | None) -> None:
240250
241251if __name__ == "__main__" :
242252 main ()
243-
0 commit comments