-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Note
My team would be happy to submit a PR for this if valuable.
Currently, the sole way to initialize a Prompt Hub client is to pass in the explicit Space ID. While this is certainly the most unambiguous way to reference a Space, the ID is ultimately a "seemingly random" string of characters that, if taken out of context, makes it all but impossible to know exactly which space—or even which Organization—it refers to.
In particular, the use of explicit Space ID means that a user that knows the name of the Space they'd like to programmatically interface with, but not the ID, needs to:
- Switch from their exploratory notebook work to the Arize web application;
- Click into the relevant Space;
- Copy the Space ID;
- Switch back to their notebook to paste it into the ArizePromptClient constructor.
This also makes it difficult to store a fully-qualified reference to an Arize Prompt Hub prompt, i.e. the organization/space/prompt-name tuple, in an external data store in such a way that's both a) human-readable and b) programmatically actionable.
Given that the mapping from Organization+Space to ID is readily queryable from GraphQL, I propose an alternate constructor, ArizePromptClient.from_space_name(org_name: str, space_name: str), that uses the GraphQL client to query for the Space ID to feed into PromptClient's primary constructor.