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

Make object parameters optional #326

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

Conversation

dimitrov-d
Copy link
Contributor

@dimitrov-d dimitrov-d commented Mar 15, 2025

Pull Request Description

This PR makes some object parameters optional, where it is not required to include them

Related Issue

References #325

Changes Made

This PR adds the following changes:

  • Make config parameter optional on the SolanaAgentKit class constructor
  • Handle cases where config is optional in constructor

Checklist

  • I have tested these changes locally
  • I have updated the documentation

Copy link
Collaborator

@michaelessiet michaelessiet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Action.schema field needs to be required due to MCP compatibility issues. Please revert this change. The other config optionality change is fine

@dimitrov-d
Copy link
Contributor Author

The Action.schema field needs to be required due to MCP compatibility issues. Please revert this change. The other config optionality change is fine

@michaelessiet I made the requested changes.

The only place where this might cause errors is for the actions that reference the config, for example agent.config.HELIUS_API_KEY, however I think it's not a breaking change since to use these actions the developer is required to pass in the required parameters through the configOrKey object anyway.

@michaelessiet
Copy link
Collaborator

Ok.

Please make sure to add the optional operator to any references of agent.config.*. Should be agent.config?.* since config is now optional, and please update the definition within the SolanaAgentKit class. These changes will improve readability and help future contributors understand that config isn't always defined.

Screenshot 2025-03-17 at 19 39 31

@dimitrov-d
Copy link
Contributor Author

Ok.

Please make sure to add the optional operator to any references of agent.config.*. Should be agent.config?.* since config is now optional, and please update the definition within the SolanaAgentKit class. These changes will improve readability and help future contributors understand that config isn't always defined.

Done, I've made the necessary changes @michaelessiet

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.

2 participants