Skip to main content
Version: v1.6.1 🚧

Share a prompt template

Overview​

A user can share one of its prompt templates, granting the recipient full write access, including the ability to edit or delete the template.

Example​

from h2ogpte import H2OGPTE
from h2ogpte.types import Permission

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.share_prompt(
prompt_id=prompt_template.id,
permission=Permission(username="USERNAME_OF_RECIPIENT_TO_SHARE_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