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

Implement function to get Context Preview when a Piece is selected #94

Open
shivaypiece opened this issue Feb 23, 2024 · 1 comment
Open
Labels
good first issue Good for newcomers in the OSP Community.

Comments

@shivaypiece
Copy link
Contributor

The user should be able to view the contextual information based on the selected snippet.

import * as pieces from '@pieces.app/pieces-os-client';

async function main() {
    const assetsApi = new pieces.AssetsApi();
    const assetApi = new pieces.AssetApi();

    const indicies = await assetsApi.assetsIdentifiersSnapshot({});

    const firstAssetId = indicies.iterable?.[0].id;

    // this should only happen if u got no assets saved
    if (!firstAssetId) return;

    const asset = await assetApi.assetSnapshot({asset: firstAssetId})

    const websites = asset.websites?.iterable;

    const tags = asset.websites?.iterable;

    console.log('WEBSITES!', JSON.stringify(websites, undefined, 2));

    console.log('TAGS!', JSON.stringify(tags, undefined, 2));
}
main()
@shivaypiece shivaypiece added the good first issue Good for newcomers in the OSP Community. label Feb 23, 2024
@Meetpidev
Copy link

Meetpidev commented Oct 4, 2024

@shivay-at-pieces
hey there, i would like to work on it..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers in the OSP Community.
Projects
None yet
Development

No branches or pull requests

2 participants