feat: add dataset functions#95
Merged
g-linville merged 3 commits intogptscript-ai:mainfrom Oct 14, 2024
Merged
Conversation
Signed-off-by: Grant Linville <grant@acorn.io>
thedadams
reviewed
Oct 11, 2024
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> | ||
| } |
Contributor
There was a problem hiding this comment.
Everything else is exported as interface. Can we do the same here?
Member
Author
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
You can use extends, but this is fine.
Member
Author
There was a problem hiding this comment.
Whoops I forgot about that lol. But yeah I agree, it's not a big deal either way
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
thedadams
approved these changes
Oct 11, 2024
iwilltry42
approved these changes
Oct 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on gptscript-ai/datasets#1. Tests here will fail until it is merged.