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(afj): initial support for afj agent #188

Merged
merged 11 commits into from
Jun 14, 2022

Conversation

berendsliedrecht
Copy link
Member

  • Adds support for an afj agent
  • Errors when an agent does not implement the subcommand
  • Removed some colored output (we can add it back if we have a consistent pattern for it)
  • Implemented schema only for afj to test (does not work as the agent I used required some login or something)
  • No version support yet (still have to figure this out)
  • No breaking changes for aca-py users
  • Adds agent key to the environment
    • accepts aca-py and afj and if its none, aca-py is selected
  • Might contain some minor bugs but I have done some testing and I did not find any issues.

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

This looks great @blu3beri ! I left a question about the current structure of the new Agent structure.

crates/cli/src/help_strings.rs Outdated Show resolved Hide resolved
crates/cli/src/help_strings.rs Outdated Show resolved Hide resolved
crates/agent/src/agent.rs Outdated Show resolved Hide resolved
Comment on lines 3 to 9
pub struct Agent<A> {
/// Default cloud agent structure
pub agent: A,

/// version string, e.g. 0.7.3
pub version: String,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice if we could remove the nested agent here. I see we originally use impl TraitX, does that no longer work? For example:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=76fe7705e6b59d29aaa03e3993c31327

Copy link
Contributor

Choose a reason for hiding this comment

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

That way we can just pass the instantiated agent objects around directly, or do the return types of the functions diverge too much? Enlighten me to the rusty ways.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes you are correct, this was slightly left over from when I wanted to do a better match based on the commands... But Rust does not allow you to return Agent<A> and Agent<B> from seperate match arms as they are not the same type.

berendsliedrecht and others added 3 commits June 14, 2022 11:27
Co-authored-by: Jean-Louis Leysens <[email protected]>
Co-authored-by: Jean-Louis Leysens <[email protected]>
Co-authored-by: Jean-Louis Leysens <[email protected]>
Copy link
Contributor

@morrieinmaas morrieinmaas left a comment

Choose a reason for hiding this comment

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

Just left a few comments (that you have addressed already🙌). Nice job!

@berendsliedrecht
Copy link
Member Author

@jloleysens any other notes or is it ready to be merged?

@berendsliedrecht berendsliedrecht merged commit 775d7fd into animo:main Jun 14, 2022
@berendsliedrecht berendsliedrecht deleted the feat/initial-afj-support branch June 14, 2022 14:38
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.

3 participants