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 credential management #91

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

g-linville
Copy link
Member

No description provided.

Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
@g-linville g-linville marked this pull request as ready for review September 18, 2024 20:21
src/gptscript.ts Outdated
Comment on lines 327 to 330
const resp = await fetch(`${GPTScript.serverURL}/credentials`, {
method: "POST",
body: JSON.stringify({context, allContexts})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Does runSubcommand not work for these?

Copy link
Member Author

Choose a reason for hiding this comment

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

I remember trying it and it not working for some reason, but I don't remember why...let me try that again and see.

Copy link
Member Author

Choose a reason for hiding this comment

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

Taking a look at the code again, RunSubcommand doesn't let me specify an arbitrary request body to use. I can only pass it a tool and some run options. But I need to be able to pass things like a credential (in the case of create), or name/context information for the other operations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know if you want me to change this or leave it as is @thedadams

Copy link
Contributor

@thedadams thedadams Sep 19, 2024

Choose a reason for hiding this comment

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

Can you try something like this?

const r: Run = new RunSubcommand("credentials", undefined, {}, GPTScript.serverURL)

r.request(payload)
await r.text()

Copy link
Member Author

Choose a reason for hiding this comment

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

That worked, thanks. This is updated now

Signed-off-by: Grant Linville <[email protected]>
Copy link
Contributor

@thedadams thedadams left a comment

Choose a reason for hiding this comment

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

Can you also add the CredentialContexts stuff here, too?

@g-linville
Copy link
Member Author

Can you also add the CredentialContexts stuff here, too?

Done

@g-linville g-linville merged commit 92646be into gptscript-ai:main Sep 23, 2024
3 checks passed
@g-linville g-linville deleted the credentials branch September 23, 2024 23:21
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