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

Add generic artifact #983

Merged
merged 10 commits into from
Jul 18, 2024
Merged

Add generic artifact #983

merged 10 commits into from
Jul 18, 2024

Conversation

collindutter
Copy link
Member

@collindutter collindutter commented Jul 15, 2024

Describe your changes

Adds a GenericArtifact that can be used to pass arbitrary data around. Also adds an example of how we can use this Artifact to pass a Google-specific video file to GooglePromptDriver.

Issue ticket number and link

NA

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
griptape/schemas/base_schema.py 75.00% 1 Missing and 1 partial ⚠️
griptape/drivers/prompt/google_prompt_driver.py 50.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@collindutter collindutter marked this pull request as ready for review July 15, 2024 18:45
@collindutter
Copy link
Member Author

Not tied to the name. Would AnyArtifact be more appropriate? Or maybe even just Artifact?

dylanholmes
dylanholmes previously approved these changes Jul 15, 2024
Copy link
Contributor

@dylanholmes dylanholmes left a comment

Choose a reason for hiding this comment

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

Pretty elegant escape hatch 🐣

Just mentioned one alternative naming choice which I will leave to your discretion.

CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@emjay07 emjay07 left a comment

Choose a reason for hiding this comment

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

My comments are more around usability than anything. I know Google is a bit wonky on how they call stuff, so it may not be feasible to make it perfect in the first rev.

docs/examples/talk-to-a-video.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
docs/examples/talk-to-a-video.md Outdated Show resolved Hide resolved
emjay07
emjay07 previously approved these changes Jul 17, 2024
vasinov
vasinov previously approved these changes Jul 17, 2024
Copy link
Member

@vasinov vasinov left a comment

Choose a reason for hiding this comment

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

Artifact would be ideal but it's inconsistent with other abstraction names. I think GenericArtifact is fine.

dylanholmes
dylanholmes previously approved these changes Jul 17, 2024
Copy link
Contributor

@dylanholmes dylanholmes left a comment

Choose a reason for hiding this comment

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

Great job!

Just one question


@define
class GenericArtifact(BaseArtifact):
value: Any = field(metadata={"serializable": True})
Copy link
Contributor

Choose a reason for hiding this comment

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

What if its not serializable?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know off the top of my head but it'd be however Marshmallow handles it via field.Raw. We do need it serializable though, so I think I'd rather just deal with it when we come across a value that is non-intuitively serializable.

@collindutter collindutter merged commit 362fac0 into dev Jul 18, 2024
14 checks passed
@collindutter collindutter deleted the feature/generic-artifact branch July 18, 2024 16:46
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.

4 participants