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

[new feature] Implement Assets - part 1 #359

Merged
merged 6 commits into from
Sep 6, 2023
Merged

[new feature] Implement Assets - part 1 #359

merged 6 commits into from
Sep 6, 2023

Conversation

eolivelli
Copy link
Member

@eolivelli eolivelli commented Sep 6, 2023

Fixes #353

Summary:

  • Add the new concept of "asset"
  • An Asset is an external resource that is handled by the LangStream application
  • At deploy time and undeploy time the "init job" and the "clean up job" can execute some code, dependent on the type of the asset

The main use case here is to create tables of vector databases in order to fully set up the application when you deploy it

This is a preliminary PR that builds all the infrastructure to make Assets work.
The next step is to implement the "cassandra-table" AssetManager (and maybe validation at the planner side of the available asset types)

@eolivelli eolivelli changed the title [new feature] Implement Assets [new feature] Implement Assets - part 1 Sep 6, 2023
@eolivelli eolivelli marked this pull request as ready for review September 6, 2023 12:24
Copy link
Member

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

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

LGTM

AssetPackage assetPackage = assetManagerPackageLoader.loadPackageForAsset(assetType);

if (assetPackage != null) {
log.info("Found the package the agent belongs to: {}", assetPackage.getName());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log.info("Found the package the agent belongs to: {}", assetPackage.getName());
log.info("Found the package the asset belongs to: {}", assetPackage.getName());

throw new RuntimeException(
"Package "
+ assetPackage.getName()
+ " declared to support agent type "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ " declared to support agent type "
+ " declared to support asset type "

+ assetPackage.getName()
+ " declared to support agent type "
+ assetType
+ " but no agent found");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ " but no agent found");
+ " but no asset found");

return agentCodeProviderProvider;
}

log.info("No agent found in the package, let's try to find it among all the packages");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log.info("No agent found in the package, let's try to find it among all the packages");
log.info("No asset found in the package, let's try to find it among all the packages");

}
}

throw new RuntimeException("No AgentCodeProvider found for type " + assetType);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw new RuntimeException("No AgentCodeProvider found for type " + assetType);
throw new RuntimeException("No AssetPackage found for type " + assetType);

@eolivelli
Copy link
Member Author

thank you @nicoloboschi for your review
I will address your comments in the next patch

@eolivelli eolivelli merged commit 7657fc0 into main Sep 6, 2023
8 checks passed
@eolivelli eolivelli deleted the impl/assets branch September 6, 2023 12:42
benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants