Skip to content

Commit

Permalink
llm logs --json for attachments, refs #587
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Oct 28, 2024
1 parent 2384fd5 commit a9bc1c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,11 @@ def logs_list(

if json_output:
# Output as JSON if requested
for row in rows:
row["attachments"] = [
{k: v for k, v in attachment.items() if k != "response_id"}
for attachment in attachments_by_id.get(row["id"], [])
]
click.echo(json.dumps(list(rows), indent=2))
elif response:
# Just output the last response
Expand Down

0 comments on commit a9bc1c7

Please sign in to comment.