Skip to content

feat: add support for remote file parsing #461

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

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

tylerslaton
Copy link
Contributor

@tylerslaton tylerslaton commented Jun 7, 2024

Summary

This PR adds support for remote file parsing. This will mainly be a nice feature for the SDKs as consumers of them can now parse file remotely prior to executing them. Namely, the UI will use this functionality.

How

This is done by exporting loader.ContentFromURL as a new public function. The input package then uses loader.ContentFromURL in a new input.FromURL function. This allows all of the same loading logic to apply that GPTScript runs do while also leveraging the same cache that they do. Finally, the parse subcommand calls input.FromURL if a file load fails.

@tylerslaton tylerslaton requested a review from thedadams June 10, 2024 15:39
pkg/cli/parse.go Outdated
if err != nil {
return err
}
// If the content is empty and there was no error, this is not a remote file. Return the file error.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: comment is out of date.

@tylerslaton tylerslaton merged commit 21f0fea into gptscript-ai:main Jun 10, 2024
2 checks passed
@tylerslaton tylerslaton deleted the parse-remote branch June 10, 2024 17:53
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