Skip to content

Allowing protocol_serde functions to be used externally #1279

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

Closed
1 of 2 tasks
azriel-healthpoint opened this issue Apr 14, 2025 · 2 comments
Closed
1 of 2 tasks

Allowing protocol_serde functions to be used externally #1279

azriel-healthpoint opened this issue Apr 14, 2025 · 2 comments
Labels
duplicate This issue is a duplicate. feature-request A feature should be added or improved.

Comments

@azriel-healthpoint
Copy link

azriel-healthpoint commented Apr 14, 2025

Describe the feature

#269 indicates issues with implementing Serialize/Deserialize for all types; but since there is code in shape_api_result.rs that serializes this (and other) type(s), could they be made public so that applications can use the same logic, instead of duplicating the types just to enable serialization?

Use Case

Hi! I'm writing a bedrock agent lambda handler, and I'd like to return an ApiResult, as that (looks like) the documented return shape -- I may be wrong here, so please correct me if I am!

However, since it doesn't implement Serialize/Deserialize, which is a requirement of the lambda return type, I need another way of serializing it.

pub(crate) async fn function_handler(event: LambdaEvent<AgentEvent>)
-> Result<ApiResult, Error> {
    //    ^^^^^^^^^ the type here needs to impl Serialize;
    //              a different type can be used as long as
    //              it serializes to the bedrock-agent accepted
    //              response
    // ..
}

Proposed Solution

Probably a larger conversation, since allowing consumers to access the protocol_serde module logic may be too wide a net to cast and support as API.

Other Information

Currently InvokeInlineAgent uses that under the hood (so, client.invoke_inline_agent()..`), but I didn't want to misuse that call as a way to reach the serialization code.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

A note for the community

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue, please leave a comment
@azriel-healthpoint azriel-healthpoint added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 14, 2025
@aajtodd
Copy link
Contributor

aajtodd commented Apr 14, 2025

Support for serde support is indeed a common request and there has been a lot of research and work in this area but it's not supported today.

Closing as a duplicate of one of the following:

@aajtodd aajtodd closed this as completed Apr 14, 2025
@aajtodd aajtodd added duplicate This issue is a duplicate. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 14, 2025
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate. feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants