Projects
Projects are the top-level organisational unit in the Hub. All agents, datasets, evaluations, and scans belong to a project.
Create a project
Section titled “Create a project”from giskard_hub import HubClient
hub = HubClient()
project = hub.projects.create( name="My LLM App", description="Evaluation workspace for the production chatbot",)
print(project.id)List and retrieve projects
Section titled “List and retrieve projects”# List all projects you have access toprojects = hub.projects.list()
# Retrieve a specific project by IDproject = hub.projects.retrieve("project-id")Update and delete a project
Section titled “Update and delete a project”hub.projects.update("project-id", name="Renamed Project")
hub.projects.delete("project-id")Scenarios
Section titled “Scenarios”Scenarios are reusable templates that describe a persona, a topic, or a behaviour pattern within a project. They are used as input when generating scenario-based datasets via hub.datasets.generate_scenario_based().
Create a scenario
Section titled “Create a scenario”scenario = hub.projects.scenarios.create( "project-id", name="Angry customer asking for refund", description="The user is frustrated and demands an immediate refund for a defective product.", rules=[ "The agent should not ask for the user's credit card number", ],)
print(scenario.id)Preview generated questions from a scenario
Section titled “Preview generated questions from a scenario”Before generating a full dataset, you can preview a single sample conversation that a scenario would produce:
preview = hub.projects.scenarios.preview( "project-id", agent_id="agent-id", description="The user is frustrated and demands an immediate refund for a defective product.",)
print(preview.conversation)List and manage scenarios
Section titled “List and manage scenarios”scenarios = hub.projects.scenarios.list("project-id")
hub.projects.scenarios.update("scenario-id", project_id="project-id", name="Updated name")
hub.projects.scenarios.delete("scenario-id", project_id="project-id")