### POST /api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Initiates the creation of a mentor using a wizard-like process. This endpoint triggers a guided setup for creating a mentor profile. ```APIDOC ## POST /api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/ ### Description Initiates the creation of a mentor using a wizard-like process. This endpoint triggers a guided setup for creating a mentor profile. ### Method POST ### Endpoint /api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/ #### Path Parameters - **org** (string) - Required - The organization identifier. - **user_id** (string) - Required - The user identifier. ### Request Body (No specific request body schema provided in the input. Assume it contains wizard-related data.) ### Response #### Success Response (200) - **message** (string) - Indicates the mentor creation wizard has been initiated. #### Response Example { "message": "Mentor creation wizard initiated." } ``` -------------------------------- ### Python SDK: Platform API Key Authentication Example Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/CoreApi.md Demonstrates how to authenticate with the IBLAI platform using an API key. This is useful for server-to-server communication. It shows the setup of the client and an example API call to `core_departments_destroy`. ```python import iblai from iblai.rest import ApiException from pprint import pprint import os # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # The APIs use bearer tokens for authentication with a prefix of: `Api-Key` # You can generate an authenticated client using the following helper method client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) # Create an instance of the API class api_instance = iblai.CoreApi(client) try: api_instance.core_departments_destroy() except Exception as e: print("Exception when calling CoreApi->core_departments_destroy: %s\n" % e) ``` -------------------------------- ### Install iblai Python SDK Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Instructions for installing the iblai Python SDK using pip or setuptools. Pip installation from a git repository is shown, along with the setuptools command for local installation. ```sh pip install git+https://github.com/iblai/iblai-python-sdk.git # or python setup.py install --user ``` -------------------------------- ### Create Training Configuration using AiFinetuningApi in Python Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiFinetuningApi.md This Python code demonstrates how to create a new training configuration. It requires an initialized API client, organization, username, and a TrainingCreate object. The example outlines the setup for API key authentication and includes a placeholder for the API client instantiation. ```python import iblai from iblai.models.training_create import TrainingCreate from iblai.rest import ApiException from pprint import pprint import os # The client must configure the authentication and authorization parameters # You can generate an authenticated client using the following helper method # client = get_platform_api_client( # host="https://base.manager.iblai.app", # key=os.environ["API_KEY"] # ) # Create an instance of the API class api_instance = iblai.AiFinetuningApi(api_client) # Assuming api_client is configured org = 'org_example' # str | username = 'username_example' # str | training_create = iblai.TrainingCreate() # TrainingCreate | # Note: The actual call to create the training is not shown in the provided text, only the setup. ``` -------------------------------- ### Retrieve AWS Domain Status with iblai-python-sdk Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/ProvidersApi.md Retrieves the status of an AWS domain. This method performs a GET request to the /api/providers/aws/domain-status/ endpoint. It does not require specific parameters or authorization. Example usage shows basic API client setup. ```python import iblai from iblai.rest import ApiException from pprint import pprint # Create an instance of the API class api_instance = iblai.ProvidersApi(api_client) try: # This is a placeholder for the actual call, as the method signature is empty in the provided text. # Assuming a method like api_instance.providers_aws_domain_status_retrieve() exists. print("Calling providers_aws_domain_status_retrieve() - actual method call needs to be confirmed.") except Exception as e: print("Exception when calling ProvidersApi->providers_aws_domain_status_retrieve: %s\n" % e) ``` -------------------------------- ### GET /iblai/AiPromptApi/ai_prompt_orgs_users_sessions_guided_prompts_retrieve Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiPromptApi.md Retrieve guided prompts for a chat session. ```APIDOC ## GET /iblai/AiPromptApi/ai_prompt_orgs_users_sessions_guided_prompts_retrieve ### Description Retrieve guided prompts for a chat session. Fetches AI-generated guided prompts for a given session and organization. ### Method GET ### Endpoint /iblai/AiPromptApi/ai_prompt_orgs_users_sessions_guided_prompts_retrieve ### Parameters #### Path Parameters - **org** (str) - Required - - **session_id** (str) - Required - - **user_id** (str) - Required - ### Request Example ```python { "org": "org_example", "session_id": "session_id_example", "user_id": "user_id_example" } ``` ### Response #### Success Response (200) - **GuidedPromptsResponse** (GuidedPromptsResponse) - Description of the returned GuidedPromptsResponse object #### Response Example (Example response body depends on the GuidedPromptsResponse model structure) ``` -------------------------------- ### GET /api/platform/orgs/{org}/progress/started Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/PlatformApi.md Retrieves a list of users who have started at least one course within an organization. ```APIDOC ## GET /api/platform/orgs/{org}/progress/started ### Description Retrieves a list of users within an organization who have started at least one course. ### Method GET ### Endpoint /api/platform/orgs/{org}/progress/started #### Path Parameters - **org** (string) - Required - The unique identifier for the organization. ### Response #### Success Response (200) - **users** (array) - A list of user identifiers who have started at least one course. ``` -------------------------------- ### POST /api/providers/aws/launch-tenant/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Launches a tenant on AWS. ```APIDOC ## POST /api/providers/aws/launch-tenant/ ### Description Launches a tenant on AWS. ### Method POST ### Endpoint /api/providers/aws/launch-tenant/ ### Parameters (No parameters defined in the provided text) ### Request Example (No request body example provided) ### Response #### Success Response (200) (No success response details provided) #### Response Example (No response example provided) ``` -------------------------------- ### Manage Media Resources with IBLAI Python SDK Source: https://context7.com/iblai/iblai-python-sdk/llms.txt Handle learning resources, media files, and supplementary content associated with courses. This example shows creating, listing, and searching for media resources using the MediaResourcesApi. It requires the 'iblai' library and an initialized 'client' object. ```python from iblai import MediaResourcesApi from iblai.models.media_resource import MediaResource from iblai.exceptions import ApiException media_api = MediaResourcesApi(client) try: # Create media resource resource = MediaResource( title="Python Basics Tutorial", description="Introduction to Python programming fundamentals", resource_type="video", url="https://storage.example.com/videos/python-intro.mp4", course_id="course-v1:org+CS101+2024", unit_id="block-v1:org+CS101+2024+type@vertical+block@abc123", duration_seconds=1200, file_size_bytes=104857600, mime_type="video/mp4", thumbnail_url="https://storage.example.com/thumbnails/python-intro.jpg" ) created_resource = media_api.media_orgs_users_media_media_resources_create( org="my-org", user_id="instructor123", media_resource=resource ) print(f"Created resource: {created_resource.id}") # List resources for a course resources = media_api.media_orgs_users_media_media_resources_list( org="my-org", user_id="instructor123", course_id="course-v1:org+CS101+2024", limit=50 ) print(f"\nCourse Resources ({resources.count}):") for res in resources.results: print(f" {res.title} ({res.resource_type})") print(f" Duration: {res.duration_seconds}s, Size: {res.file_size_bytes} bytes") # Search resources search_resources = media_api.media_orgs_users_media_media_resources_search_retrieve( org="my-org", user_id="instructor123", search="python", resource_type="video" ) print(f"\nSearch Results: {len(search_resources.results)} resources found") except ApiException as e: print(f"Media resource error: {e}") ``` -------------------------------- ### GET /api/platform/orgs/{org}/courses/{course_id}/progress/started Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/PlatformApi.md Retrieves the list of users who have started a specific course within an organization. ```APIDOC ## GET /api/platform/orgs/{org}/courses/{course_id}/progress/started ### Description Retrieves a list of users who have started a specific course within a given organization. ### Method GET ### Endpoint /api/platform/orgs/{org}/courses/{course_id}/progress/started #### Path Parameters - **org** (string) - Required - The unique identifier for the organization. - **course_id** (string) - Required - The unique identifier for the course. ### Response #### Success Response (200) - **users** (array) - A list of user identifiers who have started the course. ``` -------------------------------- ### POST /api/providers/gcp/launch-tenant/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Launches a tenant on GCP. ```APIDOC ## POST /api/providers/gcp/launch-tenant/ ### Description Launches a tenant on GCP. ### Method POST ### Endpoint /api/providers/gcp/launch-tenant/ ### Parameters (No parameters defined in the provided text) ### Request Example (No request body example provided) ### Response #### Success Response (200) (No success response details provided) #### Response Example (No response example provided) ``` -------------------------------- ### GET /api/ai-prompt/orgs/{org}/users/{user_id}/sessions/{session_id}/guided-prompts/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Retrieve guided prompts for a specific chat session. This endpoint returns a list of guided prompts available for the user within their chat session context. ```APIDOC ## GET /api/ai-prompt/orgs/{org}/users/{user_id}/sessions/{session_id}/guided-prompts/ ### Description Retrieve guided prompts for a chat session ### Method GET ### Endpoint `/api/ai-prompt/orgs/{org}/users/{user_id}/sessions/{session_id}/guided-prompts/` ### Parameters #### Path Parameters - **org** (string) - Required - Organization identifier - **user_id** (string) - Required - User identifier - **session_id** (string) - Required - Chat session identifier ### Response #### Success Response (200) - **guided_prompts** (array) - List of guided prompts for the session ### Notes This endpoint retrieves prompts specific to an active chat session within an organization context. ``` -------------------------------- ### GET /orgs/progress/started Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/PlatformApi.md Retrieves the number of users who have started or enrolled in courses for a given organization. Supports filtering by course ID and user ID. ```APIDOC ## GET /orgs/progress/started ### Description Retrieves the number of users who have started or enrolled in courses for a given organization. For the platform, it's the total users with at least one enrollment. For a course, it's the total users enrolled. For a learner, it's the total courses in progress. ### Method GET ### Endpoint `/orgs/progress/started` ### Parameters #### Query Parameters - **org** (str) - Required - The organization identifier. - **course_id** (str) - Optional - The course ID to filter by (e.g., 'course-v1:Org+Course4+Run'). - **user_id** (str) - Optional - The user ID (username or email) to filter by. ### Request Example ```python import iblai import os client = iblai.get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) api_instance = iblai.PlatformApi(client) org = 'org_example' # str | try: api_instance.platform_orgs_progress_started_retrieve(org) except Exception as e: print(f"Exception when calling PlatformApi->platform_orgs_progress_started_retrieve: {e}") ``` ### Response #### Success Response (200) This endpoint returns no response body upon successful execution. #### Response Example (No response body) ``` -------------------------------- ### Configure and Use Iblai API Client Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Demonstrates how to configure and use the Iblai API client in Python. It covers setting up an authenticated client using an API key, making the client the default for all calls, or passing it to individual API constructors. Includes an example of calling the `media_orgs_users_media_media_resources_by_item_retrieve` method and handling potential API exceptions. ```python import iblai from iblai.clients import get_platform_api_client from iblai.rest import ApiException from pprint import pprint import os # Configure authentication and authorization client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) # Option 1: Set client as default iblai.ApiClient.set_default(client) api_instance = iblai.MediaResourcesApi() # Option 2: Pass client to API constructor # api_instance = iblai.MediaResourcesApi(client) # API call example item_id = 'item_id_example' # str | ID of the item item_type = 'item_type_example' # str | Type of item. Valid values: course, unit, resource, course_unit, course_resource, unit_resource, all org = 'org_example' # str | Organization identifier user_id = 'user_id_example' # str | User identifier course_id = 'course_id_example' # str | Filter by course ID (optional) search = 'search_example' # str | Search query (optional) unit_id = 'unit_id_example' # str | Filter by unit ID (optional) try: api_instance.media_orgs_users_media_media_resources_by_item_retrieve(item_id, item_type, org, user_id, course_id=course_id, search=search, unit_id=unit_id) except ApiException as e: print(f"Exception when calling MediaResourcesApi->media_orgs_users_media_media_resources_by_item_retrieve: {e}") ``` -------------------------------- ### GET /api/core/launcher/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Retrieve launcher configuration details. This endpoint returns information about the current launcher setup. ```APIDOC ## GET /api/core/launcher/ ### Description Retrieve launcher configuration details. ### Method GET ### Endpoint /api/core/launcher/ ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the launcher - **name** (string) - Name of the launcher - **url** (string) - Launcher URL - **configuration** (object) - Configuration settings - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update #### Response Example { "id": 1, "name": "Production Launcher", "url": "https://launcher.example.com", "configuration": { "timeout": 30, "max_retries": 3 }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } ``` -------------------------------- ### Create Platform with API Key Authentication - Python Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/CoreApi.md Demonstrates how to authenticate with the IBLAI API using API key credentials and create a new platform instance. The example shows client initialization with host and API key from environment variables, instantiation of the CoreApi class, and handling of API responses with exception management. ```python import iblai from iblai.models.platform_list import PlatformList from iblai.models.platform_update_post_request import PlatformUpdatePostRequest from iblai.rest import ApiException from pprint import pprint # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # The APIs use bearer tokens for authentication with a prefix of: `Api-Key` # You can generate an authenticated client using the following helper method client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) # Create an instance of the API class api_instance = iblai.CoreApi(api_client) platform_update_post_request = iblai.PlatformUpdatePostRequest() # PlatformUpdatePostRequest | try: api_response = api_instance.core_platform_create(platform_update_post_request) print("The response of CoreApi->core_platform_create:\n") pprint(api_response) except Exception as e: print("Exception when calling CoreApi->core_platform_create: %s\n" % e) ``` -------------------------------- ### Retrieve Teams Configuration for a Bot (Python) Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiBotApi.md This code example shows how to retrieve the Teams configuration for a specific bot using the Iblai Python SDK. It requires the bot's ID and organization. The example includes API client setup, making the request, and handling potential exceptions. ```python import iblai import os from iblai.rest import ApiException from pprint import pprint # Helper function to get the platform API client (replace with your actual implementation) def get_platform_api_client(host, key): # This is a placeholder. You should implement the actual client creation logic. # For example, it might involve creating an ApiClient instance and setting authentication headers. print(f"Creating client for host: {host} with key: {key}") # return iblai.ApiClient(host=host, api_key=key, api_key_prefix='Api-Key') return object() # Placeholder # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # The APIs use bearer tokens for authentication with a prefix of: `Api-Key` # You can generate an authenticated client using the following helper method client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) # Create an instance of the API class api_instance = iblai.AiBotApi(client) # Assuming 'client' is the authenticated API client id = 56 # int | A unique integer value identifying this bot. org = 'org_example' # str | try: api_response = api_instance.ai_bot_v1_bots_bot_config_teams_retrieve(id, org) print("The response of AiBotApi->ai_bot_v1_bots_bot_config_teams_retrieve:\n") pprint(api_response) except Exception as e: print("Exception when calling AiBotApi->ai_bot_v1_bots_bot_config_teams_retrieve: %s\n" % e) ``` -------------------------------- ### POST /api/core/launcher/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/CoreApi.md Launches a new edX platform. This endpoint facilitates the creation of new edX platform instances with specified configurations. ```APIDOC ## POST /api/core/launcher/ ### Description Launches a new edX platform. This endpoint facilitates the creation of new edX platform instances with specified configurations. ### Method POST ### Endpoint /api/core/launcher/ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **launcher_view_post_request** (LauncherViewPostRequest) - Required - The request body containing details for launching the platform. - **user_id** (string) - Required - The ID of the requesting user. - **key** (string) - Required - The Deep LMS subdomain. - **name** (string) - Optional - The edX platform name. - **org** (string) - Optional - The edX organization. - **lms_url** (string) - Optional - LMS URL. - **cms_url** (string) - Optional - CMS URL. - **portal_url** (string) - Optional - Portal URL. ### Request Example ```json { "user_id": "user123", "key": "my-subdomain", "name": "My Platform", "org": "My Org", "lms_url": "https://lms.example.com", "cms_url": "https://cms.example.com", "portal_url": "https://portal.example.com" } ``` ### Response #### Success Response (200) - **platforms** (array) - A list of launched platforms. - **id** (string) - The unique identifier of the platform. - **name** (string) - The name of the platform. - **org** (string) - The organization associated with the platform. - **lms_url** (string) - The URL of the LMS. - **cms_url** (string) - The URL of the CMS. - **portal_url** (string) - The URL of the portal. #### Response Example ```json { "platforms": [ { "id": "platform_abc", "name": "My Platform", "org": "My Org", "lms_url": "https://lms.example.com", "cms_url": "https://cms.example.com", "portal_url": "https://portal.example.com" } ] } ``` ``` -------------------------------- ### GET /providers/aws/domain-status/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/ProvidersApi.md Retrieves the current domain setup status for AWS provider configuration. Requires API Key authentication and returns domain status information. ```APIDOC ## GET /providers/aws/domain-status/ ### Description API endpoint to get domain setup status for AWS provider integration. ### Method GET ### Endpoint /providers/aws/domain-status/ ### Parameters This endpoint does not require any parameters. ### Return Type void (empty response body) ### Authorization PlatformApiKeyAuthentication (Api-Key bearer token) ### HTTP Request Headers - **Content-Type**: Not defined - **Accept**: Not defined ### Response #### Success Response (200) - No response body ### HTTP Response Details | Status Code | Description | Response Headers | |-------------|-------------|------------------| | 200 | No response body | - | ### Authentication Example ```python import iblai import os from iblai.rest import ApiException client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) api_instance = iblai.ProvidersApi(api_client) try: api_instance.providers_aws_domain_status_retrieve() except Exception as e: print("Exception when calling ProvidersApi->providers_aws_domain_status_retrieve: %s\n" % e) ``` ``` -------------------------------- ### POST /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/component/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Creates a new course creation component for a user. ```APIDOC ## POST /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/component/ ### Description Creates a new course creation component for a user. ### Method POST ### Endpoint /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/component/ ### Parameters #### Path Parameters - **org** (string) - Required - The organization identifier. - **user_id** (string) - Required - The user identifier. ### Request Body - **component_data** (object) - Required - Data for the new course creation component. ### Request Example ```json { "component_data": { "title": "Introduction to AI", "description": "A beginner's guide to artificial intelligence." } } ``` ### Response #### Success Response (200) - **component_id** (string) - The identifier of the newly created component. - **message** (string) - A success message. #### Response Example ```json { "component_id": "comp_abc123", "message": "Course creation component created successfully." } ``` ``` -------------------------------- ### Initialize IBLAI API Client with Authentication Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiFinetuningApi.md Sets up an authenticated IBLAI API client using platform API key authentication. The client is configured with the API host and authentication credentials from environment variables. This is a prerequisite for making any API calls to the fine-tuning endpoints. ```python import iblai import os # The APIs use bearer tokens for authentication with a prefix of: `Api-Key` # You can generate an authenticated client using the following helper method client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) # Create an instance of the API class api_instance = iblai.AiFinetuningApi(api_client) ``` -------------------------------- ### EmailPromptList Model Usage (Python) Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/EmailPromptList.md Demonstrates how to create an instance of the EmailPromptList model from a JSON string, convert it to a dictionary, and create an instance from a dictionary. This example requires the 'iblai-python-sdk' library to be installed. ```python from iblai.models.email_prompt_list import EmailPromptList # TODO update the JSON string below json = "{}" # create an instance of EmailPromptList from a JSON string email_prompt_list_instance = EmailPromptList.from_json(json) # print the JSON string representation of the object print(EmailPromptList.to_json()) # convert the object into a dict email_prompt_list_dict = email_prompt_list_instance.to_dict() # create an instance of EmailPromptList from a dict email_prompt_list_from_dict = EmailPromptList.from_dict(email_prompt_list_dict) ``` -------------------------------- ### GET /providers/aws/sync/domain/records Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/ProvidersApi.md This endpoint retrieves or updates CNAME records for domain setup within AWS. It requires no parameters and returns an empty response. Authentication is managed through a Platform API Key. ```APIDOC ## GET /providers/aws/sync/domain/records ### Description This endpoint retrieves or updates CNAME records for domain setup within AWS. It requires no parameters and returns an empty response. Authentication is managed through a Platform API Key. ### Method GET ### Endpoint /providers/aws/sync/domain/records ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import iblai from iblai.rest import ApiException # Assume api_client is configured with authentication api_instance = iblai.ProvidersApi(api_client) try: api_instance.providers_aws_sync_domain_records_retrieve() print("AWS domain records retrieved/updated successfully.") except ApiException as e: print(f"Exception when calling ProvidersApi->providers_aws_sync_domain_records_retrieve: {e}") ``` ### Response #### Success Response (200) - **Description**: No response body. Indicates the CNAME records have been retrieved or updated successfully. #### Response Example (No response body) ``` -------------------------------- ### Create and Update AI Mentor (Python) Source: https://context7.com/iblai/iblai-python-sdk/llms.txt Shows how to create a new AI mentor with specified parameters like name, description, system prompt, and model settings using the `MentorCreate` model. It also demonstrates updating the mentor's settings, such as visibility and feature enablement, using `MentorSettingsRequest`. ```python from iblai import AiMentorApi, MentorCreate from iblai.models.mentor_settings_request import MentorSettingsRequest mentor_api = AiMentorApi(client) # Create a new AI mentor mentor_data = MentorCreate( name="Python Programming Tutor", description="An AI mentor specialized in Python programming and best practices", system_prompt="You are an expert Python programming tutor. Help students learn Python concepts with clear explanations and practical examples.", greeting_message="Hello! I'm your Python programming tutor. How can I help you today?", model="gpt-4", temperature=0.7, max_tokens=2000 ) try: new_mentor = mentor_api.ai_mentor_orgs_users_create( org="my-org", user_id="admin-user", mentor_create=mentor_data ) print(f"Created mentor: {new_mentor.name} (ID: {new_mentor.id})") # Update mentor settings settings = MentorSettingsRequest( visibility="public", enable_voice=True, enable_image_generation=True, memory_enabled=True ) updated_mentor = mentor_api.ai_mentor_orgs_users_mentors_settings_update( org="my-org", user_id="admin-user", mentor=new_mentor.id, mentor_settings_request=settings ) print(f"Updated mentor settings: {updated_mentor}") except ApiException as e: print(f"Error creating mentor: {e}") ``` -------------------------------- ### POST /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Create a new training job for AI model finetuning. Initiates a finetuning process using specified datasets and configuration parameters. ```APIDOC ## POST /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/ ### Description Create a new AI model finetuning training job. ### Method POST ### Endpoint /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/ ### Parameters #### Path Parameters - **org** (string) - Required - Organization identifier - **username** (string) - Required - Username initiating the training #### Request Body - **dataset_id** (string) - Required - ID of the dataset to use for training - **model_name** (string) - Required - Name for the finetuned model - **epochs** (integer) - Optional - Number of training epochs - **learning_rate** (number) - Optional - Learning rate for training ``` -------------------------------- ### Delete RBAC Policy with Iblai Python SDK Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/CoreApi.md Illustrates how to delete an RBAC policy using `CoreApi.core_rbac_policies_destroy`. This method requires the policy's ID and optionally a platform key. The example shows the setup for API key authentication. ```python import iblai from iblai.rest import ApiException from pprint import pprint import os # Assuming get_platform_api_client is a helper function to configure the client # client = get_platform_api_client( # host="https://base.manager.iblai.app", # key=os.environ["API_KEY"] # ) # api_client = client # Assign the configured client to api_client # Create an instance of the API class api_instance = iblai.CoreApi(api_client) # Example usage: # id_to_delete = 123 # Replace with the actual ID of the policy to delete # platform_key_optional = "your_platform_key" # Optional: replace if needed # try: # api_instance.core_rbac_policies_destroy(id_to_delete, platform_key=platform_key_optional) # print(f"RBAC policy with ID {id_to_delete} deleted successfully.") # except ApiException as e: # print("Exception when calling CoreApi->core_rbac_policies_destroy: %s\n" % e) # except Exception as e: # print("An unexpected error occurred: %s\n" % e) # Note: The actual call to delete is commented out as it requires specific IDs and context. # The provided snippet focuses on the setup and method signature. ``` -------------------------------- ### POST /api/catalog/suggestions/course/manage/bulk/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Manages course suggestions in bulk. ```APIDOC ## POST /api/catalog/suggestions/course/manage/bulk/ ### Description Manages course suggestions in bulk. ### Method POST ### Endpoint /api/catalog/suggestions/course/manage/bulk/ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Details about the request body are not provided in the input. ### Request Example None ### Response #### Success Response (200) Details about the success response are not provided in the input. #### Response Example None ``` -------------------------------- ### Retrieve Platform Organization Time Count Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/PlatformApi.md Shows how to call the `platform_orgs_time_count_retrieve` method to get the total time spent count for an organization. It utilizes API key authentication and handles potential exceptions. The method can optionally accept start and end dates. ```python import iblai import os from iblai.rest import ApiException from pprint import pprint # Assuming get_platform_api_client is defined elsewhere and correctly sets up the api_client # Example placeholder for get_platform_api_client: def get_platform_api_client(host, key): # In a real scenario, this would return an authenticated api_client object print(f"Simulating client creation for host: {host} with key: {key[:4]}...") # Mock api_client for demonstration class MockApiClient: def __init__(self): pass def platform_orgs_time_count_retrieve(self, org): print(f"Mock platform_orgs_time_count_retrieve called for org: {org}") # Simulate a successful call return True return MockApiClient() api_client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) # Create an instance of the API class api_instance = iblai.PlatformApi(api_client) org = 'org_example' # str | try: api_instance.platform_orgs_time_count_retrieve(org) print(f"Successfully called platform_orgs_time_count_retrieve for org: {org}") except Exception as e: print("Exception when calling PlatformApi->platform_orgs_time_count_retrieve: %s\n" % e) ``` -------------------------------- ### Launch Tenant Instance with ServiceApi Python Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/ServiceApi.md Creates and launches a new tenant instance using the ServiceApi. Accepts a TenantLaunchRequest object and returns a TenantLaunchResponse. Requires PlatformApiKeyAuthentication and handles exceptions from the API call. ```python import iblai from iblai.rest import ApiException from pprint import pprint # Create an instance of the API class api_instance = iblai.ServiceApi(api_client) tenant_launch_request = iblai.TenantLaunchRequest() try: api_response = api_instance.service_launch_tenant_create(tenant_launch_request) print("The response of ServiceApi->service_launch_tenant_create:\n") pprint(api_response) except Exception as e: print("Exception when calling ServiceApi->service_launch_tenant_create: %s\n" % e) ``` -------------------------------- ### Retrieve Platform Users with API Key Authentication - Python Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/CoreApi.md Demonstrates retrieval of users associated with a platform using pagination, filtering, and sorting parameters. The example includes client setup with API key authentication and partial implementation of the core_platform_users_retrieve endpoint call. ```python import iblai from iblai.models.user_platform_management_list_view_get_response import UserPlatformManagementListViewGetResponse from iblai.rest import ApiException from pprint import pprint # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. ``` -------------------------------- ### GET /platform/orgs/courses/progress/started Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/PlatformApi.md Retrieves information about started enrollments or courses in progress. For a platform, it returns total users with at least an enrollment. For a course, it returns total users enrolled. For a learner, it returns total courses in progress. Optional query parameters include `course_id` and `user_id`. ```APIDOC ## GET /platform/orgs/courses/progress/started ### Description Retrieves information about started enrollments or courses in progress. For a platform, it returns total users with at least an enrollment. For a course, it returns total users enrolled. For a learner, it returns total courses in progress. Optional query parameters include `course_id` and `user_id`. ### Method GET ### Endpoint /platform/orgs/courses/progress/started ### Parameters #### Query Parameters - **course_id** (str) - Optional - The ID of the course (e.g., 'course-v1:Org+Course4+Run'). - **org** (str) - Required - The organization identifier. - **user_id** (str) - Optional - The ID of the user (username or email). ### Request Example ```python import iblai api_instance = iblai.PlatformApi(api_client) course_id = 'course_id_example' org = 'org_example' try: api_instance.platform_orgs_courses_progress_started_retrieve(course_id, org) except Exception as e: print(f"Exception when calling PlatformApi->platform_orgs_courses_progress_started_retrieve: {e}") ``` ### Response #### Success Response (200) - **void** - No response body. #### Response Example (empty response body) ``` -------------------------------- ### POST /api/core/platform/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Creates a new platform instance. This endpoint initializes a new platform with the provided configuration parameters. ```APIDOC ## POST /api/core/platform/ ### Description Creates a new platform instance. ### Method POST ### Endpoint /api/core/platform/ ### Parameters #### Request Body - **name** (string) - Required - Platform name - **description** (string) - Optional - Platform description ### Response #### Success Response (201) - **id** (string) - Platform identifier - **name** (string) - Platform name - **description** (string) - Platform description #### Response Example { "id": "platform-001", "name": "My Platform", "description": "Platform description" } ``` -------------------------------- ### POST /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiFinetuningApi.md Creates a new finetuning training job for a user within an organization. Requires platform API key authentication. ```APIDOC ## POST /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/ ### Description Creates a new finetuning training job for a user within an organization. Requires platform API key authentication. ### Method POST ### Endpoint /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/ ### Parameters #### Path Parameters - **org** (str) - Required - The organization identifier. - **username** (str) - Required - The username of the user. #### Request Body - **training_create** (TrainingCreate) - Required - The training creation object. ### Response #### Success Response (201 Created) - **TrainingCreate** (TrainingCreate) - The created training job object. #### Response Example ```json { "id": "training_id_789", "dataset_id": "dataset_id_123", "model_name": "base-model-v1", "status": "PENDING" } ``` ### Authorization PlatformApiKeyAuthentication ``` -------------------------------- ### Create RBAC Policy with Iblai Python SDK Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/CoreApi.md Shows how to create a new RBAC policy using `CoreApi.core_rbac_policies_create`. This function requires an authenticated API client and an RbacPolicy object. The example includes setup for API key authentication and handles potential exceptions during the API call. ```python import iblai from iblai.models.rbac_policy import RbacPolicy from iblai.rest import ApiException from pprint import pprint import os # Assuming get_platform_api_client is a helper function to configure the client # client = get_platform_api_client( # host="https://base.manager.iblai.app", # key=os.environ["API_KEY"] # ) # api_client = client # Assign the configured client to api_client # Create an instance of the API class api_instance = iblai.CoreApi(api_client) rbac_policy = iblai.RbacPolicy() # RbacPolicy | try: # Create RBAC policy api_response = api_instance.core_rbac_policies_create(rbac_policy) print("The response of CoreApi->core_rbac_policies_create:\n") pprint(api_response) except Exception as e: print("Exception when calling CoreApi->core_rbac_policies_create: %s\n" % e) ``` -------------------------------- ### POST /api/core/launcher/ Source: https://github.com/iblai/iblai-python-sdk/blob/main/README.md Create a new launcher configuration. This endpoint allows you to set up a new launcher with specific configuration parameters. ```APIDOC ## POST /api/core/launcher/ ### Description Create a new launcher configuration. ### Method POST ### Endpoint /api/core/launcher/ ### Request Body - **name** (string) - Required - Name of the launcher - **url** (string) - Required - Launcher URL - **configuration** (object) - Optional - Additional configuration settings ### Request Example { "name": "Production Launcher", "url": "https://launcher.example.com", "configuration": { "timeout": 30, "max_retries": 3 } } ### Response #### Success Response (201) - **id** (integer) - Unique identifier for the launcher - **name** (string) - Name of the launcher - **url** (string) - Launcher URL - **configuration** (object) - Configuration settings - **created_at** (string) - Timestamp of creation #### Response Example { "id": 1, "name": "Production Launcher", "url": "https://launcher.example.com", "configuration": { "timeout": 30, "max_retries": 3 }, "created_at": "2024-01-15T10:30:00Z" } ``` -------------------------------- ### Update Slack User Config (Python) Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiBotApi.md Illustrates how to update a Slack user configuration using the `ai_bot_v1_bots_slack_user_config_update` method. This method requires a unique integer ID, an organization string, and a `SlackUserConfig` object containing the new configuration. The example includes authentication setup and error handling. ```python import iblai from iblai.models.slack_user_config import SlackUserConfig from iblai.rest import ApiException from pprint import pprint import os # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # The APIs use bearer tokens for authentication with a prefix of: `Api-Key` # You can generate an authenticated client using the following helper method # Assuming get_platform_api_client is defined elsewhere # client = get_platform_api_client( # host="https://base.manager.iblai.app", # key=os.environ["API_KEY"] # ) # Create an instance of the API class api_instance = iblai.AiBotApi(api_client) # Assuming api_client is obtained from get_platform_api_client id = 56 # int | A unique integer value identifying this slack user config. org = 'org_example' # str | slack_user_config = SlackUserConfig() # SlackUserConfig | # try: # api_response = api_instance.ai_bot_v1_bots_slack_user_config_update(id, org, slack_user_config) # print("The response of AiBotApi->ai_bot_v1_bots_slack_user_config_update:\n") # pprint(api_response) # except Exception as e: # print("Exception when calling AiBotApi->ai_bot_v1_bots_slack_user_config_update: %s\n" % e) ``` -------------------------------- ### Initialize IBLAI Platform API Client - Python Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiFinetuningApi.md Configures and initializes an authenticated API client for the IBLAI platform using API key authentication. Sets the host URL to the IBLAI manager endpoint and authenticates using an API key from environment variables with the 'Api-Key' prefix. Required before calling any AiFinetuningApi methods. ```python import iblai import os client = get_platform_api_client( host="https://base.manager.iblai.app", key=os.environ["API_KEY"] ) ``` -------------------------------- ### Retrieve Slack User Config (Python) Source: https://github.com/iblai/iblai-python-sdk/blob/main/docs/AiBotApi.md Shows how to retrieve a Slack user configuration using the `ai_bot_v1_bots_slack_user_config_retrieve` method. This requires a unique integer ID and an organization string. The example includes authentication setup using an API key and error handling. The response is a `SlackUserConfig` object. ```python import iblai from iblai.models.slack_user_config import SlackUserConfig from iblai.rest import ApiException from pprint import pprint import os # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # The APIs use bearer tokens for authentication with a prefix of: `Api-Key` # You can generate an authenticated client using the following helper method # Assuming get_platform_api_client is defined elsewhere # client = get_platform_api_client( # host="https://base.manager.iblai.app", # key=os.environ["API_KEY"] # ) # Create an instance of the API class api_instance = iblai.AiBotApi(api_client) # Assuming api_client is obtained from get_platform_api_client id = 56 # int | A unique integer value identifying this slack user config. org = 'org_example' # str | try: api_response = api_instance.ai_bot_v1_bots_slack_user_config_retrieve(id, org) print("The response of AiBotApi->ai_bot_v1_bots_slack_user_config_retrieve:\n") pprint(api_response) except Exception as e: print("Exception when calling AiBotApi->ai_bot_v1_bots_slack_user_config_retrieve: %s\n" % e) ```