-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
Signed-off-by: Grant Linville <[email protected]>
src/gptscript.ts
Outdated
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> | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
Depends on gptscript-ai/datasets#1. Tests here will fail until it is merged.