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

Response is not JSON serializable #12

Open
beddows opened this issue Apr 6, 2023 · 3 comments
Open

Response is not JSON serializable #12

beddows opened this issue Apr 6, 2023 · 3 comments

Comments

@beddows
Copy link

beddows commented Apr 6, 2023

When using "response = agent.send(message)", I'm getting "Object of type generator is not JSON serializable".

I noticed that handle_message in ToolManager has been updated quite a bit and I'm trying to understand how it returns a response to the agent (e.g.: for use in tests/main.py).

@kyb3r
Copy link
Owner

kyb3r commented Apr 6, 2023

right now i changed it so that the library streams responses. You can put the response and put it in a for loop and print each character like this:

for token in response:
  print(token, end="", flush=True)

I still need to implement the option of switching between streaming and just the normal mode.

I haven’t updated tests/main.py to work yet unfortunately. But try the others.

@beddows
Copy link
Author

beddows commented Apr 7, 2023

Thanks @kyb3r , have it working now! Yes, I've been playing with clinic.py, which is very cool. Has given me a lot of ideas to think through.

In terms of priorities, what kinds of contributions are you looking for from the community? How can I chip in? I have all kinds of ideas regarding your excellent HMCS implementation.

@kyb3r
Copy link
Owner

kyb3r commented Apr 9, 2023

Making the implementation of tools more robust is something that needs experimentation.

I’m also thinking of making alternate ways of storing memories.

One thing I might want to explore is giving the agent access to a save_memory tool so it can store memories on it’s own accord.

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

No branches or pull requests

2 participants