-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
fixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta
Description
Describe the feature or improvement you're requesting
In the Node.js API we have the API accepting keys upon creation of the OpenAIApi
object:
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
organization: "org-1qRDHAPS0UN4vVhAii7VYY7y",
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
In Python, however, the key is set globally, which poses a problem when dealing with multiple keys/organizations in requests. It would be nice to have proper encapsulation of the key into a Python class that is responsible for the API like it is usually done for many Python APIs, instead of using global objects for keys.
Additional context
No response
logankilpatrick, Normalizex, MattFisher, johnnygreco, vishalwadhwa13 and 13 more
Metadata
Metadata
Assignees
Labels
fixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta