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

feat: add dataset functions #95

Merged
merged 3 commits into from
Oct 14, 2024
Merged

Conversation

g-linville
Copy link
Member

@g-linville g-linville commented Oct 10, 2024

Depends on gptscript-ai/datasets#1. Tests here will fail until it is merged.

Signed-off-by: Grant Linville <[email protected]>
src/gptscript.ts Outdated
Comment on lines 1188 to 1206
export type DatasetElementMeta = {
name: string
description: string
}

export type DatasetElement = DatasetElementMeta & {
contents: string
}

export type DatasetMeta = {
id: string
name: string
description: string
}

export type Dataset = DatasetMeta & {
baseDir: string
elements: Record<string, DatasetElementMeta>
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything else is exported as interface. Can we do the same here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep. The only downside is that, as far as I am aware, I can't do the & thing to avoid repeating fields, but I went ahead and changed it all to interfaces.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can use extends, but this is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops I forgot about that lol. But yeah I agree, it's not a big deal either way

Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
@g-linville g-linville merged commit 96d3724 into gptscript-ai:main Oct 14, 2024
2 checks passed
@g-linville g-linville deleted the dataset branch October 14, 2024 14:38
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.

3 participants