/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { DocumentSearchResponse } from '../models/DocumentSearchResponse'; import type { GlobalCatalogSearchResponse } from '../models/GlobalCatalogSearchResponse'; import type { MentorSearchResponse } from '../models/MentorSearchResponse'; import type { PromptSearchResponse } from '../models/PromptSearchResponse'; import type { RecommendedCoursesResponse } from '../models/RecommendedCoursesResponse'; import type { UserSearchResponse } from '../models/UserSearchResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class SearchService { /** * Search and filter AI mentors across the platform. * * This endpoint provides a powerful search interface for discovering AI mentors * with support for filtering, pagination, and detailed mentor information. * * Query Parameters: * # Identification parameters (for detail view) * id (int, optional): Retrieve a specific mentor by ID * unique_id (uuid, optional): Retrieve a specific mentor by UUID * * # Search and filtering parameters * query (str, optional): Search term to filter mentors by name or description * tenant (str, optional): Filter by tenant/organization * llm (list, optional): Filter by language model type * audience (list, optional): Filter by target audience * category (list, optional): Filter by mentor category * tags (list, optional): Filter by tags * created_by (str, optional): Filter mentors created by specific user * * # Sorting and pagination * order_by (str, optional): Field to sort results by ('created_at', 'recently_accessed_at') * order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc') * limit (int, optional): Number of results per page (default: 12, max: 100) * offset (int, optional): Starting position for pagination * * Returns: * For detail view (when id or unique_id is provided): * A JSON response containing a single mentor's details: * { * "id": 123, * "unique_id": "550e8400-e29b-41d4-a716-446655440000", * "name": "Professor Smith", * "description": "AI mentor specializing in computer science", * "image_url": "https://example.com/images/prof-smith.jpg", * "llm": { * "id": 1, * "name": "GPT-4", * "description": "Advanced language model" * }, * "audience": { * "id": 2, * "name": "College Students", * "description": "For university-level learners" * }, * "category": "Computer Science", * "tags": ["programming", "algorithms", "data structures"], * "created_at": "2023-01-15T12:00:00Z", * "recently_accessed_at": "2023-06-20T15:30:00Z", * "platform": { * "id": 1, * "name": "Example University", * "key": "example-university" * }, * "visibility": "public", * "settings": { * "temperature": 0.7, * "max_tokens": 1024, * "system_prompt": "You are Professor Smith, an expert in computer science..." * } * } * * For list view: * A JSON response containing: * { * "results": [ * { * "id": 123, * "unique_id": "550e8400-e29b-41d4-a716-446655440000", * "name": "Professor Smith", * "description": "AI mentor specializing in computer science", * "image_url": "https://example.com/images/prof-smith.jpg", * "llm": {"id": 1, "name": "GPT-4"}, * "audience": {"id": 2, "name": "College Students"}, * "category": "Computer Science", * "tags": ["programming", "algorithms"], * "created_at": "2023-01-15T12:00:00Z", * "recently_accessed_at": "2023-06-20T15:30:00Z" * }, * // Additional mentor objects... * ], * "count": 50, * "next": "https://api.example.com/api/search/mentors/?limit=12&offset=12", * "previous": null, * "current_page": 1, * "num_pages": 5, * "facets": { * "llm": [ * {"key": "GPT-4", "doc_count": 30}, * {"key": "Claude", "doc_count": 20} * ], * "audience": [ * {"key": "College Students", "doc_count": 35}, * {"key": "Professionals", "doc_count": 15} * ], * "category": [ * {"key": "Computer Science", "doc_count": 25}, * {"key": "Mathematics", "doc_count": 15}, * {"key": "Business", "doc_count": 10} * ] * } * } * * Error Responses: * 400 Bad Request: If the request parameters are invalid * 404 Not Found: If the requested mentor doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Notes: * - Results are cached for performance * - Public mentors are visible to all users * - Private mentors are only visible to authorized users * @returns MentorSearchResponse * @throws ApiError */ public static searchAgentsRetrieve({ audience, category, createdBy, featured, id, includeMainPublicMentors = false, limit = 12, llm, offset, orderBy, orderDirection = 'desc', query, tags, tenant, uniqueId, }: { /** * Filter by target audience */ audience?: Array, /** * Filter by mentor category */ category?: Array, /** * Filter mentors created by specific user */ createdBy?: string, /** * Filter by featured status */ featured?: boolean, /** * Retrieve a specific mentor by ID */ id?: number, /** * Include public mentors from main tenant */ includeMainPublicMentors?: boolean, /** * Number of results per page */ limit?: number, /** * Filter by language model type */ llm?: Array, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('created_at', 'recently_accessed_at') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Search term to filter mentors by name or description */ query?: string, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Retrieve a specific mentor by UUID */ uniqueId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/agents/', query: { 'audience': audience, 'category': category, 'created_by': createdBy, 'featured': featured, 'id': id, 'include_main_public_mentors': includeMainPublicMentors, 'limit': limit, 'llm': llm, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'query': query, 'tags': tags, 'tenant': tenant, 'unique_id': uniqueId, }, errors: { 400: `Bad request`, 500: `Server error`, }, }); } /** * Search and filter documents associated with a specific mentor * @returns DocumentSearchResponse * @throws ApiError */ public static searchAgentsDocumentsRetrieve({ mentorUniqueId, access, documentType, limit = 12, offset, orderBy, orderDirection = 'desc', platformKey, query, trainingStatus, }: { mentorUniqueId: string, /** * Filter by access level (e.g., 'public', 'private') */ access?: string, /** * Filter by document type (e.g., 'pdf', 'text') */ documentType?: string, /** * Number of results per page */ limit?: number, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('date_created', 'last_modified', 'document_name') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Filter by platform key */ platformKey?: string, /** * Search term to filter documents by name or content */ query?: string, /** * Filter by training status (e.g., 'trained', 'pending') */ trainingStatus?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/agents/{mentor_unique_id}/documents/', path: { 'mentor_unique_id': mentorUniqueId, }, query: { 'access': access, 'document_type': documentType, 'limit': limit, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'platform_key': platformKey, 'query': query, 'training_status': trainingStatus, }, errors: { 400: `Bad request`, 404: `Mentor not found`, 500: `Server error`, }, }); } /** * Legacy endpoint for backward compatible mentor search * @returns MentorSearchResponse * @throws ApiError */ public static searchAiSearchRetrieve({ audience, category, createdBy, filterFacet = false, id, limit = 12, llm, offset, orderBy, orderDirection = 'desc', page, pageSize, query, tags, tenant, uniqueId, }: { /** * Filter by target audience */ audience?: Array, /** * Filter by mentor category */ category?: Array, /** * Filter mentors created by specific user */ createdBy?: string, /** * If present, return only facets without results */ filterFacet?: boolean, /** * Retrieve a specific mentor by ID */ id?: number, /** * Number of results per page */ limit?: number, /** * Filter by language model type */ llm?: Array, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('created_at', 'recently_accessed_at') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Page number (1-based, used with page_size) */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Search term to filter mentors by name or description */ query?: string, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Retrieve a specific mentor by UUID */ uniqueId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/ai-search/', query: { 'audience': audience, 'category': category, 'created_by': createdBy, 'filter_facet': filterFacet, 'id': id, 'limit': limit, 'llm': llm, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'page': page, 'page_size': pageSize, 'query': query, 'tags': tags, 'tenant': tenant, 'unique_id': uniqueId, }, errors: { 400: `Bad request`, 500: `Server error`, }, }); } /** * Search and filter content across the learning catalog. * * This endpoint provides a powerful search interface for discovering content across * multiple content types (courses, programs, pathways, skills, roles, resources). * It supports full-text search, faceted filtering, and pagination. * * Query Parameters: * query (str, optional): Search term to filter content by name or description * content (list, optional): Content types to include in results * (courses, programs, pathways, skills, roles, resources) * Default: ["programs", "courses", "pathways", "skills"] * * # Filtering parameters * course_id (str, optional): Filter by specific course ID * program_id (str, optional): Filter by specific program ID * pathway_id (str, optional): Filter by specific pathway ID * skill_id (str, optional): Filter by specific skill ID * subject (list, optional): Filter by subject areas * tenant (list, optional): Filter by tenant/organization * topics (list, optional): Filter by topic areas * tags (list, optional): Filter by tags * level (list, optional): Filter by difficulty level * self_paced (list, optional): Filter by course format (self-paced, instructor-led) * promotion (list, optional): Filter by promotion status * language (list, optional): Filter by content language * certificate (list, optional): Filter by certificate type * program_type (list, optional): Filter by program type * duration (list, optional): Filter by course duration range * price (str, optional): Filter by price/audit status * resource_type (list, optional): Filter by resource type * skills (list, optional): Filter by skills * * # Sorting and pagination * order_by (str, optional): Field to sort results by * order_ascending (bool, optional): Sort direction (default: false) * alphabetical (bool, optional): Sort alphabetically by name (default: false) * limit (int, optional): Number of results per page (default: 12, max: 100) * offset (int, optional): Starting position for pagination * * # Response options * return_facet (bool, optional): Include facet data in response (default: true) * return_items (bool, optional): Include items in programs/pathways (default: false) * allow_skill_search (bool, optional): Enable skill-based search (default: false) * update_facet (str, optional): Force facet update * * Returns: * A JSON response containing: * - results: List of content items with metadata * - count: Total number of matching items * - next: URL for the next page of results (if available) * - previous: URL for the previous page of results (if available) * - current_page: Current page number * - total_pages: Total number of pages * - facets: Aggregated counts for each filter category (if requested) * * Each content item contains type-specific fields: * - Courses: * { * "id": 123, * "type": "course", * "course_id": "CS101", * "name": "Introduction to Computer Science", * "description": "Learn the fundamentals of computer science", * "short_description": "CS fundamentals", * "image_url": "https://example.com/images/cs101.jpg", * "level": "Beginner", * "subject": "Computer Science", * "topics": ["Programming", "Algorithms"], * "tags": ["python", "coding"], * "language": "English", * "tenant": "example-university", * "self_paced": true, * "duration": "6 weeks", * "certificate": "Professional Certificate", * "price": "Free", * "skills": [ * {"id": 1, "name": "Python Programming"}, * {"id": 2, "name": "Algorithms"} * ], * "url": "https://example.com/courses/cs101" * } * * - Programs: * { * "id": 456, * "type": "program", * "program_id": "PROG123", * "name": "Data Science Program", * "description": "Comprehensive data science curriculum", * "short_description": "Learn data science", * "image_url": "https://example.com/images/datascience.jpg", * "level": "Intermediate", * "subject": "Data Science", * "topics": ["Machine Learning", "Statistics"], * "program_type": "Professional Certificate", * "courses": [ * {"id": 123, "name": "Introduction to Python"}, * {"id": 124, "name": "Statistics for Data Science"} * ], * "url": "https://example.com/programs/prog123" * } * * - Pathways: * { * "id": 789, * "type": "pathway", * "pathway_id": "PATH456", * "name": "Software Engineering Career Path", * "description": "Complete pathway to become a software engineer", * "image_url": "https://example.com/images/swe-path.jpg", * "programs": [ * {"id": 456, "name": "Programming Fundamentals"}, * {"id": 457, "name": "Web Development"} * ], * "url": "https://example.com/pathways/path456" * } * * - Skills: * { * "id": 321, * "type": "skill", * "name": "Machine Learning", * "description": "Building systems that learn from data", * "courses": [ * {"id": 125, "name": "Machine Learning Fundamentals"} * ], * "related_skills": [ * {"id": 322, "name": "Deep Learning"} * ] * } * * - Roles: * { * "id": 654, * "type": "role", * "name": "Data Scientist", * "description": "Professional who analyzes and interprets complex data", * "skills": [ * {"id": 321, "name": "Machine Learning"}, * {"id": 323, "name": "Data Analysis"} * ], * "recommended_courses": [ * {"id": 125, "name": "Machine Learning Fundamentals"} * ] * } * * - Resources: * { * "id": 987, * "type": "resource", * "name": "Python Cheat Sheet", * "description": "Quick reference guide for Python", * "resource_type": "PDF", * "url": "https://example.com/resources/python-cheatsheet.pdf", * "topics": ["Programming", "Python"] * } * * Error Responses: * 500 Internal Server Error: If an unexpected error occurs during processing * * Notes: * - Results are cached for performance * - The 'resources' content type is only included by default if IBL_ENABLE_RESOURCES_IN_FACET is true * - For debugging, add ?debug=true to see detailed information about skill matching * @returns GlobalCatalogSearchResponse * @throws ApiError */ public static searchCatalogRetrieve({ allowSkillSearch = false, alphabetical = false, certificate, content, courseId, duration, language, level, limit = 12, offset, orderAscending = false, orderBy, pathwayId, price, programId, programType, promotion, query, resourceType, returnFacet = true, returnItems = false, selfPaced, skillId, skills, subject, tags, tenant, topics, updateFacet, }: { /** * Enable skill-based search */ allowSkillSearch?: boolean, /** * Sort alphabetically by name */ alphabetical?: boolean, /** * Filter by certificate type */ certificate?: Array, /** * Content types to include in results */ content?: Array, /** * Filter by specific course ID */ courseId?: string, /** * Filter by course duration range */ duration?: Array, /** * Filter by content language */ language?: Array, /** * Filter by difficulty level */ level?: Array, /** * Number of results per page */ limit?: number, /** * Starting position for pagination */ offset?: number, /** * Sort direction */ orderAscending?: boolean, /** * Field to sort results by */ orderBy?: string, /** * Filter by specific pathway ID */ pathwayId?: string, /** * Filter by price/audit status */ price?: string, /** * Filter by specific program ID */ programId?: string, /** * Filter by program type */ programType?: Array, /** * Filter by promotion status */ promotion?: Array, /** * Search term to filter content by name or description */ query?: string, /** * Filter by resource type */ resourceType?: Array, /** * Include facet data in response */ returnFacet?: boolean, /** * Include items in programs/pathways */ returnItems?: boolean, /** * Filter by course format */ selfPaced?: Array, /** * Filter by specific skill ID */ skillId?: string, /** * Filter by skills */ skills?: Array, /** * Filter by subject areas */ subject?: Array, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Filter by topic areas */ topics?: Array, /** * Force facet update */ updateFacet?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/catalog/', query: { 'allow_skill_search': allowSkillSearch, 'alphabetical': alphabetical, 'certificate': certificate, 'content': content, 'course_id': courseId, 'duration': duration, 'language': language, 'level': level, 'limit': limit, 'offset': offset, 'order_ascending': orderAscending, 'order_by': orderBy, 'pathway_id': pathwayId, 'price': price, 'program_id': programId, 'program_type': programType, 'promotion': promotion, 'query': query, 'resource_type': resourceType, 'return_facet': returnFacet, 'return_items': returnItems, 'self_paced': selfPaced, 'skill_id': skillId, 'skills': skills, 'subject': subject, 'tags': tags, 'tenant': tenant, 'topics': topics, 'update_facet': updateFacet, }, errors: { 400: `Bad request`, 500: `Server error`, }, }); } /** * @deprecated * **Deprecated — use `/api/search/agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/search/agents/` (`mentor` → `agent`) and will be removed in a future release. * * Search and filter AI mentors across the platform. * * This endpoint provides a powerful search interface for discovering AI mentors * with support for filtering, pagination, and detailed mentor information. * * Query Parameters: * # Identification parameters (for detail view) * id (int, optional): Retrieve a specific mentor by ID * unique_id (uuid, optional): Retrieve a specific mentor by UUID * * # Search and filtering parameters * query (str, optional): Search term to filter mentors by name or description * tenant (str, optional): Filter by tenant/organization * llm (list, optional): Filter by language model type * audience (list, optional): Filter by target audience * category (list, optional): Filter by mentor category * tags (list, optional): Filter by tags * created_by (str, optional): Filter mentors created by specific user * * # Sorting and pagination * order_by (str, optional): Field to sort results by ('created_at', 'recently_accessed_at') * order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc') * limit (int, optional): Number of results per page (default: 12, max: 100) * offset (int, optional): Starting position for pagination * * Returns: * For detail view (when id or unique_id is provided): * A JSON response containing a single mentor's details: * { * "id": 123, * "unique_id": "550e8400-e29b-41d4-a716-446655440000", * "name": "Professor Smith", * "description": "AI mentor specializing in computer science", * "image_url": "https://example.com/images/prof-smith.jpg", * "llm": { * "id": 1, * "name": "GPT-4", * "description": "Advanced language model" * }, * "audience": { * "id": 2, * "name": "College Students", * "description": "For university-level learners" * }, * "category": "Computer Science", * "tags": ["programming", "algorithms", "data structures"], * "created_at": "2023-01-15T12:00:00Z", * "recently_accessed_at": "2023-06-20T15:30:00Z", * "platform": { * "id": 1, * "name": "Example University", * "key": "example-university" * }, * "visibility": "public", * "settings": { * "temperature": 0.7, * "max_tokens": 1024, * "system_prompt": "You are Professor Smith, an expert in computer science..." * } * } * * For list view: * A JSON response containing: * { * "results": [ * { * "id": 123, * "unique_id": "550e8400-e29b-41d4-a716-446655440000", * "name": "Professor Smith", * "description": "AI mentor specializing in computer science", * "image_url": "https://example.com/images/prof-smith.jpg", * "llm": {"id": 1, "name": "GPT-4"}, * "audience": {"id": 2, "name": "College Students"}, * "category": "Computer Science", * "tags": ["programming", "algorithms"], * "created_at": "2023-01-15T12:00:00Z", * "recently_accessed_at": "2023-06-20T15:30:00Z" * }, * // Additional mentor objects... * ], * "count": 50, * "next": "https://api.example.com/api/search/mentors/?limit=12&offset=12", * "previous": null, * "current_page": 1, * "num_pages": 5, * "facets": { * "llm": [ * {"key": "GPT-4", "doc_count": 30}, * {"key": "Claude", "doc_count": 20} * ], * "audience": [ * {"key": "College Students", "doc_count": 35}, * {"key": "Professionals", "doc_count": 15} * ], * "category": [ * {"key": "Computer Science", "doc_count": 25}, * {"key": "Mathematics", "doc_count": 15}, * {"key": "Business", "doc_count": 10} * ] * } * } * * Error Responses: * 400 Bad Request: If the request parameters are invalid * 404 Not Found: If the requested mentor doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Notes: * - Results are cached for performance * - Public mentors are visible to all users * - Private mentors are only visible to authorized users * @returns MentorSearchResponse * @throws ApiError */ public static searchMentorsRetrieve({ audience, category, createdBy, featured, id, includeMainPublicMentors = false, limit = 12, llm, offset, orderBy, orderDirection = 'desc', query, tags, tenant, uniqueId, }: { /** * Filter by target audience */ audience?: Array, /** * Filter by mentor category */ category?: Array, /** * Filter mentors created by specific user */ createdBy?: string, /** * Filter by featured status */ featured?: boolean, /** * Retrieve a specific mentor by ID */ id?: number, /** * Include public mentors from main tenant */ includeMainPublicMentors?: boolean, /** * Number of results per page */ limit?: number, /** * Filter by language model type */ llm?: Array, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('created_at', 'recently_accessed_at') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Search term to filter mentors by name or description */ query?: string, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Retrieve a specific mentor by UUID */ uniqueId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/mentors/', query: { 'audience': audience, 'category': category, 'created_by': createdBy, 'featured': featured, 'id': id, 'include_main_public_mentors': includeMainPublicMentors, 'limit': limit, 'llm': llm, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'query': query, 'tags': tags, 'tenant': tenant, 'unique_id': uniqueId, }, errors: { 400: `Bad request`, 500: `Server error`, }, }); } /** * @deprecated * **Deprecated — use `/api/search/agents/{mentor_unique_id}/documents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/search/agents/{mentor_unique_id}/documents/` (`mentor` → `agent`) and will be removed in a future release. * * Search and filter documents associated with a specific mentor * @returns DocumentSearchResponse * @throws ApiError */ public static searchMentorsDocumentsRetrieve({ mentorUniqueId, access, documentType, limit = 12, offset, orderBy, orderDirection = 'desc', platformKey, query, trainingStatus, }: { mentorUniqueId: string, /** * Filter by access level (e.g., 'public', 'private') */ access?: string, /** * Filter by document type (e.g., 'pdf', 'text') */ documentType?: string, /** * Number of results per page */ limit?: number, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('date_created', 'last_modified', 'document_name') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Filter by platform key */ platformKey?: string, /** * Search term to filter documents by name or content */ query?: string, /** * Filter by training status (e.g., 'trained', 'pending') */ trainingStatus?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/mentors/{mentor_unique_id}/documents/', path: { 'mentor_unique_id': mentorUniqueId, }, query: { 'access': access, 'document_type': documentType, 'limit': limit, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'platform_key': platformKey, 'query': query, 'training_status': trainingStatus, }, errors: { 400: `Bad request`, 404: `Mentor not found`, 500: `Server error`, }, }); } /** * Handle GET requests for tenant-specific mentor search. * * Args: * request: HTTP request object * org: Tenant/organization key * username: Username of the user making the request * * Returns: * Response: DRF Response object with search results * @returns MentorSearchResponse * @throws ApiError */ public static searchOrgsUsersAgentsRetrieve({ org, username, audience, category, createdBy, featured, id, includeMainPublicMentors = false, limit = 12, llm, offset, orderBy, orderDirection = 'desc', query, tags, tenant, uniqueId, }: { org: string, username: string, /** * Filter by target audience */ audience?: Array, /** * Filter by mentor category */ category?: Array, /** * Filter mentors created by specific user */ createdBy?: string, /** * Filter by featured status */ featured?: boolean, /** * Retrieve a specific mentor by ID */ id?: number, /** * Include public mentors from main tenant */ includeMainPublicMentors?: boolean, /** * Number of results per page */ limit?: number, /** * Filter by language model type */ llm?: Array, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('created_at', 'recently_accessed_at') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Search term to filter mentors by name or description */ query?: string, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Retrieve a specific mentor by UUID */ uniqueId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/orgs/{org}/users/{username}/agents/', path: { 'org': org, 'username': username, }, query: { 'audience': audience, 'category': category, 'created_by': createdBy, 'featured': featured, 'id': id, 'include_main_public_mentors': includeMainPublicMentors, 'limit': limit, 'llm': llm, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'query': query, 'tags': tags, 'tenant': tenant, 'unique_id': uniqueId, }, errors: { 400: `Bad request`, 403: `Forbidden - user does not have access`, 500: `Server error`, }, }); } /** * @deprecated * **Deprecated — use `/api/search/orgs/{org}/users/{username}/agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/search/orgs/{org}/users/{username}/agents/` (`mentor` → `agent`) and will be removed in a future release. * * Handle GET requests for tenant-specific mentor search. * * Args: * request: HTTP request object * org: Tenant/organization key * username: Username of the user making the request * * Returns: * Response: DRF Response object with search results * @returns MentorSearchResponse * @throws ApiError */ public static searchOrgsUsersMentorsRetrieve({ org, username, audience, category, createdBy, featured, id, includeMainPublicMentors = false, limit = 12, llm, offset, orderBy, orderDirection = 'desc', query, tags, tenant, uniqueId, }: { org: string, username: string, /** * Filter by target audience */ audience?: Array, /** * Filter by mentor category */ category?: Array, /** * Filter mentors created by specific user */ createdBy?: string, /** * Filter by featured status */ featured?: boolean, /** * Retrieve a specific mentor by ID */ id?: number, /** * Include public mentors from main tenant */ includeMainPublicMentors?: boolean, /** * Number of results per page */ limit?: number, /** * Filter by language model type */ llm?: Array, /** * Starting position for pagination */ offset?: number, /** * Field to sort results by ('created_at', 'recently_accessed_at') */ orderBy?: string, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Search term to filter mentors by name or description */ query?: string, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Retrieve a specific mentor by UUID */ uniqueId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/orgs/{org}/users/{username}/mentors/', path: { 'org': org, 'username': username, }, query: { 'audience': audience, 'category': category, 'created_by': createdBy, 'featured': featured, 'id': id, 'include_main_public_mentors': includeMainPublicMentors, 'limit': limit, 'llm': llm, 'offset': offset, 'order_by': orderBy, 'order_direction': orderDirection, 'query': query, 'tags': tags, 'tenant': tenant, 'unique_id': uniqueId, }, errors: { 400: `Bad request`, 403: `Forbidden - user does not have access`, 500: `Server error`, }, }); } /** * Search and filter AI prompts for a specific user within a tenant. * * This endpoint extends the base prompt search functionality but filters results * to only show prompts that are available to a specific user within a specific * organization/tenant. * * Path Parameters: * org (str): The organization/tenant identifier * username (str): The username to filter prompts for * * Query Parameters: * Same as PromptSearchView, plus: * * # Identification parameters (for detail view) * id (int, optional): Retrieve a specific prompt by ID * * Returns: * Same format as PromptSearchView, but filtered to only include prompts * that the specified user has access to within the specified organization. * * Error Responses: * 400 Bad Request: If the request parameters are invalid * 403 Forbidden: If the requested prompt exists but the user doesn't have access * 404 Not Found: If the requested prompt doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - Results are filtered based on user's permissions within the organization * - Private prompts are only visible to authorized users * @returns PromptSearchResponse * @throws ApiError */ public static searchOrgsUsersPromptsRetrieve({ org, username, alphabetical = false, category, createdBy, filterFacet, language, limit = 10, mentor, offset, orderDirection = 'desc', query, sortBy, style, tenant, tone, }: { org: string, username: string, /** * Sort alphabetically */ alphabetical?: boolean, /** * Filter by prompt category */ category?: string, /** * Filter prompts created by specific user */ createdBy?: string, /** * If true, return only facets without results */ filterFacet?: boolean, /** * Filter by prompt language */ language?: string, /** * Number of results per page */ limit?: number, /** * Filter by mentor UUID */ mentor?: string, /** * Starting position for pagination */ offset?: number, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Search term to filter prompts by name or content */ query?: string, /** * Field to sort results by */ sortBy?: string, /** * Filter by prompt style */ style?: string, /** * Filter by tenant/organization */ tenant?: string, /** * Filter by prompt tone */ tone?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/orgs/{org}/users/{username}/prompts/', path: { 'org': org, 'username': username, }, query: { 'alphabetical': alphabetical, 'category': category, 'created_by': createdBy, 'filter_facet': filterFacet, 'language': language, 'limit': limit, 'mentor': mentor, 'offset': offset, 'order_direction': orderDirection, 'query': query, 'sort_by': sortBy, 'style': style, 'tenant': tenant, 'tone': tone, }, errors: { 400: `Bad request`, 403: `Forbidden`, 404: `Not found`, 500: `Server error`, }, }); } /** * Determine whether to serve a detail view or a list view. * @returns RecommendedCoursesResponse * @throws ApiError */ public static searchOrgsUsersRecommendedRetrieve({ org, username, certificate, content, courseId, duration, language, level, limit = 12, offset, pathwayId, price, programId, programType, query, resourceId, resourceType, roleId, selfPaced, skillId, skills, subject, tags, tenant, topics, }: { org: string, username: string, /** * Filter by certificate type */ certificate?: Array, /** * Content types to include in recommendations (courses, programs, pathways, skills, roles, resources) */ content?: Array, /** * Retrieve a specific course by ID */ courseId?: string, /** * Filter by course duration range */ duration?: Array, /** * Filter by content language */ language?: Array, /** * Filter by difficulty level */ level?: Array, /** * Number of results per page */ limit?: number, /** * Starting position for pagination */ offset?: number, /** * Retrieve a specific pathway by ID */ pathwayId?: string, /** * Filter by price/audit status */ price?: string, /** * Retrieve a specific program by ID */ programId?: string, /** * Filter by program type */ programType?: Array, /** * Search term to filter content by name or description */ query?: string, /** * Retrieve a specific resource by ID */ resourceId?: string, /** * Filter by resource type */ resourceType?: Array, /** * Retrieve a specific role by ID */ roleId?: string, /** * Filter by course format (self-paced, instructor-led) */ selfPaced?: Array, /** * Retrieve a specific skill by ID */ skillId?: string, /** * Filter by skills */ skills?: Array, /** * Filter by subject areas */ subject?: Array, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Filter by topic areas */ topics?: Array, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/orgs/{org}/users/{username}/recommended/', path: { 'org': org, 'username': username, }, query: { 'certificate': certificate, 'content': content, 'course_id': courseId, 'duration': duration, 'language': language, 'level': level, 'limit': limit, 'offset': offset, 'pathway_id': pathwayId, 'price': price, 'program_id': programId, 'program_type': programType, 'query': query, 'resource_id': resourceId, 'resource_type': resourceType, 'role_id': roleId, 'self_paced': selfPaced, 'skill_id': skillId, 'skills': skills, 'subject': subject, 'tags': tags, 'tenant': tenant, 'topics': topics, }, errors: { 400: `Bad request`, 404: `User not found`, 500: `Server error`, }, }); } /** * Determine whether to serve a detail view or a list view. * If any detail-identifying parameters are present (course_id, program_id, etc.) * the detail view is returned; otherwise the aggregated list view is returned. * @returns any * @throws ApiError */ public static searchPersonalizedCatalogRetrieve({ username, allowSkillSearch = false, alphabetical = false, certificate, content, courseId, duration, language, level, limit = 12, offset, orderAscending = false, orderBy, pathwayId, price, programId, programType, promotion, query, recommended = false, resourceId, resourceType, returnFacet = true, returnItems = false, roleId, selfPaced, skillId, skills, subject, tags, tenant, topics, updateFacet, }: { username: string, /** * Enable skill-based search */ allowSkillSearch?: boolean, /** * Sort alphabetically by name */ alphabetical?: boolean, /** * Filter by certificate type */ certificate?: Array, /** * Content types to include in results */ content?: Array, /** * Retrieve a specific course by ID */ courseId?: string, /** * Filter by course duration range */ duration?: Array, /** * Filter by content language */ language?: Array, /** * Filter by difficulty level */ level?: Array, /** * Number of results per page */ limit?: number, /** * Starting position for pagination */ offset?: number, /** * Sort direction */ orderAscending?: boolean, /** * Field to sort results by */ orderBy?: string, /** * Retrieve a specific pathway by ID */ pathwayId?: string, /** * Filter by price/audit status */ price?: string, /** * Retrieve a specific program by ID */ programId?: string, /** * Filter by program type */ programType?: Array, /** * Filter by promotion status */ promotion?: Array, /** * Search term to filter content by name or description */ query?: string, /** * Show only recommended content */ recommended?: boolean, /** * Retrieve a specific resource by ID */ resourceId?: string, /** * Filter by resource type */ resourceType?: Array, /** * Include facet data in response */ returnFacet?: boolean, /** * Include items in programs/pathways */ returnItems?: boolean, /** * Retrieve a specific role by ID */ roleId?: string, /** * Filter by course format */ selfPaced?: Array, /** * Retrieve a specific skill by ID */ skillId?: string, /** * Filter by skills */ skills?: Array, /** * Filter by subject areas */ subject?: Array, /** * Filter by tags */ tags?: Array, /** * Filter by tenant/organization */ tenant?: string, /** * Filter by topic areas */ topics?: Array, /** * Force facet update */ updateFacet?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/search/personalized-catalog/{username}/', path: { 'username': username, }, query: { 'allow_skill_search': allowSkillSearch, 'alphabetical': alphabetical, 'certificate': certificate, 'content': content, 'course_id': courseId, 'duration': duration, 'language': language, 'level': level, 'limit': limit, 'offset': offset, 'order_ascending': orderAscending, 'order_by': orderBy, 'pathway_id': pathwayId, 'price': price, 'program_id': programId, 'program_type': programType, 'promotion': promotion, 'query': query, 'recommended': recommended, 'resource_id': resourceId, 'resource_type': resourceType, 'return_facet': returnFacet, 'return_items': returnItems, 'role_id': roleId, 'self_paced': selfPaced, 'skill_id': skillId, 'skills': skills, 'subject': subject, 'tags': tags, 'tenant': tenant, 'topics': topics, 'update_facet': updateFacet, }, }); } /** * Search and filter AI prompts across the platform. * * This endpoint provides a search interface for discovering AI prompts * with support for filtering, pagination, and detailed prompt information. * * Query Parameters: * # Identification parameters (for detail view) * id (int, optional): Retrieve a specific prompt by ID * * # Search and filtering parameters * query (str, optional): Search term to filter prompts by name or content * category (str, optional): Filter by prompt category * language (str, optional): Filter by prompt language * style (str, optional): Filter by writing style * tone (str, optional): Filter by tone * tenant (str, optional): Filter by tenant/organization * mentor (str, optional): Filter by associated mentor (UUID) * * # Sorting and pagination * sort_by (str, optional): Field to sort results by * order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc') * alphabetical (bool, optional): Sort alphabetically by name (default: false) * limit (int, optional): Number of results per page (default: 10) * offset (int, optional): Starting position for pagination * * # Special parameters * filter_facet (any, optional): If present, return only facets without results * * Returns: * For detail view (when id is provided): * A JSON response containing a single prompt's details: * { * "id": 456, * "name": "Essay Writing Guide", * "content": "Write a well-structured essay on the following topic: {{topic}}...", * "category": "Academic Writing", * "language": "English", * "style": "Formal", * "tone": "Professional", * "mentor": { * "id": 123, * "unique_id": "550e8400-e29b-41d4-a716-446655440000", * "name": "Professor Smith" * }, * "platform": { * "id": 1, * "name": "Example University", * "key": "example-university" * }, * "created_at": "2023-02-10T09:15:00Z", * "updated_at": "2023-05-05T14:20:00Z", * "visibility": "public", * "variables": ["topic", "length", "style"] * } * * For list view: * A JSON response containing: * { * "results": [ * { * "id": 456, * "name": "Essay Writing Guide", * "content": "Write a well-structured essay on the following topic: {{topic}}...", * "category": "Academic Writing", * "language": "English", * "style": "Formal", * "tone": "Professional", * "mentor": {"id": 123, "name": "Professor Smith"}, * "created_at": "2023-02-10T09:15:00Z", * "updated_at": "2023-05-05T14:20:00Z" * }, * // Additional prompt objects... * ], * "count": 30, * "next": "?limit=10&offset=10", * "previous": null, * "current_page": 1, * "num_pages": 3, * "facets": { * "category": [ * {"key": "Academic Writing", "doc_count": 15}, * {"key": "Creative Writing", "doc_count": 10}, * {"key": "Technical Documentation", "doc_count": 5} * ], * "language": [ * {"key": "English", "doc_count": 25}, * {"key": "Spanish", "doc_count": 5} * ], * "style": [ * {"key": "Formal", "doc_count": 20}, * {"key": "Casual", "doc_count": 10} * ], * "tone": [ * {"key": "Professional", "doc_count": 15}, * {"key": "Friendly", "doc_count": 10}, * {"key": "Technical", "doc_count": 5} * ] * } * } * * Error Responses: * 400 Bad Request: If the request parameters are invalid * 403 Forbidden: If the requested prompt exists but is not publicly available * 404 Not Found: If the requested prompt doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Notes: * - Only publicly available prompts are returned by default * - When filtering by mentor, the mentor ID must be a valid UUID * @returns PromptSearchResponse * @throws ApiError */ public static searchPromptsRetrieve({ alphabetical = false, category, createdBy, filterFacet, language, limit = 10, mentor, offset, orderDirection = 'desc', query, sortBy, style, tenant, tone, }: { /** * Sort alphabetically */ alphabetical?: boolean, /** * Filter by prompt category */ category?: string, /** * Filter prompts created by specific user */ createdBy?: string, /** * If true, return only facets without results */ filterFacet?: boolean, /** * Filter by prompt language */ language?: string, /** * Number of results per page */ limit?: number, /** * Filter by mentor UUID */ mentor?: string, /** * Starting position for pagination */ offset?: number, /** * Sort direction ('asc' or 'desc') */ orderDirection?: string, /** * Search term to filter prompts by name or content */ query?: string, /** * Field to sort results by */ sortBy?: string, /** * Filter by prompt style */ style?: string, /** * Filter by tenant/organization */ tenant?: string, /** * Filter by prompt tone */ tone?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/prompts/', query: { 'alphabetical': alphabetical, 'category': category, 'created_by': createdBy, 'filter_facet': filterFacet, 'language': language, 'limit': limit, 'mentor': mentor, 'offset': offset, 'order_direction': orderDirection, 'query': query, 'sort_by': sortBy, 'style': style, 'tenant': tenant, 'tone': tone, }, errors: { 400: `Bad request`, 500: `Server error`, }, }); } /** * Search and filter users within a specific organization/tenant. * * This endpoint provides a search interface for discovering users within an organization, * with support for filtering by departments, pagination, and faceted filtering. * * Path Parameters: * org (str): The organization/tenant identifier * username (str): The username of the user making the request * * Query Parameters: * # Search parameters * query (str, optional): Search term to filter users by name, username, or email * * # Department filtering * department_mode (bool, optional): Enable department-based filtering (default: false) * user_department (bool, optional): Legacy parameter for department_mode (default: false) * department (list, optional): Filter by specific departments * * # Additional filters * role (list, optional): Filter by user role * status (list, optional): Filter by user status (active, inactive) * joined_date (list, optional): Filter by join date range * last_login (list, optional): Filter by last login date range * * # Pagination * limit (int, optional): Number of results per page (default: 10) * offset (int, optional): Starting position for pagination * * Returns: * A JSON response containing: * ``` * { * "results": [ * { * "id": 123, * "username": "john.doe", * "email": "john.doe@example.com", * "first_name": "John", * "last_name": "Doe", * "full_name": "John Doe", * "profile_image": "https://example.com/profiles/john-doe.jpg", * "role": "Student", * "departments": ["Computer Science", "Data Science"], * "status": "active", * "joined_date": "2023-01-15T12:00:00Z", * "last_login": "2023-06-20T15:30:00Z", * "metadata": { * "location": "New York", * "title": "Software Engineer", * "bio": "Experienced software engineer with a passion for education" * } * }, * // Additional user objects... * ], * "count": 50, * "next": "https://api.example.com/api/search/users/example-org/admin/?limit=10&offset=10", * "previous": null, * "current_page": 1, * "total_pages": 5, * "facets": { * "role": [ * {"key": "Student", "doc_count": 30}, * {"key": "Instructor", "doc_count": 15}, * {"key": "Admin", "doc_count": 5} * ], * "department": [ * {"key": "Computer Science", "doc_count": 20}, * {"key": "Data Science", "doc_count": 15}, * {"key": "Business", "doc_count": 10}, * {"key": "Engineering", "doc_count": 5} * ], * "status": [ * {"key": "active", "doc_count": 45}, * {"key": "inactive", "doc_count": 5} * ] * } * } * ``` * Error Responses: * 400 Bad Request: If the request parameters are invalid * 403 Forbidden: If the user doesn't have department admin privileges (when using department_mode) * 404 Not Found: If the user or organization doesn't exist * 500 Internal Server Error: If an unexpected error occurs * * Access Control: * - The requesting user must have an active account in the specified organization * - When department_mode is enabled, the user must be an admin of at least one department * - Department filtering restricts results to users in departments where the requesting user is an admin * @returns UserSearchResponse * @throws ApiError */ public static searchUsersOrgsUsersRetrieve({ org, username, department, educationDegree, educationFieldOfStudy, educationInstitution, includeMembershipData = false, limit = 10, offset, q, userResumeCompany, userResumeIndustry, userResumeJobTitle, userResumeLocation, userResumeSkills, }: { org: string, username: string, /** * Filter by department names */ department?: Array, /** * Filter by degree */ educationDegree?: string, /** * Filter by field of study */ educationFieldOfStudy?: string, /** * Filter by institution */ educationInstitution?: string, /** * Include user group membership data in results */ includeMembershipData?: boolean, /** * Number of results per page */ limit?: number, /** * Starting position for pagination */ offset?: number, /** * Search term to filter users by name, email, or other attributes */ q?: string, /** * Filter by company */ userResumeCompany?: string, /** * Filter by industry */ userResumeIndustry?: string, /** * Filter by job title */ userResumeJobTitle?: string, /** * Filter by location */ userResumeLocation?: string, /** * Filter by skills */ userResumeSkills?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/search/users/orgs/{org}/users/{username}/', path: { 'org': org, 'username': username, }, query: { 'department': department, 'education__degree': educationDegree, 'education__field_of_study': educationFieldOfStudy, 'education__institution': educationInstitution, 'include_membership_data': includeMembershipData, 'limit': limit, 'offset': offset, 'q': q, 'user_resume__company': userResumeCompany, 'user_resume__industry': userResumeIndustry, 'user_resume__job_title': userResumeJobTitle, 'user_resume__location': userResumeLocation, 'user_resume__skills': userResumeSkills, }, errors: { 400: `Bad request`, 403: `Forbidden`, 404: `Not found`, 500: `Server error`, }, }); } }