AI Experiment¶
- pydantic model ibm_watsonx_gov.entities.ai_experiment.AIExperiment¶
Bases:
BaseModel
The class for AIExperiment
Example:¶
- Creating instance of AIExperiment
ai_experiment = AIExperiment(name="", description="", component_type="agent", component_name="")
Show JSON schema
{ "title": "AIExperiment", "description": "The class for AIExperiment\n\nExample:\n--------\nCreating instance of AIExperiment\n .. code-block:: python\n\n ai_experiment = AIExperiment(name=\"\",\n description=\"\",\n component_type=\"agent\",\n component_name=\"\")", "type": "object", "properties": { "container_id": { "default": "", "description": "The container ID of the AI Experiment", "examples": [ "proj-001" ], "title": "Container Id", "type": "string" }, "container_type": { "default": "", "description": "The container type of the AI Experiment.", "examples": [ "project", "space" ], "title": "Container Type", "type": "string" }, "container_name": { "default": "", "description": "The container name of the AI Experiment.", "examples": [ "project_1" ], "title": "Container Name", "type": "string" }, "name": { "default": "AI Experiment for Agent", "description": "The name of the AI Experiment.", "examples": [ "AI Experiment for Agent 1" ], "title": "Name", "type": "string" }, "description": { "default": "", "description": "The description of the AI Experiment", "examples": [ "AI Experiment asset for Agent governance" ], "title": "Description", "type": "string" }, "asset_type": { "default": "", "description": "", "examples": [ "ai_experiment" ], "title": "Asset Type", "type": "string" }, "created_at": { "default": "", "description": "The timestamp of the AI Experiment creation.", "examples": [ "2025-04-08T10:00:43Z" ], "title": "Created At", "type": "string" }, "owner_id": { "default": "", "description": "The owner of the AI Experiment.", "examples": [ "user-123" ], "title": "Owner Id", "type": "string" }, "asset_id": { "default": "", "description": "The ID of the AI Experiment.", "examples": [ "ai_experimet-001" ], "title": "Asset Id", "type": "string" }, "creator_id": { "default": "", "description": "The ID of the user creating AI Experiment.", "examples": [ "user-123" ], "title": "Creator Id", "type": "string" }, "component_id": { "default": "", "description": "The ID of the component of the AI Experiemnt.", "examples": [ "comp-001" ], "title": "Component Id", "type": "string" }, "component_type": { "default": "agent", "description": "The type of AI component for which the AI Experiment is to be created.", "examples": [ "agent" ], "title": "Component Type", "type": "string" }, "component_name": { "default": "Test agent", "description": "The name of AI component of AI Experiment.", "examples": [ "Test agent" ], "title": "Component Name", "type": "string" }, "runs": { "default": [], "description": "Experiment runs for the AI Experiment", "examples": [ { "attachment_id": "att-456", "created_at": "2025-04-01T12:00:00Z", "created_by": "user-123", "nodes": [ { "foundation_models": [ { "model_name": "gpt-4o-mini", "provider": "openai", "type": "chat" } ], "id": "node-001", "name": "Node_1", "type": "example_type" } ], "run_id": "run-001", "run_name": "Test run 1", "test_data": {} } ], "items": { "$ref": "#/$defs/AIExperimentRun" }, "title": "Runs", "type": "array" } }, "$defs": { "AIExperimentRun": { "description": "The class for AIExperimentRun\n\nExample:\n--------\n .. code-block:: python\n\n experiment_run_details = AIExperimentRun(\n run_id=str(uuid.uuid4()),\n run_name=\"\",\n test_data={},\n node=[]\n )", "properties": { "run_id": { "description": "The ID of the AI experiment run.", "examples": [ "run-001" ], "title": "Run Id", "type": "string" }, "run_name": { "description": "The name of the AI experiment run.", "examples": [ "Test run 1" ], "title": "Run Name", "type": "string" }, "created_at": { "default": "", "description": "The timestamp of the AI experiment run.", "examples": [ "2025-04-01T12:00:00Z" ], "title": "Created At", "type": "string" }, "created_by": { "default": "", "description": "The ID of the user creating AI experiment run.", "examples": [ "user-123" ], "title": "Created By", "type": "string" }, "test_data": { "default": {}, "description": "The test data used for the evaluation run.", "title": "Test Data", "type": "object" }, "tracked": { "default": false, "description": "The experiment run is tracked or not.", "examples": [ false, true ], "title": "Tracked", "type": "boolean" }, "id_deleted": { "default": false, "description": "The experiment run is deleted or not.", "examples": [ false, true ], "title": "Id Deleted", "type": "boolean" }, "attachment_id": { "default": "", "description": "The ID of attachment of evaluation result of the AI experiment run.", "examples": [ "att-456" ], "title": "Attachment Id", "type": "string" }, "nodes": { "default": [], "description": "The list of nodes for AI Experiment run.", "examples": [ { "id": "node-001", "name": "Node_1", "type": "tool" } ], "items": { "$ref": "#/$defs/Node" }, "title": "Nodes", "type": "array" }, "description": { "default": "", "description": "The description of AI Experiment run.", "examples": [ "This is the experiment run for AI Experiment" ], "title": "Description", "type": "string" }, "source_name": { "default": "", "description": "The name of the notebook used to create experiment run", "examples": [ "" ], "title": "Source Name", "type": "string" }, "source_url": { "default": "", "description": "The URL of the notebook used to create experiment run", "examples": [ "" ], "title": "Source Url", "type": "string" }, "duration": { "default": null, "description": "The time taken to complete the run.", "examples": [ "" ], "title": "Duration", "type": "integer" }, "custom_tags": { "default": [], "description": "The list of custom tags key value pair.", "examples": [ "" ], "items": { "type": "object" }, "title": "Custom Tags", "type": "array" }, "properties": { "type": "object", "default": {}, "description": "Freeform field to store additional metadata related to runs", "title": "Properties" }, "agent_method_name": { "default": "", "description": "Name of the method which returns the agent.", "examples": [ "" ], "title": "Agent Method Name", "type": "string" } }, "required": [ "run_id", "run_name" ], "title": "AIExperimentRun", "type": "object" }, "FoundationModelInfo": { "description": "Represents a foundation model used in an experiment.", "properties": { "model_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the foundation model.", "title": "Model Name" }, "model_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The id of the foundation model.", "title": "Model Id" }, "provider": { "description": "The provider of the foundation model.", "title": "Provider", "type": "string" }, "type": { "description": "The type of foundation model.", "example": [ "chat", "embedding", "text-generation" ], "title": "Type", "type": "string" } }, "required": [ "provider", "type" ], "title": "FoundationModelInfo", "type": "object" }, "Node": { "properties": { "id": { "default": "", "description": "The ID of node for AI Experiemnt.", "examples": [ "node-001" ], "title": "Id", "type": "string" }, "name": { "default": "", "description": "The name of node for AI Experiment.", "examples": [ "Node_1" ], "title": "Name", "type": "string" }, "type": { "default": "tool", "description": "The type of node for AI Experiment.", "examples": [ "tool", "agent" ], "title": "Type", "type": "string" }, "foundation_models": { "default": [], "description": "The Foundation models invoked by the node", "items": { "$ref": "#/$defs/FoundationModelInfo" }, "title": "Foundation Models", "type": "array" } }, "title": "Node", "type": "object" } } }
- Fields:
- field asset_id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The ID of the AI Experiment.', examples=['ai_experimet-001'])] = ''¶
The ID of the AI Experiment.
- field asset_type: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='', examples=['ai_experiment'])] = ''¶
- field component_id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The ID of the component of the AI Experiemnt.', examples=['comp-001'])] = ''¶
The ID of the component of the AI Experiemnt.
- field component_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='Test agent', description='The name of AI component of AI Experiment.', examples=['Test agent'])] = 'Test agent'¶
The name of AI component of AI Experiment.
- field component_type: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='agent', description='The type of AI component for which the AI Experiment is to be created.', examples=['agent'])] = 'agent'¶
The type of AI component for which the AI Experiment is to be created.
- field container_id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The container ID of the AI Experiment', examples=['proj-001'])] = ''¶
The container ID of the AI Experiment
- field container_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The container name of the AI Experiment.', examples=['project_1'])] = ''¶
The container name of the AI Experiment.
- field container_type: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The container type of the AI Experiment.', examples=['project', 'space'])] = ''¶
The container type of the AI Experiment.
- field created_at: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The timestamp of the AI Experiment creation.', examples=['2025-04-08T10:00:43Z'])] = ''¶
The timestamp of the AI Experiment creation.
- field creator_id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The ID of the user creating AI Experiment.', examples=['user-123'])] = ''¶
The ID of the user creating AI Experiment.
- field description: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The description of the AI Experiment', examples=['AI Experiment asset for Agent governance'])] = ''¶
The description of the AI Experiment
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='AI Experiment for Agent', description='The name of the AI Experiment.', examples=['AI Experiment for Agent 1'])] = 'AI Experiment for Agent'¶
The name of the AI Experiment.
- field owner_id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The owner of the AI Experiment.', examples=['user-123'])] = ''¶
The owner of the AI Experiment.
- field runs: AIExperimentRun], FieldInfo(annotation=NoneType, required=False, default=[], description='Experiment runs for the AI Experiment', examples=[{'run_id': 'run-001', 'run_name': 'Test run 1', 'created_at': '2025-04-01T12:00:00Z', 'created_by': 'user-123', 'test_data': {}, 'attachment_id': 'att-456', 'nodes': [{'id': 'node-001', 'name': 'Node_1', 'type': 'example_type', 'foundation_models': [{'type': 'chat', 'model_name': 'gpt-4o-mini', 'provider': 'openai'}]}]}])] = []¶
Experiment runs for the AI Experiment
- to_json()¶
Transform the AI Experiment instance to json.
- pydantic model ibm_watsonx_gov.entities.ai_experiment.AIExperimentRun¶
Bases:
BaseModel
The class for AIExperimentRun
Example:¶
experiment_run_details = AIExperimentRun( run_id=str(uuid.uuid4()), run_name="", test_data={}, node=[] )
Show JSON schema
{ "title": "AIExperimentRun", "description": "The class for AIExperimentRun\n\nExample:\n--------\n .. code-block:: python\n\n experiment_run_details = AIExperimentRun(\n run_id=str(uuid.uuid4()),\n run_name=\"\",\n test_data={},\n node=[]\n )", "type": "object", "properties": { "run_id": { "description": "The ID of the AI experiment run.", "examples": [ "run-001" ], "title": "Run Id", "type": "string" }, "run_name": { "description": "The name of the AI experiment run.", "examples": [ "Test run 1" ], "title": "Run Name", "type": "string" }, "created_at": { "default": "", "description": "The timestamp of the AI experiment run.", "examples": [ "2025-04-01T12:00:00Z" ], "title": "Created At", "type": "string" }, "created_by": { "default": "", "description": "The ID of the user creating AI experiment run.", "examples": [ "user-123" ], "title": "Created By", "type": "string" }, "test_data": { "default": {}, "description": "The test data used for the evaluation run.", "title": "Test Data", "type": "object" }, "tracked": { "default": false, "description": "The experiment run is tracked or not.", "examples": [ false, true ], "title": "Tracked", "type": "boolean" }, "id_deleted": { "default": false, "description": "The experiment run is deleted or not.", "examples": [ false, true ], "title": "Id Deleted", "type": "boolean" }, "attachment_id": { "default": "", "description": "The ID of attachment of evaluation result of the AI experiment run.", "examples": [ "att-456" ], "title": "Attachment Id", "type": "string" }, "nodes": { "default": [], "description": "The list of nodes for AI Experiment run.", "examples": [ { "id": "node-001", "name": "Node_1", "type": "tool" } ], "items": { "$ref": "#/$defs/Node" }, "title": "Nodes", "type": "array" }, "description": { "default": "", "description": "The description of AI Experiment run.", "examples": [ "This is the experiment run for AI Experiment" ], "title": "Description", "type": "string" }, "source_name": { "default": "", "description": "The name of the notebook used to create experiment run", "examples": [ "" ], "title": "Source Name", "type": "string" }, "source_url": { "default": "", "description": "The URL of the notebook used to create experiment run", "examples": [ "" ], "title": "Source Url", "type": "string" }, "duration": { "default": null, "description": "The time taken to complete the run.", "examples": [ "" ], "title": "Duration", "type": "integer" }, "custom_tags": { "default": [], "description": "The list of custom tags key value pair.", "examples": [ "" ], "items": { "type": "object" }, "title": "Custom Tags", "type": "array" }, "properties": { "type": "object", "default": {}, "description": "Freeform field to store additional metadata related to runs", "title": "Properties" }, "agent_method_name": { "default": "", "description": "Name of the method which returns the agent.", "examples": [ "" ], "title": "Agent Method Name", "type": "string" } }, "$defs": { "FoundationModelInfo": { "description": "Represents a foundation model used in an experiment.", "properties": { "model_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the foundation model.", "title": "Model Name" }, "model_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The id of the foundation model.", "title": "Model Id" }, "provider": { "description": "The provider of the foundation model.", "title": "Provider", "type": "string" }, "type": { "description": "The type of foundation model.", "example": [ "chat", "embedding", "text-generation" ], "title": "Type", "type": "string" } }, "required": [ "provider", "type" ], "title": "FoundationModelInfo", "type": "object" }, "Node": { "properties": { "id": { "default": "", "description": "The ID of node for AI Experiemnt.", "examples": [ "node-001" ], "title": "Id", "type": "string" }, "name": { "default": "", "description": "The name of node for AI Experiment.", "examples": [ "Node_1" ], "title": "Name", "type": "string" }, "type": { "default": "tool", "description": "The type of node for AI Experiment.", "examples": [ "tool", "agent" ], "title": "Type", "type": "string" }, "foundation_models": { "default": [], "description": "The Foundation models invoked by the node", "items": { "$ref": "#/$defs/FoundationModelInfo" }, "title": "Foundation Models", "type": "array" } }, "title": "Node", "type": "object" } }, "required": [ "run_id", "run_name" ] }
- Fields:
- field agent_method_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='Name of the method which returns the agent.', examples=[''])] = ''¶
Name of the method which returns the agent.
- field attachment_id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The ID of attachment of evaluation result of the AI experiment run.', examples=['att-456'])] = ''¶
The ID of attachment of evaluation result of the AI experiment run.
- field created_at: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The timestamp of the AI experiment run.', examples=['2025-04-01T12:00:00Z'])] = ''¶
The timestamp of the AI experiment run.
- field created_by: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The ID of the user creating AI experiment run.', examples=['user-123'])] = ''¶
The ID of the user creating AI experiment run.
- field custom_tags: Annotated[List[Dict], FieldInfo(annotation=NoneType, required=False, default=[], description='The list of custom tags key value pair.', examples=[''])] = []¶
The list of custom tags key value pair.
- field description: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The description of AI Experiment run.', examples=['This is the experiment run for AI Experiment'])] = ''¶
The description of AI Experiment run.
- field duration: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=None, description='The time taken to complete the run.', examples=[''])] = None¶
The time taken to complete the run.
- field id_deleted: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='The experiment run is deleted or not.', examples=[False, True])] = False¶
The experiment run is deleted or not.
- field nodes: ', examples=[{'id': 'node-001', 'name': 'Node_1', 'type': 'tool'}])] = []¶
The list of nodes for AI Experiment run.
- field properties: Dict, FieldInfo(annotation=NoneType, required=False, default={}, description='Freeform field to store additional metadata related to runs')] = {}¶
Freeform field to store additional metadata related to runs
- field run_id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='The ID of the AI experiment run.', examples=['run-001'])] [Required]¶
The ID of the AI experiment run.
- field run_name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='The name of the AI experiment run.', examples=['Test run 1'])] [Required]¶
The name of the AI experiment run.
- field source_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The name of the notebook used to create experiment run', examples=[''])] = ''¶
The name of the notebook used to create experiment run
- field source_url: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The URL of the notebook used to create experiment run', examples=[''])] = ''¶
The URL of the notebook used to create experiment run
- field test_data: ')] = {}¶
The test data used for the evaluation run.
- field tracked: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='The experiment run is tracked or not.', examples=[False, True])] = False¶
The experiment run is tracked or not.
- to_json()¶
Transform the AIExperimentRun instance to json.
- pydantic model ibm_watsonx_gov.entities.ai_experiment.AIExperimentRunRequest¶
Bases:
BaseModel
The class for AIExperimentRunRequest
Example:¶
- Creating instance of AIExperiment
ai_experiment_run_request = AIExperimentRunRequest(name="", description="", source_name="", source_url="", custom_tags=[])
Show JSON schema
{ "title": "AIExperimentRunRequest", "description": "The class for AIExperimentRunRequest\n\nExample:\n--------\nCreating instance of AIExperiment\n .. code-block:: python\n\n ai_experiment_run_request = AIExperimentRunRequest(name=\"\",\n description=\"\",\n source_name=\"\",\n source_url=\"\",\n custom_tags=[])", "type": "object", "properties": { "name": { "default": "run_1", "description": "The name of experiment run.", "examples": [ "run_1" ], "title": "Name", "type": "string" }, "description": { "default": "", "description": "The description of AI Experiment run.", "examples": [ "This is the experiment run for AI Experiment" ], "title": "Description", "type": "string" }, "source_name": { "default": "", "description": "The name of the notebook used to create experiment run", "examples": [ "" ], "title": "Source Name", "type": "string" }, "source_url": { "default": "", "description": "The URL of the notebook used to create experiment run", "examples": [ "" ], "title": "Source Url", "type": "string" }, "custom_tags": { "default": [], "description": "The list of custom tags key value pair.", "examples": [ "" ], "items": { "type": "object" }, "title": "Custom Tags", "type": "array" }, "agent_method_name": { "default": "", "description": "Name of the method which returns the agent.", "examples": [ "" ], "title": "Agent Method Name", "type": "string" } } }
- Fields:
- field agent_method_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='Name of the method which returns the agent.', examples=[''])] = ''¶
Name of the method which returns the agent.
- field custom_tags: Annotated[List[Dict], FieldInfo(annotation=NoneType, required=False, default=[], description='The list of custom tags key value pair.', examples=[''])] = []¶
The list of custom tags key value pair.
- field description: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The description of AI Experiment run.', examples=['This is the experiment run for AI Experiment'])] = ''¶
The description of AI Experiment run.
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='run_1', description='The name of experiment run.', examples=['run_1'])] = 'run_1'¶
The name of experiment run.
- field source_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The name of the notebook used to create experiment run', examples=[''])] = ''¶
The name of the notebook used to create experiment run
- field source_url: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The URL of the notebook used to create experiment run', examples=[''])] = ''¶
The URL of the notebook used to create experiment run
- pydantic model ibm_watsonx_gov.entities.ai_experiment.Node¶
Bases:
BaseModel
Show JSON schema
{ "title": "Node", "type": "object", "properties": { "id": { "default": "", "description": "The ID of node for AI Experiemnt.", "examples": [ "node-001" ], "title": "Id", "type": "string" }, "name": { "default": "", "description": "The name of node for AI Experiment.", "examples": [ "Node_1" ], "title": "Name", "type": "string" }, "type": { "default": "tool", "description": "The type of node for AI Experiment.", "examples": [ "tool", "agent" ], "title": "Type", "type": "string" }, "foundation_models": { "default": [], "description": "The Foundation models invoked by the node", "items": { "$ref": "#/$defs/FoundationModelInfo" }, "title": "Foundation Models", "type": "array" } }, "$defs": { "FoundationModelInfo": { "description": "Represents a foundation model used in an experiment.", "properties": { "model_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the foundation model.", "title": "Model Name" }, "model_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The id of the foundation model.", "title": "Model Id" }, "provider": { "description": "The provider of the foundation model.", "title": "Provider", "type": "string" }, "type": { "description": "The type of foundation model.", "example": [ "chat", "embedding", "text-generation" ], "title": "Type", "type": "string" } }, "required": [ "provider", "type" ], "title": "FoundationModelInfo", "type": "object" } } }
- Fields:
- field foundation_models: Annotated[List[FoundationModelInfo], FieldInfo(annotation=NoneType, required=False, default=[], description='The Foundation models invoked by the node')] = []¶
The Foundation models invoked by the node
- field id: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The ID of node for AI Experiemnt.', examples=['node-001'])] = ''¶
The ID of node for AI Experiemnt.
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='', description='The name of node for AI Experiment.', examples=['Node_1'])] = ''¶
The name of node for AI Experiment.
- field type: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='tool', description='The type of node for AI Experiment.', examples=['tool', 'agent'])] = 'tool'¶
The type of node for AI Experiment.
- classmethod convert_foundation_models(v)¶
- to_json()¶
Transform the Node instance to json.