Skip to main content
Version: v1.6.8 🚧

Unshare a prompt template

Overview​

A user can unshare a prompt template with another user at any time.

Example​

from h2ogpte import H2OGPTE
from h2ogpte.types import SharePermission

client = H2OGPTE(
address="https://h2ogpte.genai.h2o.ai",
api_key='sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
)

# Retrieves the user's most recently updated prompt template.
most_recent_prompt_template = client.list_recent_prompt_templates_sort(offset=0,limit=1,sort_column="created_at",ascending=False)

prompt_template = client.get_prompt_template(id=most_recent_prompt_template[0].id)

status = client.unshare_prompt(
prompt_id=prompt_template.id,
permission=SharePermission(username="USERNAME_OF_RECIPIENT_TO_UNSHARE_PROMPT_TEMPLATE")
)

print(status.status)
completed
note

To identify the correct username to use, see the following page: List all registered users in the system.


Feedback