Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native functions for basic file IO and math calculation #280

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lifuhuang
Copy link

This pull request introduced two basic functions for file read and write. The goal here is to provide a simple way to support long-term memory. I added an example where I leveraged these functions to implement a simple AI memo. But I tried to keep the native functions general enough because they have potentials to be leveraged in other more advanced scenarios as well (e.g., scratchpad for assistant execution planning).

@lifuhuang lifuhuang changed the title Add native functions for basic file IO Add native functions for basic file IO and math calculation Dec 31, 2024
@lifuhuang
Copy link
Author

lifuhuang commented Dec 31, 2024

Update: when using the memo feature I implemented with the IO operations in my own fork, I noticed that LLMs were less helpful with numerical inquiries (e.g. "how much milk did I feed the baby today?"), so I pushed a new iteration with a basic calculator function and examples.

Now the assistant is able to do something like this:

User:
How much milk did the baby drink today?

Assistant:
I found the following entries in the memo regarding how much the baby drank today:

  • 130 ml at 00:30
  • 125 ml at 05:00
  • 110 ml at 13:00
  • 125 ml at 06:00
  • 130 ml at 21:00

I added these amounts together:

130 + 125 + 110 + 125 + 130 = 620 ml.

That's how I reached the total of 620 milliliters.

Sorry if I am hijacking the same PR for two different things and should have sent them in separate PRs :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant