NPM Package #539
Replies: 2 comments 2 replies
-
Nice one guys! Excited to see what you guys put together 😁 When you think that you are close to an MVP please let us know - we would be keen to help out 👍 |
Beta Was this translation helpful? Give feedback.
-
Quick update on a hurdle. When creating digests, we need to ensure that they match Python digests for cross-platform and backward compatibility. I created #570 to document an issue that puts more responsibility on the user to create a model that is compatible with Python agents. This has become a recurring theme. Pydantic handles open API schema generation for Python and introduces a few quirks that need to be ported to the NPM package. For example, Pydantic automatically separates key-value pairs and elements in arrays with a space. Pydantic also automatically adds titles to all attributes where the title appears to be the attribute name separated into words and capitalized. As much as possible I tried to cover up these quirks but, the user still needs to write their model in a way that allows us to copy the Pydantic open api generation. Here's a a python model that evaluates too: class SuperImportantCheck(Model):
"""Plus random docstring"""
check: bool
message: str
counter: int The equivalent npm model in our current implementation looks like this const schema = z
.object({
check: z.boolean(),
message: z.string(),
counter: z.number().int(),
})
.openapi({
description: "Plus random docstring",
title: "SuperImportantCheck",
}); |
Beta Was this translation helpful? Give feedback.
-
Hey @steeevin88, @joshua-demo, @jonathanguven, and myself are working on creating an NPM package for uAgents. This discussion will serve as a place to talk about our progress, and for our team to solicit feedback from the Fetch AI Agents Team.
Beta Was this translation helpful? Give feedback.
All reactions