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

ClientConfig should support a ProjectID #757

Open
massenz opened this issue May 28, 2024 · 1 comment · May be fixed by #766
Open

ClientConfig should support a ProjectID #757

massenz opened this issue May 28, 2024 · 1 comment · May be fixed by #766
Labels
enhancement New feature or request

Comments

@massenz
Copy link

massenz commented May 28, 2024

Recently OpenAI has added the support for Projects, within an Org; and Assistants are now project-scoped.
When creating a new Client, ClientConfig should support a ProjectID field, similar to what the Python API does:

from openai import OpenAI

client = OpenAI(
  organization='org-xG5HLfr7CRdMSiSBlycUpcIw',
  project='$PROJECT_ID',
)

I suspect there may be a workaround currently by adding a custom header:

  -H "OpenAI-Project: $PROJECT_ID"

but this is not documented.

Is your feature request related to a problem? Please describe.

Assistants (and by induction, Threads and Messages) are Project-scoped in the OpenAI API, so not having this limits us to using only the DefaultProject which causes issues of isolation, etc.

Describe the solution you'd like
Add a ProjectID to the ClientConfig struct

Describe alternatives you've considered
Custom OpenAI-Project header

Additional context
I'd be happy to contribute the code to implement this: just say the word!

❤️ go-openai!!!

@massenz massenz added the enhancement New feature or request label May 28, 2024
@massenz
Copy link
Author

massenz commented May 28, 2024

Actually, while researching this issue, I just discovered that now OpenAI API Keys can be created "project scoped" so this is unnecessary, so long as the user selects a project-specific API key.

This largely solves the issue here, but I still think that, for the sake of parity (and because there may be use cases where a "super-user" API key may be used to manage multiple projects) it would be good to add support for a Project ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant