chore: use workspace SDK functions#4
Merged
g-linville merged 6 commits intogptscript-ai:mainfrom Oct 22, 2024
Merged
Conversation
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
d42fbb5 to
7feccf2
Compare
Signed-off-by: Grant Linville <grant@acorn.io>
g-linville
commented
Oct 22, 2024
| Name string `json:"name"` | ||
| Description string `json:"description"` | ||
| Content string `json:"content"` | ||
| Contents string `json:"contents"` |
Member
Author
There was a problem hiding this comment.
I updated this to make it more consistent with the SDK's data types.
thedadams
reviewed
Oct 22, 2024
| files, err := filepath.Glob(filepath.Join(m.datasetDir, "*"+extension)) | ||
| func (m *Manager) ListDatasets(ctx context.Context) ([]DatasetMeta, error) { | ||
| files, err := m.gptscriptClient.ListFilesInWorkspace(ctx, gptscript.ListFilesInWorkspaceOptions{ | ||
| Prefix: datasetFilePrefix, |
There was a problem hiding this comment.
I would be surprised if this worked in general. The intention with the Prefix fields (here and others) is that they are "directories." If we need more general prefixes, then I believe we would have to add support for it.
Member
Author
There was a problem hiding this comment.
At least with the directory provider, this works. I have not tested it with S3 yet.
There was a problem hiding this comment.
Interesting. It is the directory provider that I figured would not work.
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
thedadams
approved these changes
Oct 22, 2024
StrongMonkey
approved these changes
Oct 22, 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.
This updates the dataset tools to use the workspace provider SDK.
I updated the tests so that we write and read all of the data in a single go, rather than reading pre-existing data from a test workspace.