Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm opening this PR to 'work in public' on this API. I heavily used Claude 4 Sonnet to write this, because I am unfamiliar with the codebase, so the code is somewhat messy and not well-structured, but I will clean it up before a final merge.
But so far it works! Here is my 'financial advisor' in open-webui looking up how much I've spent on coffee for example:
That's since 2019, I don't spend that much every month hehe. I had to give it the full account name because the
/accounts/{name}/balance
endpoint matches exactly rather than using regex, which is a bug.TODOs and issues to work out:
/api/llm
Some open questions:
/accounts
endpoints, but the hledger CLI is organized aroundbal
andreg
, so now I'm thinking its best to mimic the CLI as closely as possible. Does that sound right?{"commodity": "USD", "quantity": "1000"}
. I'm not sure how much information is useful, as a human reader I just want$1000
, so maybe that's what should be in the final output.