File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -204,5 +204,28 @@ def list_metrics():
204204 raise
205205
206206
207+ MAX_LOGS = 10
208+
209+ @list_app .command (name = "logs" )
210+ def list_logs (limit : int = MAX_LOGS ):
211+ """Command to get all logs.
212+
213+ Args:
214+ limit: Maximum number of logs to return (default: `MAX_LOGS`)
215+ """
216+ try :
217+ quotient = QuotientAI ()
218+ response = quotient .logs .list (limit = limit )
219+
220+ if len (response ) > MAX_LOGS : # Always show max 10 in CLI
221+ console .print (response [:MAX_LOGS ])
222+ remaining = len (response ) - MAX_LOGS
223+ console .print (f"[yellow]\n ... { remaining } more logs available. Use --limit <number> or the SDK to view more.[/yellow]" )
224+ else :
225+ console .print (response )
226+ except QuotientAIError as e :
227+ raise
228+
229+
207230if __name__ == "__main__" :
208231 typer .run (app )
You can’t perform that action at this time.
0 commit comments