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

Feat/genlayer plugin #975

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

AgustinRamiroDiaz
Copy link

@AgustinRamiroDiaz AgustinRamiroDiaz commented Dec 10, 2024

This is my first time contributing to this project. I've based my code on the docs, but mostly copying other plugins

Please let me know anything that can be improved :)

Relates to:

#972

Risks

None that I can think of

Background

What does this PR do?

Adds a plugin to be able to interact with GenLayer

What kind of change is this?

Feature

Why are we doing this? Any context or related work?

I want to be able to interact with GenLayer with eliza

Documentation changes needed?

Is there a section for plugin documentation?

Testing

None.
Is there a way to do some integration tests with the agent? Like being able to prompt it and go through the whole flow?

Where should a reviewer start?

packages/plugin-genlayer/src/index.ts

Detailed testing steps

As a user

  • create a character with the genlayer plugin
  • pnpm build && pnpm start
  • prompt it to interact with GenLayer
  • you should be able to interact with any of the actions added

Discord username

agustinramirodiaz

@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Dec 10, 2024
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
@AgustinRamiroDiaz
Copy link
Author

AgustinRamiroDiaz commented Dec 11, 2024

Hey everyone!

What's the recommended way to extract parameters from an Action?

I saw some examples like in buttplug

https://github.com/ai16z/eliza/blob/7fb73d209a5d6d09a039515a088ff14b48691511/packages/plugin-buttplug/src/index.ts#L359-L373

where they add it to the examples inside options, but that didn't work for me (I was always getting empty options)

Then I saw other examples like in the discord client
https://github.com/ai16z/eliza/blob/7fb73d209a5d6d09a039515a088ff14b48691511/packages/client-discord/src/actions/joinvoice.ts#L147-L157
where there's an ad-hoc crafted state in order to call an LLM with composeContext + generateText

I like the latter solution more, and I could make it work with single messages that have the whole context like read the contrac A on method B with arguments C. I'd like to improve the state to also take into account memories and previous messages so that the user can have a conversation with the agent, instead of having to pass all the information on one message. The thing is that when I've passed the whole state I got answers that were really related to the personality of the character, and I got answers that refused to help like "I'm not here to do that".
How can I incorporate the state's memory without the personality of the character to gather the parameters for my action?

Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
@AgustinRamiroDiaz
Copy link
Author

AgustinRamiroDiaz commented Dec 11, 2024

Also somewhat related to my previous comment:
I'm currently using callbacks to print messages to the user based on the actions that I took. These messages are now static like Here is your output: 42. Is there a recommended way to pass this into the agent and let the agent answer back with it's character's tone and personality?

Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
Signed-off-by: Agustín Ramiro Díaz <agustin.ramiro.diaz@gmail.com>
@AgustinRamiroDiaz AgustinRamiroDiaz marked this pull request as ready for review December 12, 2024 11:20
@AgustinRamiroDiaz AgustinRamiroDiaz changed the base branch from main to develop December 12, 2024 13:52
@odilitime odilitime deleted the branch elizaOS:develop December 13, 2024 02:37
@odilitime odilitime closed this Dec 13, 2024
@odilitime odilitime reopened this Dec 13, 2024
@odilitime odilitime deleted the branch elizaOS:develop December 13, 2024 19:07
@odilitime odilitime closed this Dec 13, 2024
@odilitime odilitime reopened this Dec 13, 2024
@lalalune
Copy link
Member

@AgustinRamiroDiaz state is definitely where it should go, we're looking to refactor this to be a bit more extensible and less hardcoded in v2

@AgustinRamiroDiaz
Copy link
Author

@lalalune thank you very much for that information.

And about my other question, is there a reason why callbacks are not stored on the state? Is there a recommended way to store it?

@odilitime odilitime deleted the branch elizaOS:develop December 17, 2024 02:33
@odilitime odilitime closed this Dec 17, 2024
@odilitime odilitime reopened this Dec 17, 2024
@shakkernerd shakkernerd deleted the branch elizaOS:develop December 17, 2024 03:45
@odilitime odilitime reopened this Dec 17, 2024
@shakkernerd shakkernerd deleted the branch elizaOS:develop December 22, 2024 07:01
@odilitime odilitime reopened this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants