/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { AccessibleMentorsByEmailRequest } from '../models/AccessibleMentorsByEmailRequest'; import type { AccessibleMentorsByEmailResponse } from '../models/AccessibleMentorsByEmailResponse'; import type { AddMentorToDisclaimer } from '../models/AddMentorToDisclaimer'; import type { AgentSkill } from '../models/AgentSkill'; import type { AgentSkillResource } from '../models/AgentSkillResource'; import type { AIGeneratedImage } from '../models/AIGeneratedImage'; import type { AIUserProfileMemoryRelation } from '../models/AIUserProfileMemoryRelation'; import type { AIUserProfileRequest } from '../models/AIUserProfileRequest'; import type { Artifact } from '../models/Artifact'; import type { ArtifactVersion } from '../models/ArtifactVersion'; import type { AssumedKnowledge } from '../models/AssumedKnowledge'; import type { AudioToTextRequest } from '../models/AudioToTextRequest'; import type { AudioToTextResponse } from '../models/AudioToTextResponse'; import type { CallAuthenticationRequest } from '../models/CallAuthenticationRequest'; import type { CallAuthenticationResponse } from '../models/CallAuthenticationResponse'; import type { CallConfiguration } from '../models/CallConfiguration'; import type { ChatCompletionRequest } from '../models/ChatCompletionRequest'; import type { ChatHistoryItem } from '../models/ChatHistoryItem'; import type { ChatHistorySessionId } from '../models/ChatHistorySessionId'; import type { ChatRunTracker } from '../models/ChatRunTracker'; import type { ChatSessionRequest } from '../models/ChatSessionRequest'; import type { ChatSessionResponse } from '../models/ChatSessionResponse'; import type { ClawConfigGetResponse } from '../models/ClawConfigGetResponse'; import type { ClawInstance } from '../models/ClawInstance'; import type { ClawMentorConfig } from '../models/ClawMentorConfig'; import type { ClawModelProvider } from '../models/ClawModelProvider'; import type { CourseCreationTask } from '../models/CourseCreationTask'; import type { CourseCreationTaskFile } from '../models/CourseCreationTaskFile'; import type { CreateXblock } from '../models/CreateXblock'; import type { CronJobCreate } from '../models/CronJobCreate'; import type { CronJobListResponse } from '../models/CronJobListResponse'; import type { CronJobResponse } from '../models/CronJobResponse'; import type { CronRunAction } from '../models/CronRunAction'; import type { CronRunResult } from '../models/CronRunResult'; import type { CronRunsResponse } from '../models/CronRunsResponse'; import type { CronStatusResponse } from '../models/CronStatusResponse'; import type { CustomInstructionResponse } from '../models/CustomInstructionResponse'; import type { Dataset } from '../models/Dataset'; import type { DatasetCreate } from '../models/DatasetCreate'; import type { DatasetItem } from '../models/DatasetItem'; import type { DatasetItemBulkCreateResponse } from '../models/DatasetItemBulkCreateResponse'; import type { DatasetItemCreate } from '../models/DatasetItemCreate'; import type { DatasetItemUpdate } from '../models/DatasetItemUpdate'; import type { DeleteXblock } from '../models/DeleteXblock'; import type { Disclaimer } from '../models/Disclaimer'; import type { DisclaimerAgreement } from '../models/DisclaimerAgreement'; import type { DomainAttach } from '../models/DomainAttach'; import type { EdxCourse } from '../models/EdxCourse'; import type { ElevenlabsCustomVoice } from '../models/ElevenlabsCustomVoice'; import type { ElevenlabsCustomVoiceResponse } from '../models/ElevenlabsCustomVoiceResponse'; import type { EmailPromptDetail } from '../models/EmailPromptDetail'; import type { EmailPromptSummary } from '../models/EmailPromptSummary'; import type { ExperimentCreate } from '../models/ExperimentCreate'; import type { FileUploadURLRequest } from '../models/FileUploadURLRequest'; import type { FileUploadURLResponse } from '../models/FileUploadURLResponse'; import type { FreeUsageCount } from '../models/FreeUsageCount'; import type { GoogleAgentDetail } from '../models/GoogleAgentDetail'; import type { GraderCriterion } from '../models/GraderCriterion'; import type { GradeResultDetail } from '../models/GradeResultDetail'; import type { GrantMentorAccessRequest } from '../models/GrantMentorAccessRequest'; import type { HeygenAvatarCreate } from '../models/HeygenAvatarCreate'; import type { HeygenStreamingSession } from '../models/HeygenStreamingSession'; import type { HeygenStreamingTask } from '../models/HeygenStreamingTask'; import type { HeygenTtsPreview } from '../models/HeygenTtsPreview'; import type { HeygenVideoCreate } from '../models/HeygenVideoCreate'; import type { HeygenVoiceClone } from '../models/HeygenVoiceClone'; import type { HostingProject } from '../models/HostingProject'; import type { HumanSupportTicket } from '../models/HumanSupportTicket'; import type { JobRun } from '../models/JobRun'; import type { JudgeRecord } from '../models/JudgeRecord'; import type { LinkCourseRequest } from '../models/LinkCourseRequest'; import type { LinkCourseResponse } from '../models/LinkCourseResponse'; import type { LLMJudge } from '../models/LLMJudge'; import type { LLMModelForTenant } from '../models/LLMModelForTenant'; import type { LLMResponse } from '../models/LLMResponse'; import type { MCPServer } from '../models/MCPServer'; import type { MCPServerConnection } from '../models/MCPServerConnection'; import type { McpServerCreate } from '../models/McpServerCreate'; import type { McpServerEntry } from '../models/McpServerEntry'; import type { McpServerListResponse } from '../models/McpServerListResponse'; import type { MCPServerOauthFind } from '../models/MCPServerOauthFind'; import type { MemoryComponentMemoryDetail } from '../models/MemoryComponentMemoryDetail'; import type { MemoryComponentResponse } from '../models/MemoryComponentResponse'; import type { MemoryProgress } from '../models/MemoryProgress'; import type { Mentor } from '../models/Mentor'; import type { MentorAudience } from '../models/MentorAudience'; import type { MentorCategory } from '../models/MentorCategory'; import type { MentorCategoryCreate } from '../models/MentorCategoryCreate'; import type { MentorCategoryGroup } from '../models/MentorCategoryGroup'; import type { MentorCategoryGroupCreate } from '../models/MentorCategoryGroupCreate'; import type { MentorCreate } from '../models/MentorCreate'; import type { MentorCustomVoice } from '../models/MentorCustomVoice'; import type { MentorCustomVoiceResponse } from '../models/MentorCustomVoiceResponse'; import type { MentorEval } from '../models/MentorEval'; import type { MentorEvalReport } from '../models/MentorEvalReport'; import type { MentorEvalRequest } from '../models/MentorEvalRequest'; import type { MentorFork } from '../models/MentorFork'; import type { MentorFromTemplate } from '../models/MentorFromTemplate'; import type { MentorFromTemplateWithSettingRequest } from '../models/MentorFromTemplateWithSettingRequest'; import type { MentorGraderConfig } from '../models/MentorGraderConfig'; import type { MentorMemorySettingsRequest } from '../models/MentorMemorySettingsRequest'; import type { MentorMemorySettingsResponse } from '../models/MentorMemorySettingsResponse'; import type { MentorMetadata } from '../models/MentorMetadata'; import type { MentorScenario } from '../models/MentorScenario'; import type { MentorSettings } from '../models/MentorSettings'; import type { MentorSettingsPublic } from '../models/MentorSettingsPublic'; import type { MentorSettingsRequest } from '../models/MentorSettingsRequest'; import type { MentorSkillAssignment } from '../models/MentorSkillAssignment'; import type { MentorSummary } from '../models/MentorSummary'; import type { MentorType } from '../models/MentorType'; import type { MentorUserSetting } from '../models/MentorUserSetting'; import type { MentorWizard } from '../models/MentorWizard'; import type { MessageView } from '../models/MessageView'; import type { MessageViewRequest } from '../models/MessageViewRequest'; import type { MessageViewUpdatResponse } from '../models/MessageViewUpdatResponse'; import type { ModerationLog } from '../models/ModerationLog'; import type { OAuthService } from '../models/OAuthService'; import type { PaginatedAgentSkillList } from '../models/PaginatedAgentSkillList'; import type { PaginatedAgentSkillResourceList } from '../models/PaginatedAgentSkillResourceList'; import type { PaginatedAIGeneratedImageList } from '../models/PaginatedAIGeneratedImageList'; import type { PaginatedArtifactListList } from '../models/PaginatedArtifactListList'; import type { PaginatedArtifactVersionList } from '../models/PaginatedArtifactVersionList'; import type { PaginatedChatRunTrackerList } from '../models/PaginatedChatRunTrackerList'; import type { PaginatedClawInstanceList } from '../models/PaginatedClawInstanceList'; import type { PaginatedClawModelProviderList } from '../models/PaginatedClawModelProviderList'; import type { PaginatedCourseCreationTaskFileList } from '../models/PaginatedCourseCreationTaskFileList'; import type { PaginatedCourseCreationTaskList } from '../models/PaginatedCourseCreationTaskList'; import type { PaginatedDatasetItemList } from '../models/PaginatedDatasetItemList'; import type { PaginatedDatasetList } from '../models/PaginatedDatasetList'; import type { PaginatedDisclaimerAgreementList } from '../models/PaginatedDisclaimerAgreementList'; import type { PaginatedDisclaimerList } from '../models/PaginatedDisclaimerList'; import type { PaginatedEdxCourseList } from '../models/PaginatedEdxCourseList'; import type { PaginatedEmailPromptListList } from '../models/PaginatedEmailPromptListList'; import type { PaginatedGoogleAgentDetailList } from '../models/PaginatedGoogleAgentDetailList'; import type { PaginatedGraderCriterionList } from '../models/PaginatedGraderCriterionList'; import type { PaginatedGradeResultList } from '../models/PaginatedGradeResultList'; import type { PaginatedHumanSupportTicketList } from '../models/PaginatedHumanSupportTicketList'; import type { PaginatedJobRunList } from '../models/PaginatedJobRunList'; import type { PaginatedJudgeList } from '../models/PaginatedJudgeList'; import type { PaginatedMCPServerConnectionList } from '../models/PaginatedMCPServerConnectionList'; import type { PaginatedMCPServerList } from '../models/PaginatedMCPServerList'; import type { PaginatedMentorAuditLogEntryList } from '../models/PaginatedMentorAuditLogEntryList'; import type { PaginatedMentorList } from '../models/PaginatedMentorList'; import type { PaginatedMentorSkillAssignmentList } from '../models/PaginatedMentorSkillAssignmentList'; import type { PaginatedModerationLogList } from '../models/PaginatedModerationLogList'; import type { PaginatedOfflineDocumentList } from '../models/PaginatedOfflineDocumentList'; import type { PaginatedPeriodicAgentList } from '../models/PaginatedPeriodicAgentList'; import type { PaginatedPeriodicAgentLogList } from '../models/PaginatedPeriodicAgentLogList'; import type { PaginatedPlayWrightScriptList } from '../models/PaginatedPlayWrightScriptList'; import type { PaginatedProjectList } from '../models/PaginatedProjectList'; import type { PaginatedRunList } from '../models/PaginatedRunList'; import type { PaginatedScoreConfigList } from '../models/PaginatedScoreConfigList'; import type { PaginatedScoreList } from '../models/PaginatedScoreList'; import type { PaginatedTicketMessageList } from '../models/PaginatedTicketMessageList'; import type { PaginatedUserEdxMemoryList } from '../models/PaginatedUserEdxMemoryList'; import type { PaginatedVoiceList } from '../models/PaginatedVoiceList'; import type { PaginatedWorkflowList } from '../models/PaginatedWorkflowList'; import type { PatchedAgentSkill } from '../models/PatchedAgentSkill'; import type { PatchedAgentSkillResource } from '../models/PatchedAgentSkillResource'; import type { PatchedArtifact } from '../models/PatchedArtifact'; import type { PatchedCallConfiguration } from '../models/PatchedCallConfiguration'; import type { PatchedClawConfigPatchRequest } from '../models/PatchedClawConfigPatchRequest'; import type { PatchedClawInstance } from '../models/PatchedClawInstance'; import type { PatchedClawMentorConfig } from '../models/PatchedClawMentorConfig'; import type { PatchedClawModelProvider } from '../models/PatchedClawModelProvider'; import type { PatchedCourseCreationTaskFile } from '../models/PatchedCourseCreationTaskFile'; import type { PatchedCronJobPatch } from '../models/PatchedCronJobPatch'; import type { PatchedDisclaimer } from '../models/PatchedDisclaimer'; import type { PatchedGoogleAgentDetail } from '../models/PatchedGoogleAgentDetail'; import type { PatchedGraderCriterion } from '../models/PatchedGraderCriterion'; import type { PatchedGradeResultOverride } from '../models/PatchedGradeResultOverride'; import type { PatchedHumanSupportTicket } from '../models/PatchedHumanSupportTicket'; import type { PatchedMCPServer } from '../models/PatchedMCPServer'; import type { PatchedMCPServerConnection } from '../models/PatchedMCPServerConnection'; import type { PatchedMcpServerUpdate } from '../models/PatchedMcpServerUpdate'; import type { PatchedMentorCategoryGroupCreate } from '../models/PatchedMentorCategoryGroupCreate'; import type { PatchedMentorCreate } from '../models/PatchedMentorCreate'; import type { PatchedMentorFromTemplate } from '../models/PatchedMentorFromTemplate'; import type { PatchedMentorGraderConfig } from '../models/PatchedMentorGraderConfig'; import type { PatchedMentorSettings } from '../models/PatchedMentorSettings'; import type { PatchedMentorSkillAssignment } from '../models/PatchedMentorSkillAssignment'; import type { PatchedMentorWizard } from '../models/PatchedMentorWizard'; import type { PatchedPeriodicAgentCreate } from '../models/PatchedPeriodicAgentCreate'; import type { PatchedPlayWrightScript } from '../models/PatchedPlayWrightScript'; import type { PatchedProject } from '../models/PatchedProject'; import type { PatchedSeedMentorsView } from '../models/PatchedSeedMentorsView'; import type { PatchedTicketMessage } from '../models/PatchedTicketMessage'; import type { PatchedWorkflow } from '../models/PatchedWorkflow'; import type { PeriodicAgent } from '../models/PeriodicAgent'; import type { PeriodicAgentCreate } from '../models/PeriodicAgentCreate'; import type { PeriodicAgentLog } from '../models/PeriodicAgentLog'; import type { PeriodicAgentStatistics } from '../models/PeriodicAgentStatistics'; import type { PinnedMessageCreate } from '../models/PinnedMessageCreate'; import type { PinnedMessageRequest } from '../models/PinnedMessageRequest'; import type { PlayWrightScript } from '../models/PlayWrightScript'; import type { PredictiveAnalyticsRequest } from '../models/PredictiveAnalyticsRequest'; import type { PredictiveAnalyticsResponse } from '../models/PredictiveAnalyticsResponse'; import type { Project } from '../models/Project'; import type { QuestionCardTag } from '../models/QuestionCardTag'; import type { QuestionRequest } from '../models/QuestionRequest'; import type { QuestionResponse } from '../models/QuestionResponse'; import type { RecentlyAccessedMentor } from '../models/RecentlyAccessedMentor'; import type { RelatedText } from '../models/RelatedText'; import type { RemoveMentorFromDisclaimer } from '../models/RemoveMentorFromDisclaimer'; import type { ReorderChildren } from '../models/ReorderChildren'; import type { RetrieveTask } from '../models/RetrieveTask'; import type { Run } from '../models/Run'; import type { RunDetailResponse } from '../models/RunDetailResponse'; import type { RunMentorEval } from '../models/RunMentorEval'; import type { ScoreConfig } from '../models/ScoreConfig'; import type { ScoreConfigCreate } from '../models/ScoreConfigCreate'; import type { ScoreCreate } from '../models/ScoreCreate'; import type { ScoreCreateResponse } from '../models/ScoreCreateResponse'; import type { SeedMentorsView } from '../models/SeedMentorsView'; import type { SessionBrowserScreenshot } from '../models/SessionBrowserScreenshot'; import type { SessionDetail } from '../models/SessionDetail'; import type { SessionDisableChathistoryRequest } from '../models/SessionDisableChathistoryRequest'; import type { SessionDisableChathistoryResponse } from '../models/SessionDisableChathistoryResponse'; import type { SessionMemoryStorage } from '../models/SessionMemoryStorage'; import type { SessionSummary } from '../models/SessionSummary'; import type { SetCurrentVersionRequest } from '../models/SetCurrentVersionRequest'; import type { ShareableMentorLink } from '../models/ShareableMentorLink'; import type { SharedSessionUpdateRequest } from '../models/SharedSessionUpdateRequest'; import type { SharedSessionUpdateResponse } from '../models/SharedSessionUpdateResponse'; import type { SharedSystemPromptRequest } from '../models/SharedSystemPromptRequest'; import type { SharedSystemPromptResponse } from '../models/SharedSystemPromptResponse'; import type { ShellLogs } from '../models/ShellLogs'; import type { SpacedRepetitionLearningPath } from '../models/SpacedRepetitionLearningPath'; import type { SpacedRepetitionQuestionStats } from '../models/SpacedRepetitionQuestionStats'; import type { SpendCap } from '../models/SpendCap'; import type { SpendCapStatusSummary } from '../models/SpendCapStatusSummary'; import type { StarMentor } from '../models/StarMentor'; import type { StopGenerationRequest } from '../models/StopGenerationRequest'; import type { StripeCheckoutSessionCreate } from '../models/StripeCheckoutSessionCreate'; import type { StripeCustomerCreate } from '../models/StripeCustomerCreate'; import type { StripePaymentLinkCreate } from '../models/StripePaymentLinkCreate'; import type { StripePaywallAccessResponse } from '../models/StripePaywallAccessResponse'; import type { StripePaywallCheckout } from '../models/StripePaywallCheckout'; import type { StripePaywallCheckoutResponse } from '../models/StripePaywallCheckoutResponse'; import type { StripePriceCreate } from '../models/StripePriceCreate'; import type { StripeProductCreate } from '../models/StripeProductCreate'; import type { Subject } from '../models/Subject'; import type { TaskView } from '../models/TaskView'; import type { TemplateMentor } from '../models/TemplateMentor'; import type { TicketMessage } from '../models/TicketMessage'; import type { ToolCategory } from '../models/ToolCategory'; import type { ToolResponse } from '../models/ToolResponse'; import type { TriggerRequest } from '../models/TriggerRequest'; import type { TriggerResponse } from '../models/TriggerResponse'; import type { UpdateXblock } from '../models/UpdateXblock'; import type { UserChatFeedback } from '../models/UserChatFeedback'; import type { UserDefaultMentor } from '../models/UserDefaultMentor'; import type { UserEdxMemory } from '../models/UserEdxMemory'; import type { VectorResult } from '../models/VectorResult'; import type { Voice } from '../models/Voice'; import type { WakeRequest } from '../models/WakeRequest'; import type { WakeResponse } from '../models/WakeResponse'; import type { WebResource } from '../models/WebResource'; import type { WebResourcesQuery } from '../models/WebResourcesQuery'; import type { Workflow } from '../models/Workflow'; import type { XblockResult } from '../models/XblockResult'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class AiMentorService { /** * Public health endpoint for external monitoring (Pingdom, uptime checks). * * Scoped to managed workers (the infrastructure we operate): returns 500 when a managed, * non-inactive worker is in error OR its stored TLS certificate is within the near-expiry * threshold; 200 otherwise. Near-expiry is computed at read time and never stored as an error, * so it cannot block student routing. Self-hosted workers are the tenant's infrastructure and * do not drive this alert. Pure DB read, no external calls. * @returns any No response body * @throws ApiError */ public static aiMentorClawHealthRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/claw/health/', }); } /** * Detailed health dashboard for DM admins. * * Returns health status for all Claw instances across all orgs, * including instance details and enabled mentor counts. * @returns any No response body * @throws ApiError */ public static aiMentorClawHealthDetailRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/claw/health/detail/', }); } /** * Health check for the end-to-end cost -> billing pipeline. * * Unlike :class:`LangfuseHealthView` (which only proxies Langfuse's web health * endpoint), this verifies the *whole* money path in three independent stages so * a failure pinpoints exactly where cost stopped flowing toward billing: * * * ``ingestion`` -- fake-mentor probe cost reached the raw ClickHouse * ``traces``/``observations`` tables (probe chat -> Langfuse callback -> SDK * flush -> ingestion worker -> ClickHouse write -> model-price computation). * * ``rollup`` -- that cost propagated into ``mv_user_platform_total``, the view * the credit system actually reconciles against. Raw ingestion can be healthy * while the rollup is frozen, which would silently halt billing; this stage is * what catches that gap. * * ``deduction`` -- the real reconciliation path deducts credits for that usage, * exercised against the health user's account inside a rolled-back transaction * (no persistence, no charge). * * Cost ingestion is asynchronous and eventually consistent, so the ingestion * stage aggregates over a recent window (default 10 minutes). The stages rely on * the fake-mentor uptime probes (:class:`AIMentorHealthView`) chatting as the * configured ``LANGFUSE_COST_HEALTH_USERNAME`` so their cost is attributable in * the rollup and to that user's credit account. * * Requires ``ENABLE_LANGFUSE_FOR_FAKE_MENTORS`` enabled, the ``fake-llm-model`` * price registered (``register_langfuse_health_model``), and the health user's * credit account provisioned (``setup_langfuse_cost_health``). All three stages always * run so a healthy result proves the entire path, not a configurable subset. * * Returns: * HTTP 200: every enabled stage healthy. * HTTP 503: any stage failed (per-stage breakdown in the body). * @returns any No response body * @throws ApiError */ public static aiMentorLangfuseCostHealthRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/langfuse/cost/health/', }); } /** * Proxy endpoint to check for langfuse health status * @returns any No response body * @throws ApiError */ public static aiMentorLangfuseHealthRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/langfuse/health/', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns PaginatedAgentSkillResourceList * @throws ApiError */ public static aiMentorOrgsAgentSkillResourcesList({ org, fileType, limit, offset, skill, }: { org: string, /** * * `script` - Script * * `reference` - Reference * * `asset` - Asset */ fileType?: 'asset' | 'reference' | 'script', /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, skill?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agent-skill-resources/', path: { 'org': org, }, query: { 'file_type': fileType, 'limit': limit, 'offset': offset, 'skill': skill, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkillResource * @throws ApiError */ public static aiMentorOrgsAgentSkillResourcesCreate({ org, requestBody, }: { org: string, requestBody: AgentSkillResource, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agent-skill-resources/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkillResource * @throws ApiError */ public static aiMentorOrgsAgentSkillResourcesRetrieve({ id, org, }: { /** * A unique integer value identifying this Agent skill resource. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agent-skill-resources/{id}/', path: { 'id': id, 'org': org, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkillResource * @throws ApiError */ public static aiMentorOrgsAgentSkillResourcesUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Agent skill resource. */ id: number, org: string, requestBody: AgentSkillResource, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agent-skill-resources/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkillResource * @throws ApiError */ public static aiMentorOrgsAgentSkillResourcesPartialUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Agent skill resource. */ id: number, org: string, requestBody?: PatchedAgentSkillResource, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agent-skill-resources/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns void * @throws ApiError */ public static aiMentorOrgsAgentSkillResourcesDestroy({ id, org, }: { /** * A unique integer value identifying this Agent skill resource. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agent-skill-resources/{id}/', path: { 'id': id, 'org': org, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns PaginatedAgentSkillList * @throws ApiError */ public static aiMentorOrgsAgentSkillsList({ org, enabled, limit, offset, search, }: { org: string, enabled?: boolean, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agent-skills/', path: { 'org': org, }, query: { 'enabled': enabled, 'limit': limit, 'offset': offset, 'search': search, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkill * @throws ApiError */ public static aiMentorOrgsAgentSkillsCreate({ org, requestBody, }: { org: string, requestBody: AgentSkill, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agent-skills/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkill * @throws ApiError */ public static aiMentorOrgsAgentSkillsRetrieve({ id, org, }: { /** * A unique integer value identifying this Agent skill. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agent-skills/{id}/', path: { 'id': id, 'org': org, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkill * @throws ApiError */ public static aiMentorOrgsAgentSkillsUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Agent skill. */ id: number, org: string, requestBody: AgentSkill, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agent-skills/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns AgentSkill * @throws ApiError */ public static aiMentorOrgsAgentSkillsPartialUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Agent skill. */ id: number, org: string, requestBody?: PatchedAgentSkill, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agent-skills/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns void * @throws ApiError */ public static aiMentorOrgsAgentSkillsDestroy({ id, org, }: { /** * A unique integer value identifying this Agent skill. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agent-skills/{id}/', path: { 'id': id, 'org': org, }, }); } /** * List all active memory categories for a mentor. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsAgentsMemoryCategoriesRetrieve({ mentorId, org, }: { mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/', path: { 'mentor_id': mentorId, 'org': org, }, }); } /** * Create a new memory category. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsAgentsMemoryCategoriesCreate({ mentorId, org, }: { mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/', path: { 'mentor_id': mentorId, 'org': org, }, }); } /** * Update a memory category. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsAgentsMemoryCategoriesPartialUpdate({ categoryId, mentorId, org, }: { categoryId: number, mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/', path: { 'category_id': categoryId, 'mentor_id': mentorId, 'org': org, }, }); } /** * Deactivate a memory category. * @returns void * @throws ApiError */ public static aiMentorOrgsAgentsMemoryCategoriesDestroy({ categoryId, mentorId, org, }: { categoryId: number, mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/', path: { 'category_id': categoryId, 'mentor_id': mentorId, 'org': org, }, }); } /** * Singular AgentConfig nested under a mentor. GET + PATCH only. * * AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has * never had a ClawMentorConfig, PATCH will create the AgentConfig on first * write via get_or_create. DELETE is not supported (the row would be * immediately recreated by a subsequent ClawMentorConfig.save). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsAgentsAgentConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * Singular AgentConfig nested under a mentor. GET + PATCH only. * * AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has * never had a ClawMentorConfig, PATCH will create the AgentConfig on first * write via get_or_create. DELETE is not supported (the row would be * immediately recreated by a subsequent ClawMentorConfig.save). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsAgentsAgentConfigPartialUpdate({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsAgentsClawConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsAgentsClawConfigCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: ClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsAgentsClawConfigUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: ClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsAgentsClawConfigPartialUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody?: PatchedClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns void * @throws ApiError */ public static aiMentorOrgsAgentsClawConfigDestroy({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * Push agent_config to the Claw worker. RBAC enforced in initial(). * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsAgentsClawConfigPushConfigCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: ClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/push-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve mentor grader configuration * Return the mentor's grader configuration. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * Create mentor grader configuration * Create the grader configuration for a mentor. Fails with 400 if a configuration already exists (the resource is 1:1 with the mentor). Criteria are added separately via the nested `criteria/` endpoints. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: MentorGraderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data, or grader config already exists for this mentor`, 403: `Permission Denied`, 404: `Mentor not found`, }, }); } /** * Replace mentor grader configuration * Replace all writable fields on the grader configuration. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: MentorGraderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * Partially update mentor grader configuration * Update one or more writable fields on the grader configuration. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigPartialUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody?: PatchedMentorGraderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * List grader criteria * List the criteria attached to the mentor's grader configuration. Supports `search` against the criterion `name` field. * @returns PaginatedGraderCriterionList * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCriteriaList({ mentorUniqueId, org, limit, offset, search, }: { mentorUniqueId: string, org: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'limit': limit, 'offset': offset, 'search': search, }, errors: { 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * Create grader criterion * Add a criterion to the mentor's grader configuration. `points` must be a positive float; the overall score is computed as earned points / total possible points (no sum-to-1 invariant). * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCriteriaCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: GraderCriterion, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * Retrieve grader criterion * Retrieve a single criterion by id. * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCriteriaRetrieve({ id, mentorUniqueId, org, }: { id: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * Replace grader criterion * Replace all writable fields on a criterion. * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCriteriaUpdate({ id, mentorUniqueId, org, requestBody, }: { id: number, mentorUniqueId: string, org: string, requestBody: GraderCriterion, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * Partially update grader criterion * Update one or more writable fields on a criterion. * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCriteriaPartialUpdate({ id, mentorUniqueId, org, requestBody, }: { id: number, mentorUniqueId: string, org: string, requestBody?: PatchedGraderCriterion, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * Delete grader criterion * Delete a criterion. Refuses with 400 if it is the only remaining criterion on the config — a config with zero criteria cannot grade. * @returns void * @throws ApiError */ public static aiMentorOrgsAgentsGraderConfigCriteriaDestroy({ id, mentorUniqueId, org, }: { id: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 400: `Cannot delete the last criterion — a grader config must have at least one`, 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * List mentor grade results * List the grades this mentor has issued, most recent first. Filterable by `username`, `email` (both partial matches), `status`, `override_status`, and the `graded_at_after` / `graded_at_before` range; orderable by `graded_at`. The two status filters cover different failures: `?status=failed` finds grades whose original publish did not land, while `?override_status=failed` finds human overrides the LMS rejected, which are retried by repeating the PATCH. * @returns PaginatedGradeResultList * @throws ApiError */ public static aiMentorOrgsAgentsGraderResultsList({ mentorUniqueId, org, email, gradedAtAfter, gradedAtBefore, ordering, overrideStatus, page, pageSize, status, username, }: { mentorUniqueId: string, org: string, email?: string, gradedAtAfter?: string, gradedAtBefore?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * Whether the most recent override reached the LMS, including one that cleared the override — 'published' with a null override_score means the reset back to the AI score is what reached the LMS. * * * `pending` - Pending * * `published` - Published * * `failed` - Failed */ overrideStatus?: 'failed' | 'pending' | 'published' | null, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * Whether the AI score reached the LMS. * * * `pending` - Pending * * `published` - Published * * `failed` - Failed */ status?: 'failed' | 'pending' | 'published', username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'email': email, 'graded_at_after': gradedAtAfter, 'graded_at_before': gradedAtBefore, 'ordering': ordering, 'override_status': overrideStatus, 'page': page, 'page_size': pageSize, 'status': status, 'username': username, }, errors: { 403: `Permission Denied`, 404: `Mentor not found`, }, }); } /** * Retrieve a grade result * Return one grade, including its rubric and publish record. * @returns GradeResultDetail * @throws ApiError */ public static aiMentorOrgsAgentsGraderResultsRetrieve({ id, mentorUniqueId, org, }: { id: string, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission Denied`, 404: `Mentor or grade not found`, }, }); } /** * Override a grade result * Record a human override and push it to the LMS the grade came from. `override_points` is in rubric points (0 to `total_points`); null clears the override and restores the AI score. The override is recorded as `pending` before the push, then resolved to `published` or `failed`; either outcome is retried by repeating the request. A row left at `pending` means the request died mid-push and the LMS may or may not hold the score. * @returns GradeResultDetail * @throws ApiError */ public static aiMentorOrgsAgentsGraderResultsPartialUpdate({ id, mentorUniqueId, org, requestBody, }: { id: string, mentorUniqueId: string, org: string, requestBody?: PatchedGradeResultOverride, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data, or the grade has no rubric to score against`, 403: `Permission Denied`, 404: `Mentor or grade not found`, 502: `The override was recorded but the LMS rejected it; \`override_status\` is \`failed\``, }, }); } /** * Grant LTI Mentor Access * Grants a user Student type access to a mentor that is lti accessible. * * Creates or updates an RBAC policy named LTI-{mentor.unique_id} with the global Student role, * granting the specified user access to the mentor. Validates that the mentor has LTI access * enabled and that the user belongs to the specified platform. * @returns any Policy created and user granted access * @throws ApiError */ public static aiMentorOrgsAgentsLtiGrantAgentAccessCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, /** * Organization slug */ org: string, requestBody: GrantMentorAccessRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/lti/grant-agent-access/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request data`, 403: `Mentor is not LTI accessible`, 404: `Mentor, platform, or user not found`, 500: `Global Student role not found`, }, }); } /** * Skill assignments nested under a mentor. Full CRUD. * @returns PaginatedMentorSkillAssignmentList * @throws ApiError */ public static aiMentorOrgsAgentsSkillsList({ mentorUniqueId, org, enabled, limit, offset, }: { mentorUniqueId: string, org: string, enabled?: boolean, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'enabled': enabled, 'limit': limit, 'offset': offset, }, }); } /** * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsAgentsSkillsCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: MentorSkillAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsAgentsSkillsRetrieve({ assignmentPk, mentorUniqueId, org, }: { assignmentPk: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsAgentsSkillsUpdate({ assignmentPk, mentorUniqueId, org, requestBody, }: { assignmentPk: number, mentorUniqueId: string, org: string, requestBody: MentorSkillAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsAgentsSkillsPartialUpdate({ assignmentPk, mentorUniqueId, org, requestBody, }: { assignmentPk: number, mentorUniqueId: string, org: string, requestBody?: PatchedMentorSkillAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Skill assignments nested under a mentor. Full CRUD. * @returns void * @throws ApiError */ public static aiMentorOrgsAgentsSkillsDestroy({ assignmentPk, mentorUniqueId, org, }: { assignmentPk: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * Get an agent spend cap * Retrieve the singleton agent-scoped spend cap for one mentor. The mentor is resolved tenant-scoped, so a cross-tenant unique_id 404s. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission denied`, 404: `Mentor or agent spend cap not found`, }, }); } /** * Create or update an agent spend cap * Upsert the singleton agent-scoped spend cap for one mentor. Returns 201 on first write and 200 on update. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: SpendCap, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error`, 403: `Permission denied`, 404: `Platform or mentor not found`, }, }); } /** * Delete an agent spend cap * Remove the singleton agent-scoped spend cap for one mentor. * @returns void * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapDestroy({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission denied`, 404: `Agent spend cap not found`, }, }); } /** * List per-user caps for an agent * List every explicit ``(user, agent)`` spend cap configured for one mentor. Individual caps are managed via the detail endpoint. Optionally filter by username and/or email. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapsUsersList({ mentorUniqueId, org, email, username, }: { mentorUniqueId: string, org: string, /** * Optional case-insensitive exact email filter */ email?: string, /** * Optional exact username filter */ username?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'email': email, 'username': username, }, errors: { 403: `Permission denied`, 404: `Mentor not found`, }, }); } /** * Get a per-user agent spend cap * Retrieve one explicit ``(user, agent)`` spend cap. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapsUsersRetrieve({ mentorUniqueId, org, username, }: { mentorUniqueId: string, org: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'username': username, }, errors: { 403: `Permission denied`, 404: `User spend cap not found`, }, }); } /** * Create or update a per-user agent spend cap * Upsert one explicit ``(user, agent)`` spend cap. The username comes from the URL, not the body. Returns 201 on first write and 200 on update. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapsUsersUpdate({ mentorUniqueId, org, username, requestBody, }: { mentorUniqueId: string, org: string, username: string, requestBody: SpendCap, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'username': username, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error`, 403: `Permission denied`, 404: `Platform, mentor, or user not found`, }, }); } /** * Delete a per-user agent spend cap * Remove one explicit ``(user, agent)`` spend cap. * @returns void * @throws ApiError */ public static aiMentorOrgsAgentsSpendCapsUsersDestroy({ mentorUniqueId, org, username, }: { mentorUniqueId: string, org: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'username': username, }, errors: { 403: `Permission denied`, 404: `User spend cap not found`, }, }); } /** * Retrieve a list of emails in a mentor's inbox. * * The list can be filtered using the 'search' query parameter to search * for specific terms in the email content or subject. * * Args: * mentor: The unique identifier of the mentor. * * Returns: * Response: A paginated list of emails in the mentor's inbox. * * Raises: * NotFound: If the specified mentor does not exist. * @returns PaginatedEmailPromptListList * @throws ApiError */ public static aiMentorOrgsAgentsEmailInboxList({ mentor, org, page, pageSize, search, }: { mentor: string, org: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * Search term to filter emails by content or subject */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/', path: { 'mentor': mentor, 'org': org, }, query: { 'page': page, 'page_size': pageSize, 'search': search, }, errors: { 404: `Mentor not found`, }, }); } /** * Retrieve a summary of a mentor's email inbox. * * Args: * request: The HTTP request. * mentor: The unique identifier of the mentor. * * Returns: * Response: A summary of the mentor's email inbox statistics. * * Raises: * NotFound: If the specified mentor does not exist. * @returns EmailPromptSummary * @throws ApiError */ public static aiMentorOrgsAgentsEmailInboxSummaryRetrieve({ mentor, org, }: { mentor: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox-summary/', path: { 'mentor': mentor, 'org': org, }, errors: { 404: `Mentor not found`, }, }); } /** * Retrieve details of a specific email in a mentor's inbox. * * Args: * request: The HTTP request. * email_prompt_id: The ID of the email to retrieve. * * Returns: * Response: The detailed information about the email. * * Raises: * NotFound: If the specified email does not exist. * @returns EmailPromptDetail * @throws ApiError */ public static aiMentorOrgsAgentsEmailInboxRetrieve({ emailPromptId, mentor, org, }: { emailPromptId: number, mentor: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/{email_prompt_id}/', path: { 'email_prompt_id': emailPromptId, 'mentor': mentor, 'org': org, }, errors: { 404: `Email not found`, }, }); } /** * API endpoint to link mentor with a course and enable guided mode. * * Permissions: * - Accessible to tenant admins. * @returns LinkCourseResponse * @throws ApiError */ public static aiMentorOrgsAgentsLinkCourseRetrieve({ mentor, org, }: { mentor: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/', path: { 'mentor': mentor, 'org': org, }, }); } /** * API endpoint to link mentor with a course and enable guided mode. * * Permissions: * - Accessible to tenant admins. * @returns LinkCourseResponse * @throws ApiError */ public static aiMentorOrgsAgentsLinkCourseCreate({ mentor, org, requestBody, }: { mentor: string, org: string, requestBody: LinkCourseRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/', path: { 'mentor': mentor, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Get accessible mentors by email * Returns a list of mentor unique IDs that a user can access via email in the specified organization. * @returns AccessibleMentorsByEmailResponse * @throws ApiError */ public static aiMentorOrgsAgentsByEmailCreate({ org, requestBody, }: { org: string, requestBody?: AccessibleMentorsByEmailRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/agents/by-email/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request parameters`, 404: `User or platform not found`, }, }); } /** * List all triggers for an organization. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * * Returns: * Response: A list of trigger slugs for the organization. * * Raises: * BadRequest: If the request is invalid. * @returns any List of trigger slugs * @throws ApiError */ public static aiMentorOrgsAllTriggersRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/all-triggers/', path: { 'org': org, }, errors: { 400: `Invalid request`, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns PaginatedClawInstanceList * @throws ApiError */ public static aiMentorOrgsClawInstancesList({ org, limit, offset, search, status, }: { org: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * A search term. */ search?: string, /** * * `active` - Active * * `inactive` - Inactive * * `error` - Error */ status?: 'active' | 'error' | 'inactive', }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/', path: { 'org': org, }, query: { 'limit': limit, 'offset': offset, 'search': search, 'status': status, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesCreate({ org, requestBody, }: { org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesRetrieve({ id, org, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/', path: { 'id': id, 'org': org, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesPartialUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody?: PatchedClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns void * @throws ApiError */ public static aiMentorOrgsClawInstancesDestroy({ id, org, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/', path: { 'id': id, 'org': org, }, }); } /** * Queue a health check against the Claw instance. * * Offloaded to Celery because the real health check uses a WebSocket * handshake + RPC, which blocks gevent workers (sockets are not * monkey-patched). The task updates the server's health fields on * completion. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesHealthCheckCreate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/health-check/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Push all enabled model providers to the worker. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesPushProvidersCreate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/push-providers/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Connect to the worker and store Claw version from handshake. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesRefreshVersionCreate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/refresh-version/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Queue a device-pairing request against the worker (#1848). * * The connect handshake is a WebSocket + RPC round-trip that blocks gevent web workers, so it is * offloaded to Celery rather than run inline. The task mints a pending pairing request (expires * ~5 min) and writes the result (request id + fingerprint, already-paired, or error) to the * instance's ``last_pairing`` field; an operator then approves the request id on the worker host. * This endpoint never approves — approval stays explicit and operator-gated. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesRequestPairingCreate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/request-pairing/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Run security audit on the worker and store findings. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesSecurityAuditCreate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/security-audit/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Check connectivity to the Claw instance: TLS reachability + health check. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesTestConnectivityCreate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, requestBody: ClawInstance, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/test-connectivity/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Return per-tenant usage snapshot. * * Cost fields are stripped on managed instances so we don't expose * our LLM-provider cost basis to the customer. Self-hosted instances * return the full payload (the customer pays the LLM bill). * Non-OpenClaw instances return 400 — IronClaw / NemoClaw don't * expose the same usage RPCs. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesUsageRetrieve({ id, org, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/usage/', path: { 'id': id, 'org': org, }, }); } /** * Return unredacted usage snapshot — DM superadmin only. * * Always includes all cost fields regardless of provision_mode. * Tenants do not see this surface; the tenant-facing * ``/usage`` endpoint handles per-platform redaction. * @returns ClawInstance * @throws ApiError */ public static aiMentorOrgsClawInstancesUsageFullRetrieve({ id, org, }: { /** * A unique integer value identifying this Claw instance. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{id}/usage/full/', path: { 'id': id, 'org': org, }, }); } /** * Fetch the OpenClaw config * Returns the openclaw.json snapshot from the worker, with secret values replaced by the literal `__OPENCLAW_REDACTED__` sentinel. The `hash` field is the optimistic-concurrency token required by subsequent `PATCH config/` calls. * @returns ClawConfigGetResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesConfigRetrieve({ org, serverPk, }: { org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/config/', path: { 'org': org, 'server_pk': serverPk, }, }); } /** * Merge-patch the OpenClaw config * Deep-merges the supplied `patch` into the current openclaw.json. Nulls delete keys, arrays replace wholesale. Pass `__OPENCLAW_REDACTED__` at a secret path to leave the secret unchanged. Rate limit: 3 writes / 60 s per deviceId+clientIp on the worker. * @returns ClawConfigGetResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesConfigPartialUpdate({ org, serverPk, requestBody, }: { org: string, serverPk: number, requestBody?: PatchedClawConfigPatchRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/config/', path: { 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * List cron jobs * Manage scheduled cron jobs on a ClawInstance. * @returns CronJobListResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesCronJobsList({ org, serverPk, enabled, includeDisabled, limit, offset, query, sortBy, sortDir = 'desc', }: { org: string, serverPk: number, /** * * `all` - all * * `enabled` - enabled * * `disabled` - disabled */ enabled?: 'all' | 'enabled' | 'disabled', includeDisabled?: boolean, limit?: number, offset?: number, query?: string, /** * * `nextRunAtMs` - nextRunAtMs * * `updatedAtMs` - updatedAtMs * * `name` - name */ sortBy?: 'nextRunAtMs' | 'updatedAtMs' | 'name', /** * * `asc` - asc * * `desc` - desc */ sortDir?: 'asc' | 'desc', }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/', path: { 'org': org, 'server_pk': serverPk, }, query: { 'enabled': enabled, 'include_disabled': includeDisabled, 'limit': limit, 'offset': offset, 'query': query, 'sort_by': sortBy, 'sort_dir': sortDir, }, }); } /** * Create a cron job * Sends `cron.add` to the worker. Required scope: `operator.admin`. The worker echoes back the assigned `jobId`. * @returns CronJobResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesCronJobsCreate({ org, serverPk, requestBody, }: { org: string, serverPk: number, requestBody: CronJobCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/', path: { 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * Manage scheduled cron jobs on a ClawInstance. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsClawInstancesCronJobsUpdate({ jobId, org, serverPk, }: { jobId: string, org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/{job_id}/', path: { 'job_id': jobId, 'org': org, 'server_pk': serverPk, }, }); } /** * Patch a cron job * Forwards the body verbatim as `cron.update.params.patch`. * @returns CronJobResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesCronJobsPartialUpdate({ jobId, org, serverPk, requestBody, }: { jobId: string, org: string, serverPk: number, requestBody?: PatchedCronJobPatch, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/{job_id}/', path: { 'job_id': jobId, 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * Remove a cron job * Manage scheduled cron jobs on a ClawInstance. * @returns void * @throws ApiError */ public static aiMentorOrgsClawInstancesCronJobsDestroy({ jobId, org, serverPk, }: { jobId: string, org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/{job_id}/', path: { 'job_id': jobId, 'org': org, 'server_pk': serverPk, }, }); } /** * Trigger a cron job to run now * Calls `cron.run` on the worker. Mode `force` (default) runs unconditionally; `due` only runs if the schedule says it's due. * @returns CronRunResult * @throws ApiError */ public static aiMentorOrgsClawInstancesCronJobsRunCreate({ jobId, org, serverPk, requestBody, }: { jobId: string, org: string, serverPk: number, requestBody?: CronRunAction, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/{job_id}/run/', path: { 'job_id': jobId, 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * List cron run history * ``GET /claw/instances//cron-runs/`` — paginated run-log entries. * @returns CronRunsResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesCronRunsRetrieve({ org, serverPk, deliveryStatus, jobId, limit, offset, query, scope, sortDir = 'desc', status, }: { org: string, serverPk: number, /** * * `delivered` - delivered * * `not-delivered` - not-delivered * * `unknown` - unknown * * `not-requested` - not-requested */ deliveryStatus?: 'delivered' | 'not-delivered' | 'unknown' | 'not-requested', jobId?: string, limit?: number, offset?: number, query?: string, /** * * `job` - job * * `all` - all */ scope?: 'job' | 'all', /** * * `asc` - asc * * `desc` - desc */ sortDir?: 'asc' | 'desc', /** * * `all` - all * * `ok` - ok * * `error` - error * * `skipped` - skipped */ status?: 'all' | 'ok' | 'error' | 'skipped', }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-runs/', path: { 'org': org, 'server_pk': serverPk, }, query: { 'delivery_status': deliveryStatus, 'job_id': jobId, 'limit': limit, 'offset': offset, 'query': query, 'scope': scope, 'sort_dir': sortDir, 'status': status, }, }); } /** * Cron scheduler health * Returns the worker's `cron.status` summary. * @returns CronStatusResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesCronStatusRetrieve({ org, serverPk, }: { org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-status/', path: { 'org': org, 'server_pk': serverPk, }, }); } /** * List MCP servers configured on this ClawInstance * Reads `mcp.servers.*` from the worker config and returns each entry's name + config. Secret values are surfaced as `__OPENCLAW_REDACTED__`. * @returns McpServerListResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesMcpServersList({ org, serverPk, }: { org: string, serverPk: number, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/', path: { 'org': org, 'server_pk': serverPk, }, }); } /** * Add a new MCP server * Inserts a new entry at `mcp.servers.` and writes the full config back via `config.set` with the current `baseHash`. Fails with 409 if the name already exists. * @returns McpServerEntry * @throws ApiError */ public static aiMentorOrgsClawInstancesMcpServersCreate({ org, serverPk, requestBody, }: { org: string, serverPk: number, requestBody: McpServerCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/', path: { 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve a single MCP server * Manage MCP server entries on a ClawInstance. * * All operations round-trip the worker's config (read → modify → write * with baseHash), so existing entries — including * `__OPENCLAW_REDACTED__` secret placeholders — are preserved verbatim. * The canonical config path is `mcp.servers.`. * @returns McpServerEntry * @throws ApiError */ public static aiMentorOrgsClawInstancesMcpServersRetrieve({ mcpName, org, serverPk, }: { mcpName: string, org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/{mcp_name}/', path: { 'mcp_name': mcpName, 'org': org, 'server_pk': serverPk, }, }); } /** * Manage MCP server entries on a ClawInstance. * * All operations round-trip the worker's config (read → modify → write * with baseHash), so existing entries — including * `__OPENCLAW_REDACTED__` secret placeholders — are preserved verbatim. * The canonical config path is `mcp.servers.`. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsClawInstancesMcpServersUpdate({ mcpName, org, serverPk, }: { mcpName: string, org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/{mcp_name}/', path: { 'mcp_name': mcpName, 'org': org, 'server_pk': serverPk, }, }); } /** * Update an MCP server (deep-merge by default) * Deep-merges the `config` patch into the existing entry, preserving fields the caller didn't supply — including redacted secret values. Set `replace=true` for a full overwrite of the entry. * @returns McpServerEntry * @throws ApiError */ public static aiMentorOrgsClawInstancesMcpServersPartialUpdate({ mcpName, org, serverPk, requestBody, }: { mcpName: string, org: string, serverPk: number, requestBody?: PatchedMcpServerUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/{mcp_name}/', path: { 'mcp_name': mcpName, 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * Remove an MCP server entry * Manage MCP server entries on a ClawInstance. * * All operations round-trip the worker's config (read → modify → write * with baseHash), so existing entries — including * `__OPENCLAW_REDACTED__` secret placeholders — are preserved verbatim. * The canonical config path is `mcp.servers.`. * @returns void * @throws ApiError */ public static aiMentorOrgsClawInstancesMcpServersDestroy({ mcpName, org, serverPk, }: { mcpName: string, org: string, serverPk: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/{mcp_name}/', path: { 'mcp_name': mcpName, 'org': org, 'server_pk': serverPk, }, }); } /** * Inject a wake message into a session * Sends the `wake` RPC. `mode="now"` (default) injects immediately; `mode="next-heartbeat"` defers until the next heartbeat. Required scope: `operator.write`. * @returns WakeResponse * @throws ApiError */ public static aiMentorOrgsClawInstancesWakeCreate({ org, serverPk, requestBody, }: { org: string, serverPk: number, requestBody: WakeRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/wake/', path: { 'org': org, 'server_pk': serverPk, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns PaginatedClawModelProviderList * @throws ApiError */ public static aiMentorOrgsClawModelProvidersList({ org, enabled, limit, offset, server, }: { org: string, enabled?: boolean, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, server?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/model-providers/', path: { 'org': org, }, query: { 'enabled': enabled, 'limit': limit, 'offset': offset, 'server': server, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawModelProvider * @throws ApiError */ public static aiMentorOrgsClawModelProvidersCreate({ org, requestBody, }: { org: string, requestBody: ClawModelProvider, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/claw/model-providers/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawModelProvider * @throws ApiError */ public static aiMentorOrgsClawModelProvidersRetrieve({ id, org, }: { /** * A unique integer value identifying this Claw model provider. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/claw/model-providers/{id}/', path: { 'id': id, 'org': org, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawModelProvider * @throws ApiError */ public static aiMentorOrgsClawModelProvidersUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw model provider. */ id: number, org: string, requestBody: ClawModelProvider, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/claw/model-providers/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns ClawModelProvider * @throws ApiError */ public static aiMentorOrgsClawModelProvidersPartialUpdate({ id, org, requestBody, }: { /** * A unique integer value identifying this Claw model provider. */ id: number, org: string, requestBody?: PatchedClawModelProvider, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/claw/model-providers/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns void * @throws ApiError */ public static aiMentorOrgsClawModelProvidersDestroy({ id, org, }: { /** * A unique integer value identifying this Claw model provider. */ id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/claw/model-providers/{id}/', path: { 'id': id, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` (`mentor` → `agent`) and will be removed in a future release. * * List all active memory categories for a mentor. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsMentorsMemoryCategoriesRetrieve({ mentorId, org, }: { mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_id}/memory-categories/', path: { 'mentor_id': mentorId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` (`mentor` → `agent`) and will be removed in a future release. * * Create a new memory category. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsMentorsMemoryCategoriesCreate({ mentorId, org, }: { mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_id}/memory-categories/', path: { 'mentor_id': mentorId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Update a memory category. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsMentorsMemoryCategoriesPartialUpdate({ categoryId, mentorId, org, }: { categoryId: number, mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_id}/memory-categories/{category_id}/', path: { 'category_id': categoryId, 'mentor_id': mentorId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Deactivate a memory category. * @returns void * @throws ApiError */ public static aiMentorOrgsMentorsMemoryCategoriesDestroy({ categoryId, mentorId, org, }: { categoryId: number, mentorId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_id}/memory-categories/{category_id}/', path: { 'category_id': categoryId, 'mentor_id': mentorId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular AgentConfig nested under a mentor. GET + PATCH only. * * AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has * never had a ClawMentorConfig, PATCH will create the AgentConfig on first * write via get_or_create. DELETE is not supported (the row would be * immediately recreated by a subsequent ClawMentorConfig.save). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsMentorsAgentConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/agent-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular AgentConfig nested under a mentor. GET + PATCH only. * * AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has * never had a ClawMentorConfig, PATCH will create the AgentConfig on first * write via get_or_create. DELETE is not supported (the row would be * immediately recreated by a subsequent ClawMentorConfig.save). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsMentorsAgentConfigPartialUpdate({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/agent-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsMentorsClawConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsMentorsClawConfigCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: ClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsMentorsClawConfigUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: ClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsMentorsClawConfigPartialUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody?: PatchedClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release. * * Singular ClawMentorConfig nested under a mentor. * * Supports GET/POST/PATCH/DELETE plus the push-config/ custom action. * POST creates the (one and only) ClawMentorConfig for this mentor — the * OneToOne(Mentor) constraint means a duplicate POST returns 400. * @returns void * @throws ApiError */ public static aiMentorOrgsMentorsClawConfigDestroy({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/push-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/push-config/` (`mentor` → `agent`) and will be removed in a future release. * * Push agent_config to the Claw worker. RBAC enforced in initial(). * @returns ClawMentorConfig * @throws ApiError */ public static aiMentorOrgsMentorsClawConfigPushConfigCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: ClawMentorConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/push-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * Retrieve mentor grader configuration * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release. * * Return the mentor's grader configuration. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * @deprecated * Create mentor grader configuration * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release. * * Create the grader configuration for a mentor. Fails with 400 if a configuration already exists (the resource is 1:1 with the mentor). Criteria are added separately via the nested `criteria/` endpoints. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: MentorGraderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data, or grader config already exists for this mentor`, 403: `Permission Denied`, 404: `Mentor not found`, }, }); } /** * @deprecated * Replace mentor grader configuration * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release. * * Replace all writable fields on the grader configuration. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: MentorGraderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * @deprecated * Partially update mentor grader configuration * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release. * * Update one or more writable fields on the grader configuration. * @returns MentorGraderConfig * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigPartialUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody?: PatchedMentorGraderConfig, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * @deprecated * List grader criteria * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` (`mentor` → `agent`) and will be removed in a future release. * * List the criteria attached to the mentor's grader configuration. Supports `search` against the criterion `name` field. * @returns PaginatedGraderCriterionList * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCriteriaList({ mentorUniqueId, org, limit, offset, search, }: { mentorUniqueId: string, org: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'limit': limit, 'offset': offset, 'search': search, }, errors: { 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * @deprecated * Create grader criterion * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` (`mentor` → `agent`) and will be removed in a future release. * * Add a criterion to the mentor's grader configuration. `points` must be a positive float; the overall score is computed as earned points / total possible points (no sum-to-1 invariant). * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCriteriaCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: GraderCriterion, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor or grader config not found`, }, }); } /** * @deprecated * Retrieve grader criterion * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a single criterion by id. * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCriteriaRetrieve({ id, mentorUniqueId, org, }: { id: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * @deprecated * Replace grader criterion * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release. * * Replace all writable fields on a criterion. * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCriteriaUpdate({ id, mentorUniqueId, org, requestBody, }: { id: number, mentorUniqueId: string, org: string, requestBody: GraderCriterion, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * @deprecated * Partially update grader criterion * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release. * * Update one or more writable fields on a criterion. * @returns GraderCriterion * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCriteriaPartialUpdate({ id, mentorUniqueId, org, requestBody, }: { id: number, mentorUniqueId: string, org: string, requestBody?: PatchedGraderCriterion, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * @deprecated * Delete grader criterion * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release. * * Delete a criterion. Refuses with 400 if it is the only remaining criterion on the config — a config with zero criteria cannot grade. * @returns void * @throws ApiError */ public static aiMentorOrgsMentorsGraderConfigCriteriaDestroy({ id, mentorUniqueId, org, }: { id: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 400: `Cannot delete the last criterion — a grader config must have at least one`, 403: `Permission Denied`, 404: `Mentor, grader config, or criterion not found`, }, }); } /** * @deprecated * List mentor grade results * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/` (`mentor` → `agent`) and will be removed in a future release. * * List the grades this mentor has issued, most recent first. Filterable by `username`, `email` (both partial matches), `status`, `override_status`, and the `graded_at_after` / `graded_at_before` range; orderable by `graded_at`. The two status filters cover different failures: `?status=failed` finds grades whose original publish did not land, while `?override_status=failed` finds human overrides the LMS rejected, which are retried by repeating the PATCH. * @returns PaginatedGradeResultList * @throws ApiError */ public static aiMentorOrgsMentorsGraderResultsList({ mentorUniqueId, org, email, gradedAtAfter, gradedAtBefore, ordering, overrideStatus, page, pageSize, status, username, }: { mentorUniqueId: string, org: string, email?: string, gradedAtAfter?: string, gradedAtBefore?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * Whether the most recent override reached the LMS, including one that cleared the override — 'published' with a null override_score means the reset back to the AI score is what reached the LMS. * * * `pending` - Pending * * `published` - Published * * `failed` - Failed */ overrideStatus?: 'failed' | 'pending' | 'published' | null, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * Whether the AI score reached the LMS. * * * `pending` - Pending * * `published` - Published * * `failed` - Failed */ status?: 'failed' | 'pending' | 'published', username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-results/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'email': email, 'graded_at_after': gradedAtAfter, 'graded_at_before': gradedAtBefore, 'ordering': ordering, 'override_status': overrideStatus, 'page': page, 'page_size': pageSize, 'status': status, 'username': username, }, errors: { 403: `Permission Denied`, 404: `Mentor not found`, }, }); } /** * @deprecated * Retrieve a grade result * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` (`mentor` → `agent`) and will be removed in a future release. * * Return one grade, including its rubric and publish record. * @returns GradeResultDetail * @throws ApiError */ public static aiMentorOrgsMentorsGraderResultsRetrieve({ id, mentorUniqueId, org, }: { id: string, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-results/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission Denied`, 404: `Mentor or grade not found`, }, }); } /** * @deprecated * Override a grade result * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` (`mentor` → `agent`) and will be removed in a future release. * * Record a human override and push it to the LMS the grade came from. `override_points` is in rubric points (0 to `total_points`); null clears the override and restores the AI score. The override is recorded as `pending` before the push, then resolved to `published` or `failed`; either outcome is retried by repeating the request. A row left at `pending` means the request died mid-push and the LMS may or may not hold the score. * @returns GradeResultDetail * @throws ApiError */ public static aiMentorOrgsMentorsGraderResultsPartialUpdate({ id, mentorUniqueId, org, requestBody, }: { id: string, mentorUniqueId: string, org: string, requestBody?: PatchedGradeResultOverride, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-results/{id}/', path: { 'id': id, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data, or the grade has no rubric to score against`, 403: `Permission Denied`, 404: `Mentor or grade not found`, 502: `The override was recorded but the LMS rejected it; \`override_status\` is \`failed\``, }, }); } /** * @deprecated * Grant LTI Mentor Access * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/lti/grant-agent-access/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/lti/grant-agent-access/` (`mentor` → `agent`) and will be removed in a future release. * * Grants a user Student type access to a mentor that is lti accessible. * * Creates or updates an RBAC policy named LTI-{mentor.unique_id} with the global Student role, * granting the specified user access to the mentor. Validates that the mentor has LTI access * enabled and that the user belongs to the specified platform. * @returns any Policy created and user granted access * @throws ApiError */ public static aiMentorOrgsMentorsLtiGrantMentorAccessCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, /** * Organization slug */ org: string, requestBody: GrantMentorAccessRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/lti/grant-mentor-access/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request data`, 403: `Mentor is not LTI accessible`, 404: `Mentor, platform, or user not found`, 500: `Global Student role not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` (`mentor` → `agent`) and will be removed in a future release. * * Skill assignments nested under a mentor. Full CRUD. * @returns PaginatedMentorSkillAssignmentList * @throws ApiError */ public static aiMentorOrgsMentorsSkillsList({ mentorUniqueId, org, enabled, limit, offset, }: { mentorUniqueId: string, org: string, enabled?: boolean, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'enabled': enabled, 'limit': limit, 'offset': offset, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` (`mentor` → `agent`) and will be removed in a future release. * * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsMentorsSkillsCreate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: MentorSkillAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release. * * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsMentorsSkillsRetrieve({ assignmentPk, mentorUniqueId, org, }: { assignmentPk: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release. * * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsMentorsSkillsUpdate({ assignmentPk, mentorUniqueId, org, requestBody, }: { assignmentPk: number, mentorUniqueId: string, org: string, requestBody: MentorSkillAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release. * * Skill assignments nested under a mentor. Full CRUD. * @returns MentorSkillAssignment * @throws ApiError */ public static aiMentorOrgsMentorsSkillsPartialUpdate({ assignmentPk, mentorUniqueId, org, requestBody, }: { assignmentPk: number, mentorUniqueId: string, org: string, requestBody?: PatchedMentorSkillAssignment, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release. * * Skill assignments nested under a mentor. Full CRUD. * @returns void * @throws ApiError */ public static aiMentorOrgsMentorsSkillsDestroy({ assignmentPk, mentorUniqueId, org, }: { assignmentPk: number, mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/{assignment_pk}/', path: { 'assignment_pk': assignmentPk, 'mentor_unique_id': mentorUniqueId, 'org': org, }, }); } /** * @deprecated * Get an agent spend cap * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the singleton agent-scoped spend cap for one mentor. The mentor is resolved tenant-scoped, so a cross-tenant unique_id 404s. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-cap/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission denied`, 404: `Mentor or agent spend cap not found`, }, }); } /** * @deprecated * Create or update an agent spend cap * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` (`mentor` → `agent`) and will be removed in a future release. * * Upsert the singleton agent-scoped spend cap for one mentor. Returns 201 on first write and 200 on update. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapUpdate({ mentorUniqueId, org, requestBody, }: { mentorUniqueId: string, org: string, requestBody: SpendCap, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-cap/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error`, 403: `Permission denied`, 404: `Platform or mentor not found`, }, }); } /** * @deprecated * Delete an agent spend cap * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` (`mentor` → `agent`) and will be removed in a future release. * * Remove the singleton agent-scoped spend cap for one mentor. * @returns void * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapDestroy({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-cap/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Permission denied`, 404: `Agent spend cap not found`, }, }); } /** * @deprecated * List per-user caps for an agent * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/` (`mentor` → `agent`) and will be removed in a future release. * * List every explicit ``(user, agent)`` spend cap configured for one mentor. Individual caps are managed via the detail endpoint. Optionally filter by username and/or email. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapsUsersList({ mentorUniqueId, org, email, username, }: { mentorUniqueId: string, org: string, /** * Optional case-insensitive exact email filter */ email?: string, /** * Optional exact username filter */ username?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-caps/users/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'email': email, 'username': username, }, errors: { 403: `Permission denied`, 404: `Mentor not found`, }, }); } /** * @deprecated * Get a per-user agent spend cap * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve one explicit ``(user, agent)`` spend cap. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapsUsersRetrieve({ mentorUniqueId, org, username, }: { mentorUniqueId: string, org: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-caps/users/{username}/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'username': username, }, errors: { 403: `Permission denied`, 404: `User spend cap not found`, }, }); } /** * @deprecated * Create or update a per-user agent spend cap * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` (`mentor` → `agent`) and will be removed in a future release. * * Upsert one explicit ``(user, agent)`` spend cap. The username comes from the URL, not the body. Returns 201 on first write and 200 on update. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapsUsersUpdate({ mentorUniqueId, org, username, requestBody, }: { mentorUniqueId: string, org: string, username: string, requestBody: SpendCap, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-caps/users/{username}/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'username': username, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error`, 403: `Permission denied`, 404: `Platform, mentor, or user not found`, }, }); } /** * @deprecated * Delete a per-user agent spend cap * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` (`mentor` → `agent`) and will be removed in a future release. * * Remove one explicit ``(user, agent)`` spend cap. * @returns void * @throws ApiError */ public static aiMentorOrgsMentorsSpendCapsUsersDestroy({ mentorUniqueId, org, username, }: { mentorUniqueId: string, org: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-caps/users/{username}/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'username': username, }, errors: { 403: `Permission denied`, 404: `User spend cap not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a list of emails in a mentor's inbox. * * The list can be filtered using the 'search' query parameter to search * for specific terms in the email content or subject. * * Args: * mentor: The unique identifier of the mentor. * * Returns: * Response: A paginated list of emails in the mentor's inbox. * * Raises: * NotFound: If the specified mentor does not exist. * @returns PaginatedEmailPromptListList * @throws ApiError */ public static aiMentorOrgsMentorsEmailInboxList({ mentor, org, page, pageSize, search, }: { mentor: string, org: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * Search term to filter emails by content or subject */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox/', path: { 'mentor': mentor, 'org': org, }, query: { 'page': page, 'page_size': pageSize, 'search': search, }, errors: { 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox-summary/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox-summary/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a summary of a mentor's email inbox. * * Args: * request: The HTTP request. * mentor: The unique identifier of the mentor. * * Returns: * Response: A summary of the mentor's email inbox statistics. * * Raises: * NotFound: If the specified mentor does not exist. * @returns EmailPromptSummary * @throws ApiError */ public static aiMentorOrgsMentorsEmailInboxSummaryRetrieve({ mentor, org, }: { mentor: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox-summary/', path: { 'mentor': mentor, 'org': org, }, errors: { 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/{email_prompt_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/{email_prompt_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve details of a specific email in a mentor's inbox. * * Args: * request: The HTTP request. * email_prompt_id: The ID of the email to retrieve. * * Returns: * Response: The detailed information about the email. * * Raises: * NotFound: If the specified email does not exist. * @returns EmailPromptDetail * @throws ApiError */ public static aiMentorOrgsMentorsEmailInboxRetrieve({ emailPromptId, mentor, org, }: { emailPromptId: number, mentor: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox/{email_prompt_id}/', path: { 'email_prompt_id': emailPromptId, 'mentor': mentor, 'org': org, }, errors: { 404: `Email not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` (`mentor` → `agent`) and will be removed in a future release. * * API endpoint to link mentor with a course and enable guided mode. * * Permissions: * - Accessible to tenant admins. * @returns LinkCourseResponse * @throws ApiError */ public static aiMentorOrgsMentorsLinkCourseRetrieve({ mentor, org, }: { mentor: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor}/link-course/', path: { 'mentor': mentor, 'org': org, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` (`mentor` → `agent`) and will be removed in a future release. * * API endpoint to link mentor with a course and enable guided mode. * * Permissions: * - Accessible to tenant admins. * @returns LinkCourseResponse * @throws ApiError */ public static aiMentorOrgsMentorsLinkCourseCreate({ mentor, org, requestBody, }: { mentor: string, org: string, requestBody: LinkCourseRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/{mentor}/link-course/', path: { 'mentor': mentor, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * Get accessible mentors by email * **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/by-email/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/by-email/` (`mentor` → `agent`) and will be removed in a future release. * * Returns a list of mentor unique IDs that a user can access via email in the specified organization. * @returns AccessibleMentorsByEmailResponse * @throws ApiError */ public static aiMentorOrgsMentorsByEmailCreate({ org, requestBody, }: { org: string, requestBody?: AccessibleMentorsByEmailRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/mentors/by-email/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request parameters`, 404: `User or platform not found`, }, }); } /** * Create or update metadata for a mentor. * * Args: * request: The HTTP request containing the metadata. * org: The organization/tenant identifier. * * Returns: * Response: The created or updated mentor metadata. * * Raises: * BadRequest: If the provided data is invalid. * @returns MentorMetadata * @throws ApiError */ public static aiMentorOrgsMetadataCreate({ org, requestBody, }: { org: string, requestBody: MentorMetadata, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/metadata/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, }, }); } /** * Retrieve mentor configuration for offline use. * * Returns the same data as the mentor settings endpoint, including * system_prompt, LLM config, safety/moderation settings, and UI settings. * * Args: * request: The HTTP request. * org: Organization/platform key. * mentor_unique_id: The unique ID (UUID) of the mentor. * * Returns: * Response: Full mentor settings data. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsOfflineAgentsConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Offline mode not enabled`, 404: `Mentor not found`, }, }); } /** * Retrieve paginated list of documents for offline use. * * Args: * request: The HTTP request. * org: Organization/platform key. * mentor_unique_id: The unique ID (UUID) of the mentor. * * Query Parameters: * limit: Number of results per page (default: 100, max: 500). * offset: Number of results to skip. * search: Optional search filter for document_name or url. * * Returns: * Response: Paginated list of documents with S3 URLs. * @returns PaginatedOfflineDocumentList * @throws ApiError */ public static aiMentorOrgsOfflineAgentsDatasetsList({ mentorUniqueId, org, limit, offset, search, }: { mentorUniqueId: string, org: string, /** * Number of results per page (default: 100, max: 500) */ limit?: number, /** * Number of results to skip for pagination */ offset?: number, /** * Search query to filter documents by name or URL */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/datasets/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'limit': limit, 'offset': offset, 'search': search, }, errors: { 403: `Offline mode not enabled`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/config/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve mentor configuration for offline use. * * Returns the same data as the mentor settings endpoint, including * system_prompt, LLM config, safety/moderation settings, and UI settings. * * Args: * request: The HTTP request. * org: Organization/platform key. * mentor_unique_id: The unique ID (UUID) of the mentor. * * Returns: * Response: Full mentor settings data. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsOfflineMentorsConfigRetrieve({ mentorUniqueId, org, }: { mentorUniqueId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/offline/mentors/{mentor_unique_id}/config/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, errors: { 403: `Offline mode not enabled`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/datasets/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/datasets/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve paginated list of documents for offline use. * * Args: * request: The HTTP request. * org: Organization/platform key. * mentor_unique_id: The unique ID (UUID) of the mentor. * * Query Parameters: * limit: Number of results per page (default: 100, max: 500). * offset: Number of results to skip. * search: Optional search filter for document_name or url. * * Returns: * Response: Paginated list of documents with S3 URLs. * @returns PaginatedOfflineDocumentList * @throws ApiError */ public static aiMentorOrgsOfflineMentorsDatasetsList({ mentorUniqueId, org, limit, offset, search, }: { mentorUniqueId: string, org: string, /** * Number of results per page (default: 100, max: 500) */ limit?: number, /** * Number of results to skip for pagination */ offset?: number, /** * Search query to filter documents by name or URL */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/offline/mentors/{mentor_unique_id}/datasets/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, }, query: { 'limit': limit, 'offset': offset, 'search': search, }, errors: { 403: `Offline mode not enabled`, 404: `Mentor not found`, }, }); } /** * List projects * Retrieve a list of projects with optional filtering and search. * @returns PaginatedProjectList * @throws ApiError */ public static aiMentorOrgsProjectsList({ org, limit, offset, ordering, search, shared, sort, username, }: { org: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * Which field to use when ordering the results. */ ordering?: string, /** * Search in project name and description */ search?: string, /** * Filter by shared status (true/false) */ shared?: boolean, /** * Order by field (prefix with - for descending). Example: name or -created_at */ sort?: string, /** * Filter projects by owner's username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/projects/', path: { 'org': org, }, query: { 'limit': limit, 'offset': offset, 'ordering': ordering, 'search': search, 'shared': shared, 'sort': sort, 'username': username, }, }); } /** * Create a new project * Create a new project with optional mentors. * @returns Project * @throws ApiError */ public static aiMentorOrgsProjectsCreate({ org, requestBody, }: { org: string, requestBody: Project, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/projects/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data provided`, }, }); } /** * Retrieve a project * Get detailed information about a specific project including its mentors. * @returns Project * @throws ApiError */ public static aiMentorOrgsProjectsRetrieve({ id, org, }: { id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/projects/{id}/', path: { 'id': id, 'org': org, }, errors: { 404: `Project not found`, }, }); } /** * Update a project * Update project information and optionally modify its mentors. * @returns Project * @throws ApiError */ public static aiMentorOrgsProjectsUpdate({ id, org, requestBody, }: { id: number, org: string, requestBody: Project, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/projects/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data provided`, 403: `Permission denied`, }, }); } /** * API ViewSet for managing projects. * * Projects are groups of mentors that can be created by anyone (students and tenant admins). * They serve as a way to organize and group related mentors together. * * Projects can be: * - Personal (shared=False): Only visible to their owners * - Shared (shared=True): Visible to platform admins and potentially other users * * Projects are accessed through integrated URLs within the mentor router: * /orgs//projects/ - All accessible projects in a platform (admin access) * /orgs//projects// - Specific project (admin access) * /orgs//users//projects/ - User's projects (user access) * /orgs//users//projects// - User's specific project * * Query Parameters: * - username: Filter projects by owner's username (admin routes only) * - shared: Filter by shared status (true/false) * - search: Search in name and description * - sort: Order by field (prefix with - for descending). Example: sort=name or sort=-created_at * * Permissions: * - GET: Accessible to project owners and platform admins (for shared projects) * - POST: Any authenticated user can create projects * - PUT, PATCH, DELETE: Accessible to project owners only * @returns Project * @throws ApiError */ public static aiMentorOrgsProjectsPartialUpdate({ id, org, requestBody, }: { id: number, org: string, requestBody?: PatchedProject, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/projects/{id}/', path: { 'id': id, 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a project * Delete a project permanently. * @returns void * @throws ApiError */ public static aiMentorOrgsProjectsDestroy({ id, org, }: { id: number, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/projects/{id}/', path: { 'id': id, 'org': org, }, errors: { 403: `Permission denied`, }, }); } /** * Retrieve existing questions. * * Args: * request: The HTTP request. * * Returns: * Response: The existing questions. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsQuizCustomizerRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/quiz-customizer/', path: { 'org': org, }, }); } /** * Generate follow-up questions based on initial questions. * * Args: * request: The HTTP request containing the initial questions. * * Returns: * Response: The generated follow-up questions. * * Raises: * BadRequest: If the provided data is invalid. * @returns QuestionResponse * @throws ApiError */ public static aiMentorOrgsQuizCustomizerCreate({ org, requestBody, }: { org: string, requestBody: QuestionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/quiz-customizer/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, }, }); } /** * Retrieve or create a chat session with a mentor. * * Passing `null` as `tools` results in using all tools assigned to the mentor. * To specify that no tools be used, pass an empty list. * * Session identity is derived from the request itself, never from user * input: an authenticated caller is attributed via `request.user` * (tenant-scoped to `org`), while an anonymous caller gets no student * linkage and is only permitted on `allow_anonymous` mentors. * * Args: * request: HTTP request containing mentor details. * org: Organization key identifier. * * Returns: * Response: JSON object containing the session ID. * * Raises: * Http404: If the mentor is not found. * ValidationError: If the username is invalid. * ValidationError: If one or more tool slugs are invalid. * @returns ChatSessionResponse * @throws ApiError */ public static aiMentorOrgsSessionsCreate({ org, requestBody, }: { org: string, requestBody: ChatSessionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/sessions/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * List agent spend caps * List every agent-scoped spend cap configured for the platform. Each item includes mentor identity fields alongside the spend-cap settings and reconciled counters. Optionally filter to one mentor with the mentor's unique_id. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsSpendCapsAgentsList({ org, mentor, }: { org: string, /** * Optional mentor unique_id to filter the agent caps list */ mentor?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/spend-caps/agents/', path: { 'org': org, }, query: { 'mentor': mentor, }, errors: { 403: `Permission denied`, 404: `Mentor not found`, }, }); } /** * Get a user's spend-cap status * Read-only, learner-safe spend-cap status for ``user_id``. A non-admin member may read only their own status; an admin may read any user's. Only the coarse zone and fill percentage are returned — never raw spend or limit dollars. Pass ``?mentor=`` to include that agent's cap and the user's per-agent cap. * @returns SpendCapStatusSummary * @throws ApiError */ public static aiMentorOrgsSpendCapsStatusRetrieve({ org, userId, mentor, }: { org: string, userId: string, /** * Optional mentor unique_id to include agent-scoped caps */ mentor?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/spend-caps/status/{user_id}/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor': mentor, }, errors: { 400: `mentor must be a valid unique_id`, 403: `Permission denied`, }, }); } /** * Get the tenant spend cap * Retrieve the singleton tenant-scoped spend cap for the platform. Requires an RBAC policy grant on the platform's spend caps. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsSpendCapsTenantRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/spend-caps/tenant/', path: { 'org': org, }, errors: { 403: `Permission denied`, 404: `No tenant spend cap configured`, }, }); } /** * Create or update the tenant spend cap * Upsert the singleton tenant-scoped spend cap. Returns 201 on first write and 200 on update. Spend counters are reconciled from ClickHouse and ignored if supplied in the body. * @returns SpendCap * @throws ApiError */ public static aiMentorOrgsSpendCapsTenantUpdate({ org, requestBody, }: { org: string, requestBody: SpendCap, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/spend-caps/tenant/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error`, 403: `Permission denied`, 404: `Platform not found`, }, }); } /** * Delete the tenant spend cap * Remove the singleton tenant-scoped spend cap for the platform. * @returns void * @throws ApiError */ public static aiMentorOrgsSpendCapsTenantDestroy({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/spend-caps/tenant/', path: { 'org': org, }, errors: { 403: `Permission denied`, 404: `No tenant spend cap configured`, }, }); } /** * Create or modify a trigger. * * Args: * request: The HTTP request containing the trigger data. * org: The organization/tenant identifier. * * Returns: * Response: The created or updated trigger details. * * Raises: * BadRequest: If the provided data is invalid or missing required parameters. * @returns TriggerResponse * @throws ApiError */ public static aiMentorOrgsTriggerCreate({ org, requestBody, }: { org: string, requestBody: TriggerRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/trigger/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or missing required parameters`, }, }); } /** * Retrieve available trigger templates. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * * Returns: * Response: A dictionary of available trigger templates and their required parameters. * * Raises: * BadRequest: If the request is invalid. * @returns any Dictionary of trigger templates and their required parameters * @throws ApiError */ public static aiMentorOrgsTriggerTemplatesRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/trigger-templates/', path: { 'org': org, }, errors: { 400: `Invalid request`, }, }); } /** * Retrieve details of a specific trigger. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * slug: The unique slug identifier of the trigger. * * Returns: * Response: The details of the specified trigger. * * Raises: * Http404: If the specified trigger does not exist. * @returns TriggerResponse * @throws ApiError */ public static aiMentorOrgsTriggerRetrieve({ org, slug, }: { org: string, slug: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/trigger/{slug}/', path: { 'org': org, 'slug': slug, }, errors: { 404: `Trigger not found`, }, }); } /** * Delete a specific trigger. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * slug: The unique slug identifier of the trigger to delete. * * Returns: * Response: A confirmation of the deletion status. * * Raises: * BadRequest: If the specified trigger does not exist. * @returns any Trigger successfully deleted * @throws ApiError */ public static aiMentorOrgsTriggerDeletionCreate({ org, slug, }: { org: string, slug: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/trigger/{slug}/deletion/', path: { 'org': org, 'slug': slug, }, errors: { 400: `Trigger not found or invalid request`, }, }); } /** * Retrieve a list of mentors. * * Returns: * - List of mentors matching the filters. * @returns PaginatedMentorList * @throws ApiError */ public static aiMentorOrgsUsersList({ org, userId, departmentId, filterBy, isFeatured, metadataKey, metadataValue, page, pageSize, returnSessionInformation, search, visibility, }: { org: string, userId: string, /** * Department to filter by */ departmentId?: number, /** * Filter options include, date, name, default is date */ filterBy?: string, /** * Whether the mentor is featured or not */ isFeatured?: boolean, /** * Metadata key to be queried with */ metadataKey?: string, /** * Metadata value to be filter for */ metadataValue?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * Declares if session information should be included in the mentor data */ returnSessionInformation?: boolean, /** * Search agents by name/description. Results are ranked so that exact and then prefix matches on name are returned first. Falls back to the `name` query param if not provided (undeclared here since `name` is also this viewset's URL lookup field, and declaring it would collide in the generated API schema/clients). */ search?: string, /** * visibility type to be queried with */ visibility?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'filter_by': filterBy, 'is_featured': isFeatured, 'metadata_key': metadataKey, 'metadata_value': metadataValue, 'page': page, 'page_size': pageSize, 'return_session_information': returnSessionInformation, 'search': search, 'visibility': visibility, }, }); } /** * Create a new mentor. * Body Parameters: * - name: Mentor name. * - unique_id: Unique identifier. * - platform_key: Associated platform. * - metadata: Additional mentor attributes. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersCreate({ org, userId, requestBody, departmentId, filterBy, isFeatured, metadataKey, metadataValue, returnSessionInformation, search, visibility, }: { org: string, userId: string, requestBody: MentorCreate, /** * Department to filter by */ departmentId?: number, /** * Filter options include, date, name, default is date */ filterBy?: string, /** * Whether the mentor is featured or not */ isFeatured?: boolean, /** * Metadata key to be queried with */ metadataKey?: string, /** * Metadata value to be filter for */ metadataValue?: string, /** * Declares if session information should be included in the mentor data */ returnSessionInformation?: boolean, /** * Search agents by name/description. Results are ranked so that exact and then prefix matches on name are returned first. Falls back to the `name` query param if not provided (undeclared here since `name` is also this viewset's URL lookup field, and declaring it would collide in the generated API schema/clients). */ search?: string, /** * visibility type to be queried with */ visibility?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'filter_by': filterBy, 'is_featured': isFeatured, 'metadata_key': metadataKey, 'metadata_value': metadataValue, 'return_session_information': returnSessionInformation, 'search': search, 'visibility': visibility, }, body: requestBody, mediaType: 'application/json', }); } /** * API ViewSet for managing mentors. * * Provides endpoints to retrieve, create, update, and delete mentor data. * * Permissions: * - Accessible to both tenant admins and students. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersRetrieve({ name, org, userId, departmentId, filterBy, isFeatured, metadataKey, metadataValue, returnSessionInformation, search, visibility, }: { name: string, org: string, userId: string, /** * Department to filter by */ departmentId?: number, /** * Filter options include, date, name, default is date */ filterBy?: string, /** * Whether the mentor is featured or not */ isFeatured?: boolean, /** * Metadata key to be queried with */ metadataKey?: string, /** * Metadata value to be filter for */ metadataValue?: string, /** * Declares if session information should be included in the mentor data */ returnSessionInformation?: boolean, /** * Search agents by name/description. Results are ranked so that exact and then prefix matches on name are returned first. Falls back to the `name` query param if not provided (undeclared here since `name` is also this viewset's URL lookup field, and declaring it would collide in the generated API schema/clients). */ search?: string, /** * visibility type to be queried with */ visibility?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/{name}/', path: { 'name': name, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'filter_by': filterBy, 'is_featured': isFeatured, 'metadata_key': metadataKey, 'metadata_value': metadataValue, 'return_session_information': returnSessionInformation, 'search': search, 'visibility': visibility, }, }); } /** * Update a mentor's details with RBAC enforcement and custom serializer handling. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersUpdate({ name, org, userId, requestBody, departmentId, filterBy, isFeatured, metadataKey, metadataValue, returnSessionInformation, search, visibility, }: { name: string, org: string, userId: string, requestBody: MentorCreate, /** * Department to filter by */ departmentId?: number, /** * Filter options include, date, name, default is date */ filterBy?: string, /** * Whether the mentor is featured or not */ isFeatured?: boolean, /** * Metadata key to be queried with */ metadataKey?: string, /** * Metadata value to be filter for */ metadataValue?: string, /** * Declares if session information should be included in the mentor data */ returnSessionInformation?: boolean, /** * Search agents by name/description. Results are ranked so that exact and then prefix matches on name are returned first. Falls back to the `name` query param if not provided (undeclared here since `name` is also this viewset's URL lookup field, and declaring it would collide in the generated API schema/clients). */ search?: string, /** * visibility type to be queried with */ visibility?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/{name}/', path: { 'name': name, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'filter_by': filterBy, 'is_featured': isFeatured, 'metadata_key': metadataKey, 'metadata_value': metadataValue, 'return_session_information': returnSessionInformation, 'search': search, 'visibility': visibility, }, body: requestBody, mediaType: 'application/json', }); } /** * API ViewSet for managing mentors. * * Provides endpoints to retrieve, create, update, and delete mentor data. * * Permissions: * - Accessible to both tenant admins and students. * @returns MentorCreate * @throws ApiError */ public static aiMentorOrgsUsersPartialUpdate({ name, org, userId, departmentId, filterBy, isFeatured, metadataKey, metadataValue, returnSessionInformation, search, visibility, requestBody, }: { name: string, org: string, userId: string, /** * Department to filter by */ departmentId?: number, /** * Filter options include, date, name, default is date */ filterBy?: string, /** * Whether the mentor is featured or not */ isFeatured?: boolean, /** * Metadata key to be queried with */ metadataKey?: string, /** * Metadata value to be filter for */ metadataValue?: string, /** * Declares if session information should be included in the mentor data */ returnSessionInformation?: boolean, /** * Search agents by name/description. Results are ranked so that exact and then prefix matches on name are returned first. Falls back to the `name` query param if not provided (undeclared here since `name` is also this viewset's URL lookup field, and declaring it would collide in the generated API schema/clients). */ search?: string, /** * visibility type to be queried with */ visibility?: string, requestBody?: PatchedMentorCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/{name}/', path: { 'name': name, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'filter_by': filterBy, 'is_featured': isFeatured, 'metadata_key': metadataKey, 'metadata_value': metadataValue, 'return_session_information': returnSessionInformation, 'search': search, 'visibility': visibility, }, body: requestBody, mediaType: 'application/json', }); } /** * Soft delete a mentor. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersDestroy({ name, org, userId, departmentId, filterBy, isFeatured, metadataKey, metadataValue, returnSessionInformation, search, visibility, }: { name: string, org: string, userId: string, /** * Department to filter by */ departmentId?: number, /** * Filter options include, date, name, default is date */ filterBy?: string, /** * Whether the mentor is featured or not */ isFeatured?: boolean, /** * Metadata key to be queried with */ metadataKey?: string, /** * Metadata value to be filter for */ metadataValue?: string, /** * Declares if session information should be included in the mentor data */ returnSessionInformation?: boolean, /** * Search agents by name/description. Results are ranked so that exact and then prefix matches on name are returned first. Falls back to the `name` query param if not provided (undeclared here since `name` is also this viewset's URL lookup field, and declaring it would collide in the generated API schema/clients). */ search?: string, /** * visibility type to be queried with */ visibility?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/{name}/', path: { 'name': name, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'filter_by': filterBy, 'is_featured': isFeatured, 'metadata_key': metadataKey, 'metadata_value': metadataValue, 'return_session_information': returnSessionInformation, 'search': search, 'visibility': visibility, }, }); } /** * Retrieve details of a specific user chat feedback entry. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * feedback_id: The ID of the feedback entry to retrieve. * * Returns: * Response: The feedback entry details. * * Raises: * NotFound: If the specified feedback entry does not exist. * Forbidden: If the user doesn't have permission to access this feedback. * @returns UserChatFeedback * @throws ApiError */ public static aiMentorOrgsUsersAgentFeedbackRetrieve({ feedbackId, org, userId, }: { feedbackId: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/', path: { 'feedback_id': feedbackId, 'org': org, 'user_id': userId, }, errors: { 404: `Feedback not found`, }, }); } /** * Update an existing user chat feedback entry. * * Args: * request: The HTTP request containing the updated feedback data. * org: The organization/tenant identifier. * feedback_id: The ID of the feedback entry to update. * * Returns: * Response: The updated feedback entry. * * Raises: * NotFound: If the specified feedback entry does not exist. * Forbidden: If the user doesn't have permission to update this feedback. * BadRequest: If the provided data is invalid or the mentor does not exist. * @returns UserChatFeedback * @throws ApiError */ public static aiMentorOrgsUsersAgentFeedbackUpdate({ feedbackId, org, userId, requestBody, }: { feedbackId: number, org: string, userId: string, requestBody: UserChatFeedback, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/', path: { 'feedback_id': feedbackId, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or mentor not found`, 404: `Feedback not found`, }, }); } /** * Create a new user chat feedback entry. * * Args: * request: The HTTP request containing the feedback data. * org: The organization/tenant identifier. * * Returns: * Response: The created feedback entry. * * Raises: * BadRequest: If the provided data is invalid or the mentor does not exist. * Forbidden: If the user doesn't have permission to create this feedback. * @returns UserChatFeedback * @throws ApiError */ public static aiMentorOrgsUsersAgentFeedbackCreateCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: UserChatFeedback, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/create/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or mentor not found`, }, }); } /** * Retrieve available LLMs for a user. * @returns LLMResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentLlmsList({ org, userId, mentorId, }: { org: string, userId: string, mentorId?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-llms/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor_id': mentorId, }, }); } /** * List all mentor-specific memories for a user. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentMemoriesRetrieve({ org, userId, email, endDate, mentor, startDate, userId, }: { org: string, userId: string, /** * Filter by user email (admin only) */ email?: string, /** * Filter memories created before this ISO date */ endDate?: string, /** * Filter by mentor unique_id */ mentor?: string, /** * Filter memories created after this ISO date */ startDate?: string, /** * Filter by user_id (admin only) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-memories/', path: { 'org': org, 'user_id': userId, }, query: { 'email': email, 'end_date': endDate, 'mentor': mentor, 'start_date': startDate, 'user_id': userId, }, }); } /** * Retrieve the list of available mentor tools. * @returns ToolResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentToolsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-tools/', path: { 'org': org, 'user_id': userId, }, }); } /** * Retrieve Mentor Types * @returns MentorType * @throws ApiError */ public static aiMentorOrgsUsersAgentTypesList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-types/', path: { 'org': org, 'user_id': userId, }, }); } /** * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersAgentWithSettingsCreate({ org, userId, formData, }: { org: string, userId: string, formData: MentorFromTemplateWithSettingRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns MentorFromTemplate * @throws ApiError */ public static aiMentorOrgsUsersAgentWithSettingsUpdate({ org, userId, formData, }: { org: string, userId: string, formData: MentorFromTemplate, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns MentorFromTemplate * @throws ApiError */ public static aiMentorOrgsUsersAgentWithSettingsPartialUpdate({ org, userId, formData, }: { org: string, userId: string, formData?: PatchedMentorFromTemplate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentWithSettingsDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/', path: { 'org': org, 'user_id': userId, }, }); } /** * Retrieve the list of mentor audiences. * * Returns: * - 200: List of mentor audiences. * @returns MentorAudience * @throws ApiError */ public static aiMentorOrgsUsersAgentAudienceList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/', path: { 'org': org, 'user_id': userId, }, }); } /** * Create a new mentor audience. * * Accessible to tenant admins only. * * Returns: * - 201: Created mentor audience. * - 401: Unauthorized. * @returns MentorAudience * @throws ApiError */ public static aiMentorOrgsUsersAgentAudienceCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorAudience, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 401: `Unauthorized - Only tenant admins can create mentor audiences.`, }, }); } /** * Delete a mentor audience. * * Accessible to tenant admins only. * * Returns: * - 204: No content. * - 400: Bad request if audience name is missing. * - 404: Not found if audience does not exist. * - 401: Unauthorized. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentAudienceDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/', path: { 'org': org, 'user_id': userId, }, errors: { 400: `Bad Request - Invalid data.`, 401: `Unauthorized - Only tenant admins can delete mentor audiences.`, 404: `Not Found - Audience does not exist.`, }, }); } /** * Retrieve a list of mentor categories. * * Returns: * 200: A list of mentor categories. * @returns MentorCategory * @throws ApiError */ public static aiMentorOrgsUsersAgentCategoriesList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/', path: { 'org': org, 'user_id': userId, }, }); } /** * Create a new mentor category. * * Accessible only to tenant admins. * * Returns: * 200: Details of the created mentor category. * @returns MentorCategory * @throws ApiError */ public static aiMentorOrgsUsersAgentCategoriesCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorCategoryCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a mentor category. * * Accessible only to tenant admins. * * Returns: * 204: "No content" when Delete succeeded. * 400: Bad request data received * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentCategoriesDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/', path: { 'org': org, 'user_id': userId, }, }); } /** * Seed initial mentors in a tenant. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user initiating the seeding. * * Returns: * Response: A success message with details about the seeded mentors. * * Raises: * BadRequest: If the seeding process fails. * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersAgentSeedRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/', path: { 'org': org, 'user_id': userId, }, errors: { 400: `Seeding failed`, }, }); } /** * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersAgentSeedCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: SeedMentorsView, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersAgentSeedUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: SeedMentorsView, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersAgentSeedPartialUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: PatchedSeedMentorsView, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentSeedDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/', path: { 'org': org, 'user_id': userId, }, }); } /** * List mentor-specific memories grouped by category. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentMemoriesRetrieve({ mentorId, org, userId, email, endDate, myMemory, startDate, userId, }: { mentorId: string, org: string, userId: string, /** * Filter by user email (ignored when my_memory=true) */ email?: string, /** * Filter memories created before this ISO date */ endDate?: string, /** * If true, returns only the authenticated user's memories (skips RBAC and user_id filter) */ myMemory?: boolean, /** * Filter memories created after this ISO date */ startDate?: string, /** * Filter by user_id (ignored when my_memory=true) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/', path: { 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, query: { 'email': email, 'end_date': endDate, 'my_memory': myMemory, 'start_date': startDate, 'user_id': userId, }, }); } /** * Create a new mentor-specific memory. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentMemoriesCreate({ mentorId, org, userId, }: { mentorId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/', path: { 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, }); } /** * List mentor-specific memories with pagination. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentMemoriesListRetrieve({ mentorId, org, userId, category, email, endDate, myMemory, page, pageSize, startDate, userId, }: { mentorId: string, org: string, userId: string, /** * Filter by category slug */ category?: string, /** * Filter by user email (ignored when my_memory=true) */ email?: string, /** * Filter memories created before this ISO date */ endDate?: string, /** * If true, returns only the authenticated user's memories (skips RBAC and user_id filter) */ myMemory?: boolean, /** * Page number */ page?: number, /** * Number of results per page (max 100) */ pageSize?: number, /** * Filter memories created after this ISO date */ startDate?: string, /** * Filter by user_id (ignored when my_memory=true) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories-list/', path: { 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, query: { 'category': category, 'email': email, 'end_date': endDate, 'my_memory': myMemory, 'page': page, 'page_size': pageSize, 'start_date': startDate, 'user_id': userId, }, }); } /** * Update a mentor-specific memory (RBAC ownership-aware). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentMemoriesPartialUpdate({ memoryId, mentorId, org, userId, }: { memoryId: number, mentorId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/', path: { 'memory_id': memoryId, 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, }); } /** * Delete a mentor-specific memory (RBAC ownership-aware). * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentMemoriesDestroy({ memoryId, mentorId, org, userId, }: { memoryId: number, mentorId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/', path: { 'memory_id': memoryId, 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, }); } /** * Retrieve details of a specific mentor by slug or name. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Retrieve evaluation criteria for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve evaluations for. * * Returns: * Response: The evaluation criteria for the mentor. * * Raises: * NotFound: If the specified mentor or evaluations do not exist. * @returns MentorEval * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentEvalRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or evaluations not found`, }, }); } /** * Create or update evaluation criteria for a specific mentor. * * Args: * request: The HTTP request containing the evaluation data. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to create/update evaluations for. * * Returns: * Response: The created or updated evaluation criteria. * * Raises: * BadRequest: If the provided data is invalid or the mentor does not exist. * @returns MentorEval * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentEvalCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: MentorEvalRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or mentor not found`, }, }); } /** * Run an evaluation for a specific mentor. * * Args: * request: The HTTP request containing the evaluation ID. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to evaluate. * * Returns: * Response: The ID of the generated evaluation report. * * Raises: * BadRequest: If the evaluation ID is invalid or the mentor does not match. * @returns any Evaluation execution started successfully * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentEvalExecutionCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: RunMentorEval, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval-execution/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid evaluation ID or mentor mismatch`, }, }); } /** * Endpoint to get user settings for a mentor. * * * GET https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/mentors/unique-id/mentor-user-settings/ * * Sample response * ``` * {"reference_saved_memories": true} * ``` * @returns MentorUserSetting * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentUserSettingsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to set user settings for a mentor. * * * POST https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/mentors/unique-id/mentor-user-settings/ * * Sample request * ``` * {"reference_saved_memories": true} * ``` * * Sample response * ``` * {"reference_saved_memories": true} * ``` * @returns MentorUserSetting * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentUserSettingsCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: MentorUserSetting, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin to set the auditlog actor context for DRF views. * * For Django auth.User (admin users): Uses auditlog's native actor FK. * For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry. * * IMPORTANT: This mixin only works for views that DO NOT override the * HTTP/action methods (post, put, patch, delete, create, update, partial_update, * destroy). For views that define their own methods, use the @with_auditlog_actor * decorator on those methods instead. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentUserSettingsUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Mixin to set the auditlog actor context for DRF views. * * For Django auth.User (admin users): Uses auditlog's native actor FK. * For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry. * * IMPORTANT: This mixin only works for views that DO NOT override the * HTTP/action methods (post, put, patch, delete, create, update, partial_update, * destroy). For views that define their own methods, use the @with_auditlog_actor * decorator on those methods instead. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentUserSettingsPartialUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Mixin to set the auditlog actor context for DRF views. * * For Django auth.User (admin users): Uses auditlog's native actor FK. * For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry. * * IMPORTANT: This mixin only works for views that DO NOT override the * HTTP/action methods (post, put, patch, delete, create, update, partial_update, * destroy). For views that define their own methods, use the @with_auditlog_actor * decorator on those methods instead. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentsAgentUserSettingsDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Retrieve tools available for a particular mentor. The 'is_allowed' field indicates whether the tool is compatible with the mentor's current LLM configuration. * @returns ToolResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsAvailableToolsList({ mentor, org, userId, ordering, search, }: { mentor: string, org: string, userId: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A search term. */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/available-tools/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'ordering': ordering, 'search': search, }, }); } /** * Generate IBL Call Pro authentication parameters for audio calls. * * This endpoint creates the necessary authentication tokens and parameters * for connecting to a IBL Call Pro room for audio communication with a mentor. * * Args: * request: The HTTP request object containing the required parameters. * org: The organization/tenant identifier. * user_id: The ID of the user requesting authentication. * * Returns: * Response: IBL Call Pro authentication parameters including URL, room name, * participant name, and authentication token. * * Raises: * ValidationError: If the request parameters are invalid. * BadRequest: If the IBL Call Pro credentials are not properly configured. * @returns CallAuthenticationResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsCreateCallCredentialsCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: CallAuthenticationRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/create-call-credentials/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request parameters or improperly configured IBL Call Pro credentials`, 401: `Authentication failed`, 404: `No mentor or session found`, }, }); } /** * Retrieve memory components for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve memory for. * * Returns: * Response: The memory components for the mentor. * * Raises: * NotFound: If the specified mentor or memory does not exist. * @returns MemoryComponentResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsCurrentMemoryRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or memory not found`, }, }); } /** * Update memory components for a specific mentor. * * Args: * request: The HTTP request containing the updated memory data. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to update memory for. * * Returns: * Response: The updated memory components for the mentor. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If the specified mentor does not exist. * @returns QuestionResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsCurrentMemoryUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: QuestionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Mentor not found`, }, }); } /** * Retrieve the current custom voice settings for a mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the mentor link. * mentor: The unique identifier of the mentor. * * Returns: * Response: The current custom voice settings. * * Raises: * NotFound: If the specified mentor or student does not exist. * @returns MentorCustomVoiceResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsCustomVoiceRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or student not found`, }, }); } /** * Set a custom voice for a mentor. * * This endpoint allows setting a custom voice for a specific mentor, * either using the default voice provider or Elevenlabs. * * Args: * request: The HTTP request containing the voice provider and name. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the mentor link. * mentor: The unique identifier of the mentor. * * Returns: * Response: The updated custom voice settings. * * Raises: * BadRequest: If the provided data is invalid or the voice does not exist. * NotFound: If the mentor or student does not exist. * @returns MentorCustomVoiceResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsCustomVoiceCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: MentorCustomVoice, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or voice not found`, 404: `Mentor or student not found`, }, }); } /** * Generate audio from text using a mentor's custom voice. * * This endpoint converts the provided text to speech using the * custom voice configured for the specified mentor. * * Args: * request: The HTTP request containing the text to convert. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the mentor link. * mentor: The unique identifier of the mentor. * * Returns: * Response: An MP3 audio file of the synthesized speech. * * Raises: * BadRequest: If the text is empty, credentials are not found, or custom voice is not set. * NotFound: If the mentor or student does not exist. * @returns any MP3 audio file * @throws ApiError */ public static aiMentorOrgsUsersAgentsCustomVoiceTtsCreate({ mentor, org, userId, formData, }: { mentor: string, org: string, userId: string, formData?: Record, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice-tts/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Invalid data, credentials not found, or custom voice not set`, 404: `Mentor or student not found`, }, }); } /** * Retrieve the user's default mentor for this tenant. * * Returns ``null`` when the user has not set a default mentor. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsDefaultRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * Set (or replace) the user's default mentor for this tenant. * * The unique (student, platform) constraint guarantees at most one * default mentor per user per tenant; setting a new one replaces any * existing default. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsDefaultUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor, student or platform not found`, }, }); } /** * Clear the user's default mentor for this tenant. * * Idempotent: returns 204 whether or not a default was set. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentsDefaultDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * Update scenarios for a specific mentor. * * Args: * request: The HTTP request containing the updated scenarios. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to update scenarios for. * * Returns: * Response: The updated scenarios for the mentor. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If the specified mentor does not exist. * @returns MentorScenario * @throws ApiError */ public static aiMentorOrgsUsersAgentsEditScenariosUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: MentorScenario, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/edit-scenarios/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Mentor not found`, }, }); } /** * Fork (clone) an existing mentor. * * Args: * request: The HTTP request containing the fork parameters. * org: The organization/tenant identifier. * mentor: The identifier of the mentor to fork. * user_id: The ID of the user initiating the fork. * * Returns: * Response: The newly created forked mentor. * * Raises: * BadRequest: If the provided data is invalid or the fork operation fails. * NotFound: If the specified mentor does not exist. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsForkCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: MentorFork, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or fork failed`, 404: `Mentor not found`, }, }); } /** * API view for forking (cloning) a mentor. * * This view allows users to create a copy of an existing mentor * with its settings and configurations. * * Permissions: * - Restricted to tenant admins and the student themselves * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsForkUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * API view for forking (cloning) a mentor. * * This view allows users to create a copy of an existing mentor * with its settings and configurations. * * Permissions: * - Restricted to tenant admins and the student themselves * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsForkPartialUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * API view for forking (cloning) a mentor. * * This view allows users to create a copy of an existing mentor * with its settings and configurations. * * Permissions: * - Restricted to tenant admins and the student themselves * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentsForkDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Retrieve memory history entries for a specific mentor and user. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve memory history for. * mentor: The identifier of the mentor to retrieve memory history for. * * Returns: * Response: The memory history entries for the mentor and user. * * Raises: * NotFound: If the specified mentor or memory history does not exist. * @returns MemoryComponentMemoryDetail * @throws ApiError */ public static aiMentorOrgsUsersAgentsHistoricalMemoryRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/historical-memory/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or memory history not found`, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns MemoryProgress * @throws ApiError */ public static aiMentorOrgsUsersAgentsMemoryProgressRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-progress/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Retrieve memory settings for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve settings for. * * Returns: * Response: The memory settings for the mentor. * * Raises: * NotFound: If the specified mentor or settings do not exist. * @returns MentorMemorySettingsResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsMemorySettingsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or settings not found`, }, }); } /** * Endpoint for mentor memory item settings. * * Accessible to platform admins and superusers. * * Returns: * * 200: Change mentor memory component item. * * 400: When request is not valid. * @returns MentorMemorySettingsResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsMemorySettingsCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: MentorMemorySettingsRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Mentor not found`, }, }); } /** * Retrieve public mentor settings. * * Args: * request: HTTP request instance. * user_id: The ID of the user requesting settings. * mentor: The mentor identifier (name, slug, or unique_id). * org: The organization key. * * Returns: * Response containing the mentor settings or an error message. * @returns MentorSettingsPublic * @throws ApiError */ public static aiMentorOrgsUsersAgentsPublicSettingsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor not found.`, }, }); } /** * Return True if the token is valid and link is enabled, else False * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersAgentsPublicSharableLinkRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-sharable-link/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Retrieve a specific evaluation report. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor that was evaluated. * report_id: The ID of the evaluation report to retrieve. * * Returns: * Response: The detailed evaluation report. * * Raises: * BadRequest: If the report does not exist, does not match the mentor, or is still being generated. * @returns MentorEvalReport * @throws ApiError */ public static aiMentorOrgsUsersAgentsReportsAgentEvalReportRetrieve({ mentor, org, reportId, userId, }: { mentor: string, org: string, reportId: number, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/reports/{report_id}/agent-eval-report/', path: { 'mentor': mentor, 'org': org, 'report_id': reportId, 'user_id': userId, }, errors: { 400: `Report not found or still being generated`, }, }); } /** * Retrieve available scenarios for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve scenarios for. * * Returns: * Response: The available scenarios for the mentor. * * Raises: * NotFound: If the specified mentor or scenarios do not exist. * @returns MentorScenario * @throws ApiError */ public static aiMentorOrgsUsersAgentsScenariosRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/scenarios/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or scenarios not found`, }, }); } /** * Retrieve Mentor Settings * Fetch the settings of a mentor within an organization. Only accessible to tenant admins. * @returns MentorSettingsPublic * @throws ApiError */ public static aiMentorOrgsUsersAgentsSettingsRetrieve({ mentor, org, userId, departmentId, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, errors: { 404: `Mentor not found`, }, }); } /** * API view to retrieve and update mentor settings. * * Permissions: * - Only accessible to tenant admins. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsUsersAgentsSettingsCreate({ mentor, org, userId, departmentId, formData, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, formData?: MentorSettings, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Update Mentor Settings * Update various mentor settings including system prompts, tool permissions, and UI configurations. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsUsersAgentsSettingsUpdate({ mentor, org, userId, departmentId, formData, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, formData?: MentorSettingsRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Invalid request data`, 404: `Mentor not found`, }, }); } /** * API view to retrieve and update mentor settings. * * Permissions: * - Only accessible to tenant admins. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsUsersAgentsSettingsPartialUpdate({ mentor, org, userId, departmentId, formData, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, formData?: PatchedMentorSettings, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * API view to retrieve and update mentor settings. * * Permissions: * - Only accessible to tenant admins. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentsSettingsDestroy({ mentor, org, userId, departmentId, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, }); } /** * Enpoints to manage mentor shareable links * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharableLinkRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Enpoints to manage mentor shareable links * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharableLinkCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: ShareableMentorLink, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Enpoints to manage mentor shareable links * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharableLinkUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: ShareableMentorLink, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Enpoints to manage mentor shareable links * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharableLinkDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * List mentors sharing this mentor's system prompt * Share one mentor's system prompt with mentors in any tenant. * * The mentor in the URL is the **source**: its own `system_prompt` field is * the shared prompt, so there is no separate copy to keep in sync. Targets * resolve to it at chat time and keep their own prompt untouched, which is * what makes unsharing a clean restore. * * Permissions: * - The caller must be a platform admin of the source tenant *and* of * every tenant named in the request. Unlike forking, there is no * carve-out for the `main` platform. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharedPromptRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor not found`, }, }); } /** * Share this mentor's system prompt with more mentors * Adds targets to the source mentor's sharing list. Idempotent: a target already consuming this source is left as-is. Requires at least one target. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharedPromptCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: SharedSystemPromptRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid target or share would chain`, 403: `Not a platform admin of every tenant`, 404: `Mentor or target not found`, }, }); } /** * Replace the set of mentors sharing this system prompt * Share one mentor's system prompt with mentors in any tenant. * * The mentor in the URL is the **source**: its own `system_prompt` field is * the shared prompt, so there is no separate copy to keep in sync. Targets * resolve to it at chat time and keep their own prompt untouched, which is * what makes unsharing a clean restore. * * Permissions: * - The caller must be a platform admin of the source tenant *and* of * every tenant named in the request. Unlike forking, there is no * carve-out for the `main` platform. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharedPromptUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: SharedSystemPromptRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid target or share would chain`, 403: `Not a platform admin of every tenant`, }, }); } /** * Share one mentor's system prompt with mentors in any tenant. * * The mentor in the URL is the **source**: its own `system_prompt` field is * the shared prompt, so there is no separate copy to keep in sync. Targets * resolve to it at chat time and keep their own prompt untouched, which is * what makes unsharing a clean restore. * * Permissions: * - The caller must be a platform admin of the source tenant *and* of * every tenant named in the request. Unlike forking, there is no * carve-out for the `main` platform. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharedPromptPartialUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Stop sharing this mentor's system prompt * Removes the named targets from the sharing list. Omit `targets` to remove every consumer. Each unshared mentor goes back to its own preserved system prompt. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersAgentsSharedPromptDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 403: `Not a platform admin of every tenant`, }, }); } /** * Retrieve spaced repetition question statistics. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve statistics for. * mentor: The unique identifier of the mentor. * * Returns: * Response: Statistics about the user's performance on spaced repetition questions. * * Raises: * NotFound: If the mentor or student does not exist. * @returns SpacedRepetitionQuestionStats * @throws ApiError */ public static aiMentorOrgsUsersAgentsSpacedRepetitionQuestionStatsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-question-stats/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or student not found`, }, }); } /** * Retrieve a list of learning paths associated with a specific mentor and student. * * This endpoint uses the memory component to establish the learning context for a student * under the guidance of a mentor. It verifies that the provided organization identifier matches * the mentor's platform key, and then retrieves learning path tags associated with the student's * question cards. Each tag is annotated with the total number of question cards and the count of * cards with successful repetitions (i.e., correct answers). The learning paths are ordered by the * number of correct answers and limited to the top five entries. * * Args: * request: The HTTP request containing the necessary context. * org (str): The organization identifier/platform key. * user_id (str): The username of the student. * mentor (str): The unique identifier of the mentor. * *args: Additional positional arguments. * **kwargs: Additional keyword arguments. * * Returns: * Resp200onse: memory component detail infomrmation * * Raises: * NotFound: If the memory component for the specified mentor and student cannot be found, * or if the organization identifier does not match the mentor's platform key. * @returns QuestionCardTag * @throws ApiError */ public static aiMentorOrgsUsersAgentsSpacedRepetitionRecommendedPathsList({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or student not found`, }, }); } /** * Set a specific learning path for spaced repetition. * * Args: * request: The HTTP request containing the learning path. * org: The organization/tenant identifier. * user_id: The ID of the user to set the learning path for. * mentor: The unique identifier of the mentor. * * Returns: * Response: The set learning path. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If the learning path, mentor, or student does not exist. * @returns SpacedRepetitionLearningPath * @throws ApiError */ public static aiMentorOrgsUsersAgentsSpacedRepetitionRecommendedPathsUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: SpacedRepetitionLearningPath, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Learning path, mentor, or student not found`, }, }); } /** * Endpoint for getting the star status of a mentor. * * Accessible to students and admins. * * * Returns: * * 200: Star status. * * 400: When request is not valid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsStarRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * Endpoint for starring a mentor. * * Accessible to students and admins. * * * Returns: * * 200: Star status. * * 400: When request is not valid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsStarCreate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * GET `/api/orgs//users//mentors//summaries//` * * Endpoint to get mentor summary. The summary type can be `user` or `general`. * * Sample response: * ``` * {"rating": 3.9, "summary": "The mentor had a good chat."} * ``` * @returns MentorSummary * @throws ApiError */ public static aiMentorOrgsUsersAgentsSummariesRetrieve({ mentor, org, summaryType, userId, }: { mentor: string, org: string, summaryType: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/summaries/{summary_type}/', path: { 'mentor': mentor, 'org': org, 'summary_type': summaryType, 'user_id': userId, }, }); } /** * Remove a mentor from a user's starred list. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user unstarring the mentor. * mentor: The identifier of the mentor to unstar. * * Returns: * Response: The updated star status of the mentor. * * Raises: * NotFound: If the specified mentor or student does not exist. * BadRequest: If the request is invalid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersAgentsUnstarCreate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/unstar/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 400: `Invalid request`, 404: `Mentor or student not found`, }, }); } /** * List Mentor Audit Logs * Retrieve audit log entries for mentor-related models (Mentor, MentorSettings, Prompt, DocumentEmbedding) within a specific organization. Mentor owners can access audit logs for their own mentors when filtering by mentor. Supports filtering by mentor, action type, actor, and date range. * @returns PaginatedMentorAuditLogEntryList * @throws ApiError */ public static aiMentorOrgsUsersAgentsAuditLogsList({ org, userId, action, actorEmail, actorUsername, fromDate, limit, mentor, offset, toDate, }: { org: string, userId: string, /** * Filter by action type: 0=create, 1=update, 2=delete */ action?: 0 | 1 | 2, /** * Filter by actor's email */ actorEmail?: string, /** * Filter by actor's username */ actorUsername?: string, /** * Inclusive lower bound on timestamp (ISO8601 date, e.g., 2024-01-01) */ fromDate?: string, /** * Number of results to return per page. */ limit?: number, /** * Filter by mentor unique_id */ mentor?: string, /** * The initial index from which to return the results. */ offset?: number, /** * Inclusive upper bound on timestamp (ISO8601 date, e.g., 2024-12-31) */ toDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/agents/audit-logs/', path: { 'org': org, 'user_id': userId, }, query: { 'action': action, 'actor_email': actorEmail, 'actor_username': actorUsername, 'from_date': fromDate, 'limit': limit, 'mentor': mentor, 'offset': offset, 'to_date': toDate, }, errors: { 401: `Authentication required`, 403: `Not a platform administrator`, }, }); } /** * Endpoint to view and delete AI generated images for a user. * * AI Generated images are images generated during chat with AI. They are cached to allow retrieval and deletion. * * optional filtering parameters allowed are * - username: The username of the user for which this image was stored. * - provider: The provider used to generate the image. eg. openai, nvidia (nim), replicate. * - model: the text to image model on the provider used to generate the image. * * This endpoint is accessible to both students and platform admins. * @returns PaginatedAIGeneratedImageList * @throws ApiError */ public static aiMentorOrgsUsersAiGeneratedImagesList({ org, userId, model, ordering, page, pageSize, provider, search, username, }: { org: string, userId: string, model?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, provider?: string, /** * A search term. */ search?: string, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/ai-generated-images/', path: { 'org': org, 'user_id': userId, }, query: { 'model': model, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'provider': provider, 'search': search, 'username': username, }, }); } /** * Endpoint to view and delete AI generated images for a user. * * AI Generated images are images generated during chat with AI. They are cached to allow retrieval and deletion. * * optional filtering parameters allowed are * - username: The username of the user for which this image was stored. * - provider: The provider used to generate the image. eg. openai, nvidia (nim), replicate. * - model: the text to image model on the provider used to generate the image. * * This endpoint is accessible to both students and platform admins. * @returns AIGeneratedImage * @throws ApiError */ public static aiMentorOrgsUsersAiGeneratedImagesRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this ai generated image. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/ai-generated-images/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to view and delete AI generated images for a user. * * AI Generated images are images generated during chat with AI. They are cached to allow retrieval and deletion. * * optional filtering parameters allowed are * - username: The username of the user for which this image was stored. * - provider: The provider used to generate the image. eg. openai, nvidia (nim), replicate. * - model: the text to image model on the provider used to generate the image. * * This endpoint is accessible to both students and platform admins. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAiGeneratedImagesDestroy({ id, org, userId, }: { /** * A unique integer value identifying this ai generated image. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/ai-generated-images/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to get a list of AI user profile memory entries or to add an entry. * @returns AIUserProfileMemoryRelation * @throws ApiError */ public static aiMentorOrgsUsersAiUserProfileMemoryList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/ai-user-profile-memory/', path: { 'org': org, 'user_id': userId, }, }); } /** * Endpoint to create an AI user profile memory entry. * * Sample request: * ``` * {"favorite-animal": "my favorite animal is cat"} * ``` * Sample Response (the same as request data): * ``` * {"favorite-animal": "my favorite animal is cat"} * ``` * @returns AIUserProfileMemoryRelation * @throws ApiError */ public static aiMentorOrgsUsersAiUserProfileMemoryCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: AIUserProfileRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/ai-user-profile-memory/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * The endpoint to delete an AI user profile memory entry. * * No query parameters or JSON parameters are required. * * The response is always empty. Successful request will be responded with status 204, and failed request will be responded with status 404. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersAiUserProfileMemoryDestroy({ org, tag, userId, }: { org: string, tag: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/ai-user-profile-memory/{tag}/', path: { 'org': org, 'tag': tag, 'user_id': userId, }, }); } /** * List artifacts * Retrieve a paginated list of artifacts for a user, with optional filtering and search. * @returns PaginatedArtifactListList * @throws ApiError */ public static aiMentorOrgsUsersArtifactsList({ org, userId, fileExtension, llmName, llmProvider, mentorId, ordering, page, pageSize, search, sessionId, username, }: { org: string, userId: string, /** * Filter by file extension (e.g., 'py', 'md', 'html') */ fileExtension?: string, /** * Filter by LLM name (e.g., 'gpt-4', 'claude-3') */ llmName?: string, /** * Filter by LLM provider (e.g., 'openai', 'anthropic') */ llmProvider?: string, /** * Filter by mentor UUID */ mentorId?: string, /** * Order by field (prefix with - for descending). Options: date_created, date_updated, title */ ordering?: string, /** * Page number */ page?: number, /** * Number of items per page (max: 100) */ pageSize?: number, /** * Search in title and content */ search?: string, /** * Filter by session UUID */ sessionId?: string, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/', path: { 'org': org, 'user_id': userId, }, query: { 'file_extension': fileExtension, 'llm_name': llmName, 'llm_provider': llmProvider, 'mentor_id': mentorId, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'search': search, 'session_id': sessionId, 'username': username, }, errors: { 401: `Authentication required`, 403: `Permission denied`, }, }); } /** * Artifacts cannot be created via API. They are created by LLMs via chat messages. * @returns Artifact * @throws ApiError */ public static aiMentorOrgsUsersArtifactsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: Artifact, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve an artifact * Get detailed information about a specific artifact including its full content. * @returns Artifact * @throws ApiError */ public static aiMentorOrgsUsersArtifactsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 401: `Authentication required`, 403: `Permission denied`, 404: `Artifact not found`, }, }); } /** * Update an artifact * Update all fields of an artifact (excluding session reference). * @returns Artifact * @throws ApiError */ public static aiMentorOrgsUsersArtifactsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, requestBody: Artifact, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 401: `Authentication required`, 403: `Permission denied`, 404: `Artifact not found`, }, }); } /** * Partially update an artifact * Update specific fields of an artifact. * @returns Artifact * @throws ApiError */ public static aiMentorOrgsUsersArtifactsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, requestBody?: PatchedArtifact, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 401: `Authentication required`, 403: `Permission denied`, 404: `Artifact not found`, }, }); } /** * Delete an artifact * Delete a specific artifact. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersArtifactsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 401: `Authentication required`, 403: `Permission denied`, 404: `Artifact not found`, }, }); } /** * List artifact versions * Retrieve all versions for a specific artifact. * @returns PaginatedArtifactVersionList * @throws ApiError */ public static aiMentorOrgsUsersArtifactsVersionsList({ id, org, userId, fileExtension, llmName, llmProvider, mentorId, ordering, page, pageSize, search, sessionId, username, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, fileExtension?: string, llmName?: string, llmProvider?: string, mentorId?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * A search term. */ search?: string, sessionId?: string, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/versions/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'file_extension': fileExtension, 'llm_name': llmName, 'llm_provider': llmProvider, 'mentor_id': mentorId, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'search': search, 'session_id': sessionId, 'username': username, }, errors: { 404: `Artifact not found`, }, }); } /** * Get specific artifact version * Retrieve a specific version of an artifact by version ID. * @returns ArtifactVersion * @throws ApiError */ public static aiMentorOrgsUsersArtifactsVersionsRetrieve({ id, org, userId, versionId, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, /** * ID of the version to retrieve */ versionId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/versions/{version_id}/', path: { 'id': id, 'org': org, 'user_id': userId, 'version_id': versionId, }, errors: { 404: `Version not found`, }, }); } /** * Set artifact version as current * Mark a specific version as the current/active version for an artifact. * @returns ArtifactVersion * @throws ApiError */ public static aiMentorOrgsUsersArtifactsVersionsSetCurrentCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this artifact. */ id: number, org: string, userId: string, requestBody: SetCurrentVersionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/versions/set-current/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request`, 404: `Version not found`, }, }); } /** * Retrieve assumed knowledge levels. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve assumed knowledge for. * * Returns: * Response: The assumed knowledge levels for different categories. * * Raises: * NotFound: If no assumed knowledge exists for the user. * @returns AssumedKnowledge * @throws ApiError */ public static aiMentorOrgsUsersAssumedKnowledgeRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/assumed-knowledge/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Assumed knowledge not found`, }, }); } /** * Update assumed knowledge levels. * * Args: * request: The HTTP request containing the updated knowledge levels. * org: The organization/tenant identifier. * user_id: The ID of the user to update assumed knowledge for. * * Returns: * Response: The updated assumed knowledge levels. * * Raises: * BadRequest: If the provided data is invalid. * @returns AssumedKnowledge * @throws ApiError */ public static aiMentorOrgsUsersAssumedKnowledgeCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: AssumedKnowledge, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/assumed-knowledge/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, }, }); } /** * Convert an uploaded audio file to text. * * Args: * request: The HTTP request containing the audio file. * org: The organization/tenant identifier. * user_id: The ID of the user uploading the audio. * * Returns: * Response: The transcribed text from the audio file. * * Raises: * BadRequest: If the audio file is invalid or cannot be processed. * NotFound: If the API key for the tenant is not found. * @returns AudioToTextResponse * @throws ApiError */ public static aiMentorOrgsUsersAudioToTextCreate({ org, userId, formData, }: { org: string, userId: string, formData: AudioToTextRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/audio-to-text/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Invalid audio file or processing error`, 404: `API key not found`, }, }); } /** * This endpoint list available template mentors for a tenant * * Returns: * * 200 : List of Template Mentors * @returns TemplateMentor * @throws ApiError */ public static aiMentorOrgsUsersAvailableTemplateAgentsRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/available-template-agents/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/available-template-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/available-template-agents/` (`mentor` → `agent`) and will be removed in a future release. * * This endpoint list available template mentors for a tenant * * Returns: * * 200 : List of Template Mentors * @returns TemplateMentor * @throws ApiError */ public static aiMentorOrgsUsersAvailableTemplateMentorsRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/available-template-mentors/', path: { 'org': org, 'user_id': userId, }, }); } /** * API ViewSet for managing call configurations. * * This ViewSet provides endpoints to retrieve, create, and update call configurations * for mentors. Call configurations define how voice calls are handled for a mentor. * * Permissions: * - Accessible only to platform admins. * * Endpoints: * GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - List all call configurations for a specific mentor * - Returns paginated list of call configurations * * POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - Create a new call configuration for a mentor * - Requires call configuration data in request body * * PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/ * - Update an existing call configuration * - Requires call configuration data in request body * * Query Parameters: * - mentor: Filter configurations by mentor ID * * Returns: * - CallConfigurationSerializer data * @returns CallConfiguration * @throws ApiError */ public static aiMentorOrgsUsersCallConfigurationsList({ org, userId, mentor, mode, ordering, search, }: { org: string, userId: string, mentor?: string, /** * * `realtime` - Realtime * * `inference` - Inference */ mode?: 'inference' | 'realtime', /** * Which field to use when ordering the results. */ ordering?: string, /** * A search term. */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor': mentor, 'mode': mode, 'ordering': ordering, 'search': search, }, }); } /** * API ViewSet for managing call configurations. * * This ViewSet provides endpoints to retrieve, create, and update call configurations * for mentors. Call configurations define how voice calls are handled for a mentor. * * Permissions: * - Accessible only to platform admins. * * Endpoints: * GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - List all call configurations for a specific mentor * - Returns paginated list of call configurations * * POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - Create a new call configuration for a mentor * - Requires call configuration data in request body * * PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/ * - Update an existing call configuration * - Requires call configuration data in request body * * Query Parameters: * - mentor: Filter configurations by mentor ID * * Returns: * - CallConfigurationSerializer data * @returns CallConfiguration * @throws ApiError */ public static aiMentorOrgsUsersCallConfigurationsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: CallConfiguration, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API ViewSet for managing call configurations. * * This ViewSet provides endpoints to retrieve, create, and update call configurations * for mentors. Call configurations define how voice calls are handled for a mentor. * * Permissions: * - Accessible only to platform admins. * * Endpoints: * GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - List all call configurations for a specific mentor * - Returns paginated list of call configurations * * POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - Create a new call configuration for a mentor * - Requires call configuration data in request body * * PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/ * - Update an existing call configuration * - Requires call configuration data in request body * * Query Parameters: * - mentor: Filter configurations by mentor ID * * Returns: * - CallConfigurationSerializer data * @returns CallConfiguration * @throws ApiError */ public static aiMentorOrgsUsersCallConfigurationsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this call configuration. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * API ViewSet for managing call configurations. * * This ViewSet provides endpoints to retrieve, create, and update call configurations * for mentors. Call configurations define how voice calls are handled for a mentor. * * Permissions: * - Accessible only to platform admins. * * Endpoints: * GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - List all call configurations for a specific mentor * - Returns paginated list of call configurations * * POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - Create a new call configuration for a mentor * - Requires call configuration data in request body * * PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/ * - Update an existing call configuration * - Requires call configuration data in request body * * Query Parameters: * - mentor: Filter configurations by mentor ID * * Returns: * - CallConfigurationSerializer data * @returns CallConfiguration * @throws ApiError */ public static aiMentorOrgsUsersCallConfigurationsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this call configuration. */ id: number, org: string, userId: string, requestBody: CallConfiguration, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API ViewSet for managing call configurations. * * This ViewSet provides endpoints to retrieve, create, and update call configurations * for mentors. Call configurations define how voice calls are handled for a mentor. * * Permissions: * - Accessible only to platform admins. * * Endpoints: * GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - List all call configurations for a specific mentor * - Returns paginated list of call configurations * * POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/ * - Create a new call configuration for a mentor * - Requires call configuration data in request body * * PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/ * - Update an existing call configuration * - Requires call configuration data in request body * * Query Parameters: * - mentor: Filter configurations by mentor ID * * Returns: * - CallConfigurationSerializer data * @returns CallConfiguration * @throws ApiError */ public static aiMentorOrgsUsersCallConfigurationsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this call configuration. */ id: number, org: string, userId: string, requestBody?: PatchedCallConfiguration, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve a list of Mentor Category Groups. * @returns MentorCategoryGroup * @throws ApiError */ public static aiMentorOrgsUsersCategoryGroupsList({ org, userId, audience, audienceName, ordering, search, }: { org: string, userId: string, audience?: number, audienceName?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A search term. */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/', path: { 'org': org, 'user_id': userId, }, query: { 'audience': audience, 'audience__name': audienceName, 'ordering': ordering, 'search': search, }, }); } /** * Create a new Mentor Category Group. Only accessible to Platform Admins. * @returns MentorCategoryGroup * @throws ApiError */ public static aiMentorOrgsUsersCategoryGroupsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorCategoryGroupCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mentor Category Groups offer parent grouping for mentor category objects. * * The parameter `audience` is deprecated and is currently left behind for backward compatibility. * * Permissions: * GET: Accessible to both Platform Admins and Students * POST, DELETE, PATCH, PUT: Accessible to only Platform Admins * @returns MentorCategoryGroup * @throws ApiError */ public static aiMentorOrgsUsersCategoryGroupsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this mentor category group. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Mentor Category Groups offer parent grouping for mentor category objects. * * The parameter `audience` is deprecated and is currently left behind for backward compatibility. * * Permissions: * GET: Accessible to both Platform Admins and Students * POST, DELETE, PATCH, PUT: Accessible to only Platform Admins * @returns MentorCategoryGroupCreate * @throws ApiError */ public static aiMentorOrgsUsersCategoryGroupsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this mentor category group. */ id: number, org: string, userId: string, requestBody: MentorCategoryGroupCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mentor Category Groups offer parent grouping for mentor category objects. * * The parameter `audience` is deprecated and is currently left behind for backward compatibility. * * Permissions: * GET: Accessible to both Platform Admins and Students * POST, DELETE, PATCH, PUT: Accessible to only Platform Admins * @returns MentorCategoryGroupCreate * @throws ApiError */ public static aiMentorOrgsUsersCategoryGroupsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this mentor category group. */ id: number, org: string, userId: string, requestBody?: PatchedMentorCategoryGroupCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mentor Category Groups offer parent grouping for mentor category objects. * * The parameter `audience` is deprecated and is currently left behind for backward compatibility. * * Permissions: * GET: Accessible to both Platform Admins and Students * POST, DELETE, PATCH, PUT: Accessible to only Platform Admins * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCategoryGroupsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this mentor category group. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Synthesize chat message audio * Converts the text content of a chat message into MP3 audio using the mentor's configured TTS provider (openai or google). * @returns binary MP3 audio bytes * @throws ApiError */ public static aiMentorOrgsUsersChatMessagesTtsRetrieve({ chatMessageId, org, userId, }: { chatMessageId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/chat-messages/{chat_message_id}/tts/', path: { 'chat_message_id': chatMessageId, 'org': org, 'user_id': userId, }, errors: { 400: `Empty content or synthesis failure`, 403: `User cannot access this message`, 404: `Chat message not found`, }, }); } /** * Read-only endpoint for viewing chat run tracking data. * * Provides per-request telemetry for chat interactions including timing * breakdowns, LLM provider info, fallback usage, and failure categories. * * Results are scoped to the platform (org) from the URL and ordered by * most recent first by default. * @returns PaginatedChatRunTrackerList * @throws ApiError */ public static aiMentorOrgsUsersChatRunTrackersList({ org, userId, endTime, failureCategory, mentor, modality, ordering, page, pageSize, search, startTime, status, usedFallback, username, }: { org: string, userId: string, endTime?: string, /** * * `llm_error` - Llm Error * * `moderation_block` - Moderation Block * * `safety_block` - Safety Block * * `privacy_block` - Privacy Block * * `authentication_error` - Authentication Error * * `authorization_error` - Authorization Error * * `payment_error` - Payment Error * * `validation_error` - Validation Error * * `content_filter` - Content Filter * * `input_too_large` - Input Too Large * * `timeout` - Timeout * * `unknown` - Unknown */ failureCategory?: 'authentication_error' | 'authorization_error' | 'content_filter' | 'input_too_large' | 'llm_error' | 'moderation_block' | 'payment_error' | 'privacy_block' | 'safety_block' | 'timeout' | 'unknown' | 'validation_error', mentor?: string, /** * * `text` - Text * * `multimodal` - Multimodal * * `voice` - Voice */ modality?: 'multimodal' | 'text' | 'voice', /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * A search term. */ search?: string, startTime?: string, /** * * `started` - Started * * `completed` - Completed * * `failed` - Failed */ status?: 'completed' | 'failed' | 'started', usedFallback?: boolean, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/chat-run-trackers/', path: { 'org': org, 'user_id': userId, }, query: { 'end_time': endTime, 'failure_category': failureCategory, 'mentor': mentor, 'modality': modality, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'search': search, 'start_time': startTime, 'status': status, 'used_fallback': usedFallback, 'username': username, }, }); } /** * Read-only endpoint for viewing chat run tracking data. * * Provides per-request telemetry for chat interactions including timing * breakdowns, LLM provider info, fallback usage, and failure categories. * * Results are scoped to the platform (org) from the URL and ordered by * most recent first by default. * @returns ChatRunTracker * @throws ApiError */ public static aiMentorOrgsUsersChatRunTrackersRetrieve({ id, org, userId, }: { /** * A unique value identifying this chat run tracker. */ id: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/chat-run-trackers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Generate presigned S3 upload URL for chat file * @returns FileUploadURLResponse * @throws ApiError */ public static aiMentorOrgsUsersChatFilesUploadUrlCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: FileUploadURLRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/chat/files/upload-url/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve and clean up vector results from a specific session. * * This endpoint retrieves the documents last used by the mentor to answer * the most recent query from the user in the specified session, and cleans * them to remove any inappropriate content. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * session_id: The ID of the session to retrieve vector results from. * * Returns: * Response: The cleaned vector results. * * Raises: * BadRequest: If the API key for the cleaning provider is not found. * NotFound: If no vector results are found for the session. * @returns VectorResult * @throws ApiError */ public static aiMentorOrgsUsersCleanVectorResultsList({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/clean-vector-results/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, errors: { 400: `API key not found`, 404: `Session or results not found`, }, }); } /** * Clean up provided vector results. * * This endpoint allows users to submit specific vector results for cleaning, * which is useful when there are particular documents that need to be processed. * * Args: * request: The HTTP request containing the vector results to clean. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * * Returns: * Response: The cleaned vector results. * * Raises: * BadRequest: If the API key for the cleaning provider is not found or the provided data is invalid. * @returns VectorResult * @throws ApiError */ public static aiMentorOrgsUsersCleanVectorResultsCreate({ org, sessionId, userId, requestBody, }: { org: string, sessionId: string, userId: string, requestBody: Array, }): CancelablePromise> { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/clean-vector-results/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `API key not found or invalid data`, }, }); } /** * Delete User Chat History * Endpoint to clear a user's chat history. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersClearChathistoryDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/clear-chathistory', path: { 'org': org, 'user_id': userId, }, }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns PaginatedCourseCreationTaskFileList * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTaskFilesList({ org, userId, page, pageSize, }: { org: string, userId: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/', path: { 'org': org, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTaskFilesCreate({ org, userId, formData, }: { org: string, userId: string, formData: CourseCreationTaskFile, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTaskFilesRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTaskFilesUpdate({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, formData: CourseCreationTaskFile, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTaskFilesPartialUpdate({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, formData?: PatchedCourseCreationTaskFile, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTaskFilesDestroy({ id, org, userId, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns PaginatedCourseCreationTaskList * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksList({ org, userId, page, pageSize, }: { org: string, userId: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/', path: { 'org': org, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreate({ org, userId, formData, }: { org: string, userId: string, formData: CourseCreationTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksDestroy({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Cancel a course creation task run. * ** Conditions Required **: * The task must be running or pending. * ** Response **: * - 200: The course creation task is successfully cancelled. * - 400: The course creation task is not in a running or pending state. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCancelRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/cancel/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Task is not in a cancellable state`, }, }); } /** * Create a blank course on EdX and trigger background settings update. * * Creates the course on EdX synchronously. If successful, schedules a * background task to generate and apply course settings and images via AI. * * Returns immediately after course creation — settings/images are applied * asynchronously. * @returns any Course already exists for this task * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreateCourseCreate({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, formData: CourseCreationTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/create-course/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Course creation failed`, }, }); } /** * Generate a course outline synchronously. * * Creates the course outline via LLM and pushes it to EdX. * @returns any Outline generated successfully * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreateCourseOutlineRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/create-course-outline/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Outline generation failed`, }, }); } /** * Generate a course outline synchronously. * * Creates the course outline via LLM and pushes it to EdX. * @returns any Outline generated successfully * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreateCourseOutlineCreate({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, formData: CourseCreationTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/create-course-outline/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Outline generation failed`, }, }); } /** * Kick start the course creation task. * This endpoint should be called once the files for a course creation task has * been successfully uploaded. * * ** Conditions Required **: * - The course creation task must be in a pending state or failed state. * * ** Response **: * - 200: The course creation task is successfully started. * - 400: The course creation task is not in a pending state. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksStartRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/start/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Task is not in a schedulable state`, }, }); } /** * API viewset for managing EdX courses. * * This viewset allows platform administrators to retrieve, delete, and * perform various operations on EdX courses that were created through * course creation tasks. * * Permissions: * - Restricted to platform administrators only * @returns PaginatedEdxCourseList * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseList({ org, userId, ordering, page, pageSize, search, task, }: { org: string, userId: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * A search term. */ search?: string, task?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/', path: { 'org': org, 'user_id': userId, }, query: { 'ordering': ordering, 'page': page, 'page_size': pageSize, 'search': search, 'task': task, }, }); } /** * API viewset for managing EdX courses. * * This viewset allows platform administrators to retrieve, delete, and * perform various operations on EdX courses that were created through * course creation tasks. * * Permissions: * - Restricted to platform administrators only * @returns EdxCourse * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: EdxCourse, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API viewset for managing EdX courses. * * This viewset allows platform administrators to retrieve, delete, and * perform various operations on EdX courses that were created through * course creation tasks. * * Permissions: * - Restricted to platform administrators only * @returns EdxCourse * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * API viewset for managing EdX courses. * * This viewset allows platform administrators to retrieve, delete, and * perform various operations on EdX courses that were created through * course creation tasks. * * Permissions: * - Restricted to platform administrators only * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseDestroy({ id, org, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Create a new xblock under a parent within this course. * @returns XblockResult * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseCreateXblockCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, requestBody: CreateXblock, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/create-xblock/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete an xblock from this course. * @returns XblockResult * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseDeleteXblockCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, requestBody: DeleteXblock, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/delete-xblock/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Generate draft content for all units in a course. * * This action starts a background task to create draft content * for all units in the course using AI. * * Args: * request: The HTTP request. * pk: The primary key of the course to generate content for. * * Returns: * Response: A confirmation that the content generation task has been started. * * Raises: * NotFound: If the specified course does not exist. * @returns any Content creation started successfully * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseDraftContentForAllUnitsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/draft-content-for-all-units/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 404: `Course not found`, }, }); } /** * Draft content for a single unit synchronously. * * Only xblock_id is required. The display_name and unit_type are * fetched from EdX automatically. * @returns any Unit content drafted successfully * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseDraftContentForUnitCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, requestBody?: { /** * The unit's xblock ID on EdX */ xblock_id: string; }, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/draft-content-for-unit/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Content generation failed`, 404: `Course not found`, }, }); } /** * Retrieve the full structure of a course from EdX. * * This action returns the complete hierarchical structure of the course, * including all sections, subsections, units, and components. * * Use ``?include_content=true`` to include component HTML content (slower). * * Args: * request: The HTTP request. * pk: The primary key of the course to retrieve. * * Returns: * Response: The full structure of the course. * * Raises: * NotFound: If the specified course does not exist. * @returns any Full course structure from EdX * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseFullStructureRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/full-structure/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 404: `Course not found`, }, }); } /** * Fetch and report course outline directly from the LMS * * Outline includes all sections, subsections, units and components. * This does not include the html content of the components. * @returns any Course structure verified on EdX * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseOutlineRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/outline/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Verification failed`, 404: `Course not found`, }, }); } /** * Reorder the children of an xblock within this course. * * This is also useful for moving an element from its parent to another. * If you set an xblock as a child of another parent, it is automatically removed from its * previous position and placed in the child position of the current specified parent. * @returns XblockResult * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseReorderChildrenCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, requestBody: ReorderChildren, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/reorder-children/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Fetch a student's completion progress for this course. * @returns any Student progress for the course * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseStudentProgressRetrieve({ id, org, targetUsername, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, /** * Username of the student whose progress to fetch. */ targetUsername: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/student-progress/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'target_username': targetUsername, }, errors: { 400: `Missing or invalid parameters`, 404: `Course not found`, }, }); } /** * Publish the course structure on EdX synchronously. * @returns any Course published on EdX * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseSyncToEdxRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/sync-to-edx/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Sync failed`, 404: `Course not found`, }, }); } /** * Publish the course structure on EdX synchronously. * @returns any Course published on EdX * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseSyncToEdxCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, requestBody: EdxCourse, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/sync-to-edx/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Sync failed`, 404: `Course not found`, }, }); } /** * Update an xblock's display name and/or content. * @returns XblockResult * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationCourseUpdateXblockCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this edx course. */ id: number, org: string, userId: string, requestBody: UpdateXblock, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/update-xblock/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns PaginatedCourseCreationTaskFileList * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationFilesList({ org, userId, page, pageSize, }: { org: string, userId: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/', path: { 'org': org, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationFilesCreate({ org, userId, formData, }: { org: string, userId: string, formData: CourseCreationTaskFile, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationFilesRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationFilesUpdate({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, formData: CourseCreationTaskFile, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns CourseCreationTaskFile * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationFilesPartialUpdate({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, formData?: PatchedCourseCreationTaskFile, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Endpoint to fetch update and delete files associated with course creation tasks. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationFilesDestroy({ id, org, userId, }: { /** * A unique integer value identifying this course creation task file. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns PaginatedCourseCreationTaskList * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksList2({ org, userId, page, pageSize, }: { org: string, userId: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/', path: { 'org': org, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreate2({ org, userId, formData, }: { org: string, userId: string, formData: CourseCreationTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksRetrieve2({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Create, retrieve and delete course creation tasks * * Course creation tasks allow you to schedule the creation of a course on OpenEdx deployment connected to this data manager. * * The course is created entirely by an ai model (as specified in your inputs). * * The llm decides on the content of the course based on the name, description, target audience and other parameters. * Bigger and newer models tend to outperform smaller once. * * Clear and unambiguous parameters are more likely to produce better results. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksDestroy2({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Cancel a course creation task run. * ** Conditions Required **: * The task must be running or pending. * ** Response **: * - 200: The course creation task is successfully cancelled. * - 400: The course creation task is not in a running or pending state. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCancelRetrieve2({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/cancel/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Task is not in a cancellable state`, }, }); } /** * Create a blank course on EdX and trigger background settings update. * * Creates the course on EdX synchronously. If successful, schedules a * background task to generate and apply course settings and images via AI. * * Returns immediately after course creation — settings/images are applied * asynchronously. * @returns any Course already exists for this task * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreateCourseCreate2({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, formData: CourseCreationTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/create-course/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Course creation failed`, }, }); } /** * Generate a course outline synchronously. * * Creates the course outline via LLM and pushes it to EdX. * @returns any Outline generated successfully * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreateCourseOutlineRetrieve2({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/create-course-outline/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Outline generation failed`, }, }); } /** * Generate a course outline synchronously. * * Creates the course outline via LLM and pushes it to EdX. * @returns any Outline generated successfully * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksCreateCourseOutlineCreate2({ id, org, userId, formData, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, formData: CourseCreationTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/create-course-outline/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Outline generation failed`, }, }); } /** * Kick start the course creation task. * This endpoint should be called once the files for a course creation task has * been successfully uploaded. * * ** Conditions Required **: * - The course creation task must be in a pending state or failed state. * * ** Response **: * - 200: The course creation task is successfully started. * - 400: The course creation task is not in a pending state. * @returns CourseCreationTask * @throws ApiError */ public static aiMentorOrgsUsersCourseCreationTasksStartRetrieve2({ id, org, userId, }: { /** * A unique integer value identifying this course creation task. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/start/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 400: `Task is not in a schedulable state`, }, }); } /** * Create a new mentor using the wizard interface. * * Args: * request: The HTTP request containing the mentor data. * org: The organization/tenant identifier. * user_id: The ID of the user creating the mentor. * * Returns: * Response: The created mentor. * * Raises: * BadRequest: If the provided data is invalid. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersCreateAgentWizardCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorWizard, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, }, }); } /** * API view for creating a mentor using the wizard interface. * * This view allows platform administrators to create new mentors with * basic configuration through a simplified wizard process. * * Permissions: * - Restricted to platform administrators only * @returns MentorWizard * @throws ApiError */ public static aiMentorOrgsUsersCreateAgentWizardUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorWizard, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API view for creating a mentor using the wizard interface. * * This view allows platform administrators to create new mentors with * basic configuration through a simplified wizard process. * * Permissions: * - Restricted to platform administrators only * @returns MentorWizard * @throws ApiError */ public static aiMentorOrgsUsersCreateAgentWizardPartialUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: PatchedMentorWizard, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API view for creating a mentor using the wizard interface. * * This view allows platform administrators to create new mentors with * basic configuration through a simplified wizard process. * * Permissions: * - Restricted to platform administrators only * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCreateAgentWizardDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release. * * Create a new mentor using the wizard interface. * * Args: * request: The HTTP request containing the mentor data. * org: The organization/tenant identifier. * user_id: The ID of the user creating the mentor. * * Returns: * Response: The created mentor. * * Raises: * BadRequest: If the provided data is invalid. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersCreateMentorWizardCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorWizard, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release. * * API view for creating a mentor using the wizard interface. * * This view allows platform administrators to create new mentors with * basic configuration through a simplified wizard process. * * Permissions: * - Restricted to platform administrators only * @returns MentorWizard * @throws ApiError */ public static aiMentorOrgsUsersCreateMentorWizardUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorWizard, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release. * * API view for creating a mentor using the wizard interface. * * This view allows platform administrators to create new mentors with * basic configuration through a simplified wizard process. * * Permissions: * - Restricted to platform administrators only * @returns MentorWizard * @throws ApiError */ public static aiMentorOrgsUsersCreateMentorWizardPartialUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: PatchedMentorWizard, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release. * * API view for creating a mentor using the wizard interface. * * This view allows platform administrators to create new mentors with * basic configuration through a simplified wizard process. * * Permissions: * - Restricted to platform administrators only * @returns void * @throws ApiError */ public static aiMentorOrgsUsersCreateMentorWizardDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/', path: { 'org': org, 'user_id': userId, }, }); } /** * Retrieve custom instructions for a specific user. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve custom instructions for. * * Returns: * Response: The custom instructions for the user. * * Raises: * NotFound: If no custom instructions exist for the user. * @returns CustomInstructionResponse * @throws ApiError */ public static aiMentorOrgsUsersCustomInstructionRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/custom-instruction/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Custom instruction not found`, }, }); } /** * Create a new custom instruction for a user. * * Args: * request: The HTTP request containing the custom instruction data. * org: The organization/tenant identifier. * user_id: The ID of the user to create custom instructions for. * * Returns: * Response: The created custom instruction. * * Raises: * BadRequest: If the provided data is invalid. * @returns CustomInstructionResponse * @throws ApiError */ public static aiMentorOrgsUsersCustomInstructionCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: CustomInstructionResponse, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/custom-instruction/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, }, }); } /** * Update an existing custom instruction for a user. * * Args: * request: The HTTP request containing the updated custom instruction data. * org: The organization/tenant identifier. * user_id: The ID of the user to update custom instructions for. * * Returns: * Response: The updated custom instruction. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If no custom instruction exists for the user. * @returns CustomInstructionResponse * @throws ApiError */ public static aiMentorOrgsUsersCustomInstructionUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: CustomInstructionResponse, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/custom-instruction/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Custom instruction not found`, }, }); } /** * Retrieve the user's default mentor for this tenant. * * Returns ``null`` when the user has not set a default mentor. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersDefaultAgentRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * Set (or replace) the user's default mentor for this tenant. * * The unique (student, platform) constraint guarantees at most one * default mentor per user per tenant; setting a new one replaces any * existing default. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersDefaultAgentUpdate({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Mentor, student or platform not found`, }, }); } /** * Clear the user's default mentor for this tenant. * * Idempotent: returns 204 whether or not a default was set. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersDefaultAgentDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the user's default mentor for this tenant. * * Returns ``null`` when the user has not set a default mentor. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersDefaultMentorRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/default-mentor/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` (`mentor` → `agent`) and will be removed in a future release. * * Set (or replace) the user's default mentor for this tenant. * * The unique (student, platform) constraint guarantees at most one * default mentor per user per tenant; setting a new one replaces any * existing default. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersDefaultMentorUpdate({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/default-mentor/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Mentor, student or platform not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` (`mentor` → `agent`) and will be removed in a future release. * * Clear the user's default mentor for this tenant. * * Idempotent: returns 204 whether or not a default was set. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersDefaultMentorDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/default-mentor/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * API view for managing disclaimer agreements. * * This viewset provides Create Read and Delete operations for disclaimer agreements with different access levels: * * Platform Admins: * - Can view all disclaimer agreements for their platform * - Have full access to create (for themselves) and delete agreements for themselves and other users. * - Results are paginated and can be filtered * * Students: * - Can only view their own disclaimer agreements * - Limited to agreements where they are the user * - Results are paginated and can be filtered * * List endpoint returns paginated results with disclaimer agreement objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "user": str, * "disclaimer": int, * "agreed_at": datetime, * * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer agreement object with the same structure * @returns PaginatedDisclaimerAgreementList * @throws ApiError */ public static aiMentorOrgsUsersDisclaimerAgreementsList({ org, userId, disclaimer, mentorId, page, pageSize, username, }: { org: string, userId: string, disclaimer?: number, mentorId?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimer-agreements/', path: { 'org': org, 'user_id': userId, }, query: { 'disclaimer': disclaimer, 'mentor_id': mentorId, 'page': page, 'page_size': pageSize, 'username': username, }, }); } /** * API view for managing disclaimer agreements. * * This viewset provides Create Read and Delete operations for disclaimer agreements with different access levels: * * Platform Admins: * - Can view all disclaimer agreements for their platform * - Have full access to create (for themselves) and delete agreements for themselves and other users. * - Results are paginated and can be filtered * * Students: * - Can only view their own disclaimer agreements * - Limited to agreements where they are the user * - Results are paginated and can be filtered * * List endpoint returns paginated results with disclaimer agreement objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "user": str, * "disclaimer": int, * "agreed_at": datetime, * * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer agreement object with the same structure * @returns DisclaimerAgreement * @throws ApiError */ public static aiMentorOrgsUsersDisclaimerAgreementsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: DisclaimerAgreement, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimer-agreements/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * API view for managing disclaimer agreements. * * This viewset provides Create Read and Delete operations for disclaimer agreements with different access levels: * * Platform Admins: * - Can view all disclaimer agreements for their platform * - Have full access to create (for themselves) and delete agreements for themselves and other users. * - Results are paginated and can be filtered * * Students: * - Can only view their own disclaimer agreements * - Limited to agreements where they are the user * - Results are paginated and can be filtered * * List endpoint returns paginated results with disclaimer agreement objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "user": str, * "disclaimer": int, * "agreed_at": datetime, * * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer agreement object with the same structure * @returns DisclaimerAgreement * @throws ApiError */ public static aiMentorOrgsUsersDisclaimerAgreementsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this disclaimer agreement. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimer-agreements/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * API view for managing disclaimer agreements. * * This viewset provides Create Read and Delete operations for disclaimer agreements with different access levels: * * Platform Admins: * - Can view all disclaimer agreements for their platform * - Have full access to create (for themselves) and delete agreements for themselves and other users. * - Results are paginated and can be filtered * * Students: * - Can only view their own disclaimer agreements * - Limited to agreements where they are the user * - Results are paginated and can be filtered * * List endpoint returns paginated results with disclaimer agreement objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "user": str, * "disclaimer": int, * "agreed_at": datetime, * * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer agreement object with the same structure * @returns void * @throws ApiError */ public static aiMentorOrgsUsersDisclaimerAgreementsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this disclaimer agreement. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimer-agreements/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * ViewSet for managing mentor disclaimers. * * This viewset provides endpoints for creating and managing mentor disclaimers, which are * statements or information that mentors need to share with students. * * Permissions: * - Platform administrators have full CRUD access * - Students have read-only access * - Unauthenticated users have no access * * Endpoints: * - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers * - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer * - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer * - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer * * Query Parameters: * - Supports filtering via DjangoFilterBackend * - See DisclaimerFilterSet for available filters * * Returns: * List endpoint returns paginated results with disclaimer objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "title": str, * "content": str, * "mentor": str, * "platform": str, * "created_at": datetime, * "updated_at": datetime * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer object with the same structure * @returns PaginatedDisclaimerList * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersList({ org, userId, active, mentorId, ordering, page, pageSize, scope, search, }: { org: string, userId: string, active?: boolean, mentorId?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * * `platform` - Platform * * `mentor` - Mentor */ scope?: 'mentor' | 'platform', /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/', path: { 'org': org, 'user_id': userId, }, query: { 'active': active, 'mentor_id': mentorId, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'scope': scope, 'search': search, }, }); } /** * ViewSet for managing mentor disclaimers. * * This viewset provides endpoints for creating and managing mentor disclaimers, which are * statements or information that mentors need to share with students. * * Permissions: * - Platform administrators have full CRUD access * - Students have read-only access * - Unauthenticated users have no access * * Endpoints: * - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers * - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer * - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer * - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer * * Query Parameters: * - Supports filtering via DjangoFilterBackend * - See DisclaimerFilterSet for available filters * * Returns: * List endpoint returns paginated results with disclaimer objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "title": str, * "content": str, * "mentor": str, * "platform": str, * "created_at": datetime, * "updated_at": datetime * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer object with the same structure * @returns Disclaimer * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: Disclaimer, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing mentor disclaimers. * * This viewset provides endpoints for creating and managing mentor disclaimers, which are * statements or information that mentors need to share with students. * * Permissions: * - Platform administrators have full CRUD access * - Students have read-only access * - Unauthenticated users have no access * * Endpoints: * - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers * - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer * - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer * - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer * * Query Parameters: * - Supports filtering via DjangoFilterBackend * - See DisclaimerFilterSet for available filters * * Returns: * List endpoint returns paginated results with disclaimer objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "title": str, * "content": str, * "mentor": str, * "platform": str, * "created_at": datetime, * "updated_at": datetime * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer object with the same structure * @returns Disclaimer * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this disclaimer. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * ViewSet for managing mentor disclaimers. * * This viewset provides endpoints for creating and managing mentor disclaimers, which are * statements or information that mentors need to share with students. * * Permissions: * - Platform administrators have full CRUD access * - Students have read-only access * - Unauthenticated users have no access * * Endpoints: * - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers * - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer * - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer * - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer * * Query Parameters: * - Supports filtering via DjangoFilterBackend * - See DisclaimerFilterSet for available filters * * Returns: * List endpoint returns paginated results with disclaimer objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "title": str, * "content": str, * "mentor": str, * "platform": str, * "created_at": datetime, * "updated_at": datetime * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer object with the same structure * @returns Disclaimer * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this disclaimer. */ id: number, org: string, userId: string, requestBody: Disclaimer, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing mentor disclaimers. * * This viewset provides endpoints for creating and managing mentor disclaimers, which are * statements or information that mentors need to share with students. * * Permissions: * - Platform administrators have full CRUD access * - Students have read-only access * - Unauthenticated users have no access * * Endpoints: * - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers * - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer * - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer * - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer * - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer * * Query Parameters: * - Supports filtering via DjangoFilterBackend * - See DisclaimerFilterSet for available filters * * Returns: * List endpoint returns paginated results with disclaimer objects: * * ``` * { * "count": int, * "next": str, * "previous": str, * "results": [ * { * "id": int, * "title": str, * "content": str, * "mentor": str, * "platform": str, * "created_at": datetime, * "updated_at": datetime * }, * ... * ] * } * ``` * * Detail endpoints return a single disclaimer object with the same structure * @returns Disclaimer * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this disclaimer. */ id: number, org: string, userId: string, requestBody?: PatchedDisclaimer, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Add mentor to disclaimer * Add a mentor to a disclaimer with `mentor` scope. Only platform admins can perform this action. * @returns Disclaimer * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersAddMentorCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this disclaimer. */ id: number, org: string, userId: string, requestBody: AddMentorToDisclaimer, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/add-mentor/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 403: `Permission Denied`, 404: `Not Found`, }, }); } /** * Remove mentor from disclaimer * Remove a mentor from a disclaimer with `mentor` scope. Only platform admins can perform this action. Validates that at least one mentor remains after removal. * @returns Disclaimer * @throws ApiError */ public static aiMentorOrgsUsersDisclaimersRemoveMentorCreate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this disclaimer. */ id: number, org: string, userId: string, requestBody: RemoveMentorFromDisclaimer, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/remove-mentor/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 403: `Permission Denied`, 404: `Not Found`, }, }); } /** * Retrieves the chat history for a user if the export task is ready. * * This Endpoint to download user chathistory. * * Accessible to tenant admins and students. * * Returns: * * 200: When task is not ready. * * 200: chat history object * * 400: When data is not valid. * @returns ChatHistoryItem * @throws ApiError */ public static aiMentorOrgsUsersDownloadsTasksRetrieve({ org, taskId, userId, toCsv = false, }: { org: string, taskId: string, userId: string, /** * Choose download in csv or not */ toCsv?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/downloads/tasks/{task_id}/', path: { 'org': org, 'task_id': taskId, 'user_id': userId, }, query: { 'to_csv': toCsv, }, }); } /** * Endpoints to fetch and delete Edx stored Memory information stored for a user and a corresponding edx course they have interracted with. * This information is passed to the corresponding mentor so the mentor has context information * about the course and unit that the user last interracted with. * * There can be only one UserEdxMemory instance per student and course_id. * * Url Args: * org (str): The organization's platform key. * user_id (str): The username identifier of the individual. * * Returns: * * 200: A paginated list of UserEdxMemory objects * * Examples: * * - List all memories * GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/ * * Request: None * Response: { * "count": 0, * "next": null, * "previous": null, * "results": [{ * "student": 1, * "course_id": "course-v1:main+CARBON+2024_Fall", * "data": {}, * "date_created": "2024-06-25T15:30:26.257140", * "last_modified": "2024-06-25T15:30:26.257140" * }] * } * - Get a single UserEdxMemory object * GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/1/ * * Request: None * Response: { * "student": 1, * "course_id": "course-v1:main+CARBON+2024_Fall", * "data": {}, * "date_created": "2024-06-25T15:30:26.257140", * "last_modified": "2024-06-25T15:30:26.257140" * } * @returns PaginatedUserEdxMemoryList * @throws ApiError */ public static aiMentorOrgsUsersEdxMemoryList({ org, userId, courseId, ordering, page, pageSize, student, username, }: { org: string, userId: string, courseId?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * edX user ID */ student?: number, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/edx-memory/', path: { 'org': org, 'user_id': userId, }, query: { 'course_id': courseId, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'student': student, 'username': username, }, }); } /** * Endpoints to fetch and delete Edx stored Memory information stored for a user and a corresponding edx course they have interracted with. * This information is passed to the corresponding mentor so the mentor has context information * about the course and unit that the user last interracted with. * * There can be only one UserEdxMemory instance per student and course_id. * * Url Args: * org (str): The organization's platform key. * user_id (str): The username identifier of the individual. * * Returns: * * 200: A paginated list of UserEdxMemory objects * * Examples: * * - List all memories * GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/ * * Request: None * Response: { * "count": 0, * "next": null, * "previous": null, * "results": [{ * "student": 1, * "course_id": "course-v1:main+CARBON+2024_Fall", * "data": {}, * "date_created": "2024-06-25T15:30:26.257140", * "last_modified": "2024-06-25T15:30:26.257140" * }] * } * - Get a single UserEdxMemory object * GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/1/ * * Request: None * Response: { * "student": 1, * "course_id": "course-v1:main+CARBON+2024_Fall", * "data": {}, * "date_created": "2024-06-25T15:30:26.257140", * "last_modified": "2024-06-25T15:30:26.257140" * } * @returns UserEdxMemory * @throws ApiError */ public static aiMentorOrgsUsersEdxMemoryRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this user edx memory. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/edx-memory/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoints to fetch and delete Edx stored Memory information stored for a user and a corresponding edx course they have interracted with. * This information is passed to the corresponding mentor so the mentor has context information * about the course and unit that the user last interracted with. * * There can be only one UserEdxMemory instance per student and course_id. * * Url Args: * org (str): The organization's platform key. * user_id (str): The username identifier of the individual. * * Returns: * * 200: A paginated list of UserEdxMemory objects * * Examples: * * - List all memories * GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/ * * Request: None * Response: { * "count": 0, * "next": null, * "previous": null, * "results": [{ * "student": 1, * "course_id": "course-v1:main+CARBON+2024_Fall", * "data": {}, * "date_created": "2024-06-25T15:30:26.257140", * "last_modified": "2024-06-25T15:30:26.257140" * }] * } * - Get a single UserEdxMemory object * GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/1/ * * Request: None * Response: { * "student": 1, * "course_id": "course-v1:main+CARBON+2024_Fall", * "data": {}, * "date_created": "2024-06-25T15:30:26.257140", * "last_modified": "2024-06-25T15:30:26.257140" * } * @returns void * @throws ApiError */ public static aiMentorOrgsUsersEdxMemoryDestroy({ id, org, userId, }: { /** * A unique integer value identifying this user edx memory. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/edx-memory/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieve a list of Elevenlabs voices available to a user. * * This endpoint returns both custom voices created by the user * and premade voices available to all users. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve voices for. * * Returns: * Response: A list of available Elevenlabs voices. * * Raises: * NotFound: If the specified user does not exist. * @returns ElevenlabsCustomVoiceResponse * @throws ApiError */ public static aiMentorOrgsUsersElevenlabsVoiceList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/elevenlabs-voice/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `User not found`, }, }); } /** * Create a new custom Elevenlabs voice. * * This endpoint allows users to upload audio files to create a custom voice * that can be used with the Elevenlabs text-to-speech service. * * Note: The audio files' total length should be longer than 1 minute and * the total size should be smaller than 11 MiB. * * Args: * request: The HTTP request containing the voice name and audio files. * org: The organization/tenant identifier. * user_id: The ID of the user creating the voice. * * Returns: * Response: The created voice configuration. * * Raises: * BadRequest: If the provided data is invalid, credentials are not found, or there's an API error. * @returns ElevenlabsCustomVoiceResponse * @throws ApiError */ public static aiMentorOrgsUsersElevenlabsVoiceCreate({ org, userId, formData, }: { org: string, userId: string, formData: ElevenlabsCustomVoice, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/elevenlabs-voice/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Invalid data, credentials not found, or API error`, }, }); } /** * Delete an existing Elevenlabs voice configuration. * * This endpoint removes a custom voice configuration both from the local database * and from the Elevenlabs remote API if applicable. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the voice. * voice_name: The name of the voice to delete. * * Returns: * Response: A confirmation of the deletion. * * Raises: * BadRequest: If the Elevenlabs credentials are not found or there's an API error. * @returns any Voice successfully deleted * @throws ApiError */ public static aiMentorOrgsUsersElevenlabsVoiceDestroy({ org, userId, voiceName, }: { org: string, userId: string, voiceName: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/elevenlabs-voice/{voice_name}/', path: { 'org': org, 'user_id': userId, 'voice_name': voiceName, }, errors: { 400: `Credentials not found or API error`, }, }); } /** * List datasets * List datasets belonging to the tenant. Supports server-side filtering by name substring and creator email (matched against the cached `created_by_email` in Langfuse metadata). * @returns PaginatedDatasetList * @throws ApiError */ public static evaluationsDatasetsList({ org, userId, limit, name, page, userEmail, }: { org: string, userId: string, /** * Page size (max 200). */ limit?: number, /** * Case-insensitive substring match on the dataset name. */ name?: string, /** * Page number (1-indexed). */ page?: number, /** * Filter datasets created by this user (exact match). */ userEmail?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/', path: { 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'name': name, 'page': page, 'user_email': userEmail, }, }); } /** * Create a dataset * Create a Langfuse dataset under the tenant. The creator's `username` and `user_email` are captured into metadata so future list responses can attribute the row without an extra DB lookup. * @returns Dataset * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: DatasetCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error.`, }, }); } /** * Retrieve a dataset * Get a single dataset by name. * @returns Dataset * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsRetrieve({ datasetName, org, userId, }: { datasetName: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/', path: { 'dataset_name': datasetName, 'org': org, 'user_id': userId, }, errors: { 403: `Authenticated, but the resource belongs to another tenant.`, 404: `Not found within the tenant.`, }, }); } /** * List dataset items * List items in a dataset. Pass `?include_trace=true` to attach `trace_input` / `trace_output` for items linked to a source trace (one bulk ClickHouse query for the page — no per-row fan-out). * @returns PaginatedDatasetItemList * @throws ApiError */ public static evaluationsDatasetItemsList({ datasetName, org, userId, includeTrace, limit, page, status, }: { datasetName: string, org: string, userId: string, /** * When true, populate `trace_input` / `trace_output` from the linked trace for items that have a `source_trace_id`. */ includeTrace?: boolean, /** * Page size (max 200). */ limit?: number, /** * Page number (1-indexed). */ page?: number, /** * Filter by dataset item status (exact match). */ status?: 'ACTIVE' | 'ARCHIVED', }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/', path: { 'dataset_name': datasetName, 'org': org, 'user_id': userId, }, query: { 'include_trace': includeTrace, 'limit': limit, 'page': page, 'status': status, }, errors: { 404: `Not found within the tenant.`, }, }); } /** * Add dataset items * Add items to a dataset. Provide either an `items` array of `{input, expected_output}` objects OR a `trace_ids` array to seed items from existing traces (input/expected are then copied from the trace). Exactly one of the two must be present. * @returns DatasetItemBulkCreateResponse * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsItemsCreate({ datasetName, org, userId, requestBody, }: { datasetName: string, org: string, userId: string, requestBody?: DatasetItemCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/', path: { 'dataset_name': datasetName, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error.`, 404: `Not found within the tenant.`, }, }); } /** * Retrieve a dataset item * Retrieve a single dataset item. `trace_input` / `trace_output` are always populated when the item has a `source_trace_id` (single-row case, no fan-out concern). * @returns DatasetItem * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsItemsRetrieve({ datasetName, itemId, org, userId, }: { datasetName: string, itemId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/{item_id}/', path: { 'dataset_name': datasetName, 'item_id': itemId, 'org': org, 'user_id': userId, }, errors: { 404: `Not found within the tenant.`, }, }); } /** * Update a dataset item * Update any subset of `input`, `expected_output`, `metadata`, or `status` on a dataset item. Uses Langfuse's id-based upsert. * @returns DatasetItem * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsItemsUpdate({ datasetName, itemId, org, userId, requestBody, }: { datasetName: string, itemId: string, org: string, userId: string, requestBody?: DatasetItemUpdate, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/{item_id}/', path: { 'dataset_name': datasetName, 'item_id': itemId, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error.`, 404: `Not found within the tenant.`, }, }); } /** * Delete a dataset item * Queues the item for deletion in Langfuse. List/get endpoints hide this id immediately, but Langfuse's worker can take up to a few minutes to remove it from its own stores. * @returns any Deletion queued. * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsItemsDestroy({ datasetName, itemId, org, userId, }: { datasetName: string, itemId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/{item_id}/', path: { 'dataset_name': datasetName, 'item_id': itemId, 'org': org, 'user_id': userId, }, errors: { 404: `Not found within the tenant.`, }, }); } /** * Upload a CSV of dataset items * Bulk-create items from a CSV (multipart `file` field). The CSV must have an `input` column; `expected_output` is optional. Rows with empty `input` are skipped. * @returns DatasetItemBulkCreateResponse * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsItemsUploadCreate({ datasetName, org, userId, formData, }: { datasetName: string, org: string, userId: string, formData?: { file: Blob; }, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/upload/', path: { 'dataset_name': datasetName, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Validation error.`, 404: `Not found within the tenant.`, }, }); } /** * List experiment runs * List runs for a dataset. The response merges Langfuse-persisted runs with in-flight `EvaluationTaskRecord` rows (status `pending` / `in_progress`), deduplicated by `run_name`. `pending_count` reports how many pending entries are in the page so the UI can badge in-flight work. * @returns PaginatedRunList * @throws ApiError */ public static evaluationsRunsList({ datasetName, org, userId, limit, name, page, userEmail, }: { datasetName: string, org: string, userId: string, /** * Page size (max 200). */ limit?: number, /** * Case-insensitive substring match on the run name. Applies to both pending records and Langfuse-persisted runs. */ name?: string, /** * Page number (1-indexed). */ page?: number, /** * Filter by the initiator's email. Applies to both pending records and Langfuse-persisted runs. */ userEmail?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/', path: { 'dataset_name': datasetName, 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'name': name, 'page': page, 'user_email': userEmail, }, errors: { 404: `Not found within the tenant.`, }, }); } /** * Start an experiment run * Dispatch a Celery task that runs the chosen mentor against every item in the dataset. Returns immediately (HTTP 202) with the new task record. Poll the list endpoint (or the run-detail endpoint once Langfuse persists the run) to watch the `pending → in_progress → completed` transition. * @returns Run * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsRunsCreate({ datasetName, org, userId, requestBody, }: { datasetName: string, org: string, userId: string, requestBody: ExperimentCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/', path: { 'dataset_name': datasetName, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error.`, 404: `Dataset or mentor not found within the tenant.`, }, }); } /** * Retrieve experiment run details * Returns the run header plus every `dataset_run_item` fully expanded with `input`, `expected_output`, `actual_output`, `trace_id`, and per-item `scores`. Also embeds a `pending_judges` array for any in-flight LLM-as-Judge evaluations against this run. * * Cost: 1 PG query + 2 ClickHouse queries + 1 score query regardless of run size. * @returns RunDetailResponse * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsRunsRetrieve({ datasetName, org, runName, userId, }: { datasetName: string, org: string, runName: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/', path: { 'dataset_name': datasetName, 'org': org, 'run_name': runName, 'user_id': userId, }, errors: { 403: `Authenticated, but the resource belongs to another tenant.`, 404: `Not found within the tenant.`, }, }); } /** * Delete an experiment run * Queues the run for deletion in Langfuse. List/get endpoints hide this run immediately, but Langfuse's worker can take up to a few minutes to remove it from its own stores. * @returns any Deletion queued. * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsRunsDestroy({ datasetName, org, runName, userId, }: { datasetName: string, org: string, runName: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/', path: { 'dataset_name': datasetName, 'org': org, 'run_name': runName, 'user_id': userId, }, errors: { 403: `Authenticated, but the resource belongs to another tenant.`, 404: `Not found within the tenant.`, }, }); } /** * List LLM-as-Judge evaluations for a run * Returns every judge task record (any status) targeting this run. Useful for showing an 'Evaluations' history on a run-detail view, including failed and pending ones. * @returns PaginatedJudgeList * @throws ApiError */ public static evaluationsRunJudgesList({ datasetName, org, runName, userId, limit, page, status, userEmail, }: { datasetName: string, org: string, runName: string, userId: string, /** * Page size (max 200). */ limit?: number, /** * Page number (1-indexed). */ page?: number, /** * Filter by task status. */ status?: 'completed' | 'failed' | 'in_progress' | 'pending', /** * Filter by the initiator's email. */ userEmail?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/evaluate/', path: { 'dataset_name': datasetName, 'org': org, 'run_name': runName, 'user_id': userId, }, query: { 'limit': limit, 'page': page, 'status': status, 'user_email': userEmail, }, }); } /** * Start an LLM-as-Judge evaluation * Dispatch a Celery task that runs a separate LLM over every item in the run, scoring the actual output against the input + expected output using the provided criteria. The judge's score lands in Langfuse with `score_name`, and its reasoning is stored in the score's `comment`. * * Returns immediately (HTTP 202) with the new task record. The task transitions through `pending → in_progress → completed` (or `failed`); poll the list endpoint or the run-detail endpoint to watch. * @returns JudgeRecord * @throws ApiError */ public static evaluationsRunJudgeCreate({ datasetName, org, runName, userId, requestBody, }: { datasetName: string, org: string, runName: string, userId: string, requestBody: LLMJudge, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/evaluate/', path: { 'dataset_name': datasetName, 'org': org, 'run_name': runName, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Empty run or invalid input.`, 404: `Not found within the tenant.`, }, }); } /** * Export experiment results as CSV * Download the run as a CSV. Columns: `item_id`, `input`, `expected_output`, `trace_id`, `actual_output`, and one `score_` column per distinct score name in the run. * @returns binary CSV file download. * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsDatasetsRunsExportRetrieve({ datasetName, org, runName, userId, }: { datasetName: string, org: string, runName: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/export/', path: { 'dataset_name': datasetName, 'org': org, 'run_name': runName, 'user_id': userId, }, errors: { 403: `Authenticated, but the resource belongs to another tenant.`, 404: `Not found within the tenant.`, }, }); } /** * List LLM-as-Judge evaluations (tenant-wide) * Returns every judge task record in the tenant, across all datasets and runs. Useful for a tenant-wide 'Evaluations' inbox. * @returns PaginatedJudgeList * @throws ApiError */ public static evaluationsJudgesGlobalList({ org, userId, datasetName, limit, page, status, userEmail, }: { org: string, userId: string, /** * Restrict to one dataset. */ datasetName?: string, /** * Page size (max 200). */ limit?: number, /** * Page number (1-indexed). */ page?: number, /** * Filter by task status. */ status?: 'completed' | 'failed' | 'in_progress' | 'pending', /** * Filter by the initiator's email. */ userEmail?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/judges/', path: { 'org': org, 'user_id': userId, }, query: { 'dataset_name': datasetName, 'limit': limit, 'page': page, 'status': status, 'user_email': userEmail, }, }); } /** * List score configurations * Score configurations define reusable rubrics (numeric ranges, boolean, or categorical labels). They are optional — scores work without one — but useful for enforcing consistent grading. * @returns PaginatedScoreConfigList * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsScoreConfigsRetrieve({ org, userId, limit, page, }: { org: string, userId: string, /** * Page size (max 200). */ limit?: number, /** * Page number (1-indexed). */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/score-configs/', path: { 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'page': page, }, }); } /** * Create a score configuration * Create a score configuration. * @returns ScoreConfig * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsScoreConfigsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: ScoreConfigCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/score-configs/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error.`, }, }); } /** * List scores * List scores (human annotations and LLM-judge results) with optional filters. Pair `dataset_run_id` with a run id to scope to one experiment; pass `trace_id` to scope to a single chat turn or mentor invocation. * @returns PaginatedScoreList * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsScoresRetrieve({ org, userId, datasetRunId, limit, name, page, traceId, userEmail, }: { org: string, userId: string, /** * Restrict to scores attached to this Langfuse run. */ datasetRunId?: string, /** * Page size (max 200). */ limit?: number, /** * Filter by score name (exact match). */ name?: string, /** * Page number (1-indexed). */ page?: number, /** * Restrict to scores on this trace. The same id is exposed as `generation_id` in WebSocket chat frames. */ traceId?: string, /** * Filter by the score creator's email (matched against the `created_by_email` key in score metadata). */ userEmail?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/scores/', path: { 'org': org, 'user_id': userId, }, query: { 'dataset_run_id': datasetRunId, 'limit': limit, 'name': name, 'page': page, 'trace_id': traceId, 'user_email': userEmail, }, }); } /** * Create a score * Create a score on a trace or observation. Use this to record human grading of a single chat message (pass the chat frame's `generation_id` as `trace_id`) or to score an experiment-run item. Scores on a run item's trace automatically appear in the run detail and CSV export; optionally pass `dataset_run_id` to additionally tag the score with its run for `dataset_run_id`-filtered listings. * @returns ScoreCreateResponse * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsScoresCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: ScoreCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/scores/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error.`, }, }); } /** * Delete a score * Queues the score for deletion in Langfuse. The list endpoint hides this id immediately, but Langfuse's worker can take up to a few minutes to remove it from its own stores. * @returns any Deletion queued. * @throws ApiError */ public static aiMentorOrgsUsersEvaluationsScoresDestroy({ org, scoreId, userId, }: { org: string, scoreId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/scores/{score_id}/', path: { 'org': org, 'score_id': scoreId, 'user_id': userId, }, errors: { 404: `Not found within the tenant.`, }, }); } /** * Retrieve the count of free usage credits available to a user. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to check free usage for. * * Returns: * Response: The count of free usage credits available. * * Raises: * NotFound: If the specified user does not exist. * @returns FreeUsageCount * @throws ApiError */ public static aiMentorOrgsUsersFreeUsageCountRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/free-usage-count', path: { 'org': org, 'user_id': userId, }, errors: { 404: `User not found`, }, }); } /** * List all global memories for a user. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersGlobalMemoriesRetrieve({ org, userId, content, endDate, sessionId, startDate, userId, }: { org: string, userId: string, /** * Search within memory content (case-insensitive) */ content?: string, /** * Filter memories created before this ISO datetime */ endDate?: string, /** * Filter by source session UUID */ sessionId?: string, /** * Filter memories created after this ISO datetime */ startDate?: string, /** * Filter by user_id (requires permission) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/global-memories/', path: { 'org': org, 'user_id': userId, }, query: { 'content': content, 'end_date': endDate, 'session_id': sessionId, 'start_date': startDate, 'user_id': userId, }, }); } /** * Create a new global memory. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersGlobalMemoriesCreate({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/global-memories/', path: { 'org': org, 'user_id': userId, }, }); } /** * Update a global memory (RBAC ownership-aware). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersGlobalMemoriesPartialUpdate({ memoryId, org, userId, }: { memoryId: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/global-memories/{memory_id}/', path: { 'memory_id': memoryId, 'org': org, 'user_id': userId, }, }); } /** * Delete a global memory (RBAC ownership-aware). * @returns void * @throws ApiError */ public static aiMentorOrgsUsersGlobalMemoriesDestroy({ memoryId, org, userId, }: { memoryId: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/global-memories/{memory_id}/', path: { 'memory_id': memoryId, 'org': org, 'user_id': userId, }, }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns PaginatedGoogleAgentDetailList * @throws ApiError */ public static aiMentorOrgsUsersGoogleAgentsList({ org, userId, page, pageSize, }: { org: string, userId: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/', path: { 'org': org, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, }, }); } /** * Sample Request * ``` * {"name": "my agent", "instruction": "you are a helpful agent",} * ``` * @returns GoogleAgentDetail * @throws ApiError */ public static aiMentorOrgsUsersGoogleAgentsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: GoogleAgentDetail, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns GoogleAgentDetail * @throws ApiError */ public static aiMentorOrgsUsersGoogleAgentsRetrieve({ org, uniqueId, userId, }: { org: string, uniqueId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, 'user_id': userId, }, }); } /** * Mainly used to update the sub agent list. * * Sample request: * ``` * { * "sub_agents": [ * "adc4bf84-c174-47e1-b11c-7713ef2dcd89", * "3fb5806d-3be1-4bfd-bcb0-a48558465644", * "339e44cd-6084-4530-be70-ac2a83759fb6" * ] * } * ``` * @returns GoogleAgentDetail * @throws ApiError */ public static aiMentorOrgsUsersGoogleAgentsPartialUpdate({ org, uniqueId, userId, requestBody, }: { org: string, uniqueId: string, userId: string, requestBody?: PatchedGoogleAgentDetail, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Wires RBAC into a DRF view. * * Two responsibilities: * * 1. When RBAC is enabled, replace the view's `permission_classes` with * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated` * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for * views that set `token_policies_enabled = True`). * * 2. Detect server-to-server (Django auth) callers via `is_service_account`. * Server-to-server tokens authenticate as Django auth users with no * relationship to a platform EdxUser. The convention is "we trust this * caller — bypass RBAC and serve the request." * * Combine it with the RBAC-disabled check at the top of `initial()` so * the early exit skips all RBAC prep work: * * if not ConfigFlags.rbac_enabled() or self.is_service_account: * return * * Use `is_service_account` at any other touch points where caller * identity matters (queryset ownership filters, owner attribution on * create, serializer context, etc.). * @returns void * @throws ApiError */ public static aiMentorOrgsUsersGoogleAgentsDestroy({ org, uniqueId, userId, }: { org: string, uniqueId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, 'user_id': userId, }, }); } /** * Override list to handle object ownership. * * RBAC filtering may remove owned objects if no explicit permissions. * This adds back user-scoped connections owned by the requesting user. * @returns PaginatedMCPServerConnectionList * @throws ApiError */ public static aiMentorOrgsUsersMcpServerConnectionsList({ org, userId, authType, isActive, mentor, page, pageSize, scope, search, server, user, }: { org: string, userId: string, /** * * `none` - None * * `token` - Token * * `oauth2` - Oauth2 */ authType?: 'none' | 'oauth2' | 'token', isActive?: boolean, mentor?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * Whether this connection is scoped to a user or shared across a platform. * * * `user` - User * * `mentor` - Mentor * * `platform` - Platform */ scope?: 'mentor' | 'platform' | 'user', /** * A search term. */ search?: string, server?: number, user?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/', path: { 'org': org, 'user_id': userId, }, query: { 'auth_type': authType, 'is_active': isActive, 'mentor': mentor, 'page': page, 'page_size': pageSize, 'scope': scope, 'search': search, 'server': server, 'user': user, }, }); } /** * ViewSet for MCP server connections. * * Tenant administrators can create user- or platform-scoped connections that * encapsulate the authentication configuration for invoking an MCP server. * * RBAC Resource Hierarchy: * MCPServerConnection is a subresource of MCPServer. Resource paths are: * - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/ * - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id} * @returns MCPServerConnection * @throws ApiError */ public static aiMentorOrgsUsersMcpServerConnectionsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MCPServerConnection, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Override retrieve to pass is_owner to action enforcement. * @returns MCPServerConnection * @throws ApiError */ public static aiMentorOrgsUsersMcpServerConnectionsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this mcp server connection. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * ViewSet for MCP server connections. * * Tenant administrators can create user- or platform-scoped connections that * encapsulate the authentication configuration for invoking an MCP server. * * RBAC Resource Hierarchy: * MCPServerConnection is a subresource of MCPServer. Resource paths are: * - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/ * - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id} * @returns MCPServerConnection * @throws ApiError */ public static aiMentorOrgsUsersMcpServerConnectionsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this mcp server connection. */ id: number, org: string, userId: string, requestBody: MCPServerConnection, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for MCP server connections. * * Tenant administrators can create user- or platform-scoped connections that * encapsulate the authentication configuration for invoking an MCP server. * * RBAC Resource Hierarchy: * MCPServerConnection is a subresource of MCPServer. Resource paths are: * - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/ * - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id} * @returns MCPServerConnection * @throws ApiError */ public static aiMentorOrgsUsersMcpServerConnectionsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this mcp server connection. */ id: number, org: string, userId: string, requestBody?: PatchedMCPServerConnection, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for MCP server connections. * * Tenant administrators can create user- or platform-scoped connections that * encapsulate the authentication configuration for invoking an MCP server. * * RBAC Resource Hierarchy: * MCPServerConnection is a subresource of MCPServer. Resource paths are: * - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/ * - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id} * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMcpServerConnectionsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this mcp server connection. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * List MCP servers with mentor-scoped and platform-scoped filtering. * * Query Parameters: * - mentor_unique_id (optional): Filter to mentor-scoped servers for this mentor * - include_global (optional): Include platform-scoped servers (only with mentor_unique_id) * * RBAC Logic: * - No params: Returns all accessible servers (owned + granted access + platform-scoped) * - mentor_unique_id only: Returns mentor-scoped servers for that mentor * - mentor_unique_id + include_global: Returns both mentor-scoped and platform-scoped servers * * Note: Queryset filtering is handled in get_queryset() since rbac_manager.enforce_list_data_access * will call get_queryset() internally. * @returns PaginatedMCPServerList * @throws ApiError */ public static aiMentorOrgsUsersMcpServersList({ org, userId, authScope, authType, includeGlobal = false, isEnabled, isFeatured, mentorUniqueId, page, pageSize, search, transport, url, }: { org: string, userId: string, /** * Determines the required authentication granularity. 'platform' uses shared platform credentials, 'mentor' requires mentor-level credentials, and 'user' requires each user to authenticate individually. * * * `platform` - Platform * * `mentor` - Mentor * * `user` - User */ authScope?: 'mentor' | 'platform' | 'user', /** * The type of authentication to use for the MCP server. * * * `none` - None * * `token` - Token * * `oauth2` - Oauth2 */ authType?: 'none' | 'oauth2' | 'token', /** * Include platform-scoped resources when filtering by mentor (only relevant with mentor_unique_id) */ includeGlobal?: boolean, isEnabled?: boolean, isFeatured?: boolean, /** * Optional mentor unique ID to check permissions in mentor context */ mentorUniqueId?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * A search term. */ search?: string, /** * * `sse` - Sse * * `websocket` - Websocket * * `streamable_http` - Streamable Http */ transport?: 'sse' | 'streamable_http' | 'websocket', url?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/', path: { 'org': org, 'user_id': userId, }, query: { 'auth_scope': authScope, 'auth_type': authType, 'include_global': includeGlobal, 'is_enabled': isEnabled, 'is_featured': isFeatured, 'mentor_unique_id': mentorUniqueId, 'page': page, 'page_size': pageSize, 'search': search, 'transport': transport, 'url': url, }, }); } /** * Create a new MCP server with RBAC validation. * * If mentor_unique_id is in request data, validates mentor-scoped creation permissions. * Otherwise, validates platform-scoped creation permissions. * @returns MCPServer * @throws ApiError */ public static aiMentorOrgsUsersMcpServersCreate({ org, userId, formData, }: { org: string, userId: string, formData: MCPServer, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Retrieve a single MCP server with mentor-aware RBAC validation. * * Validates permissions based on whether the server is mentor-scoped or platform-scoped. * @returns MCPServer * @throws ApiError */ public static aiMentorOrgsUsersMcpServersRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this mcp server. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Update an MCP server with mentor-aware RBAC validation. * * Validates permissions based on whether the server is mentor-scoped or platform-scoped. * @returns MCPServer * @throws ApiError */ public static aiMentorOrgsUsersMcpServersUpdate({ id, org, userId, formData, }: { /** * A unique integer value identifying this mcp server. */ id: number, org: string, userId: string, formData: MCPServer, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Partially update an MCP server with mentor-aware RBAC validation. * @returns MCPServer * @throws ApiError */ public static aiMentorOrgsUsersMcpServersPartialUpdate({ id, org, userId, formData, }: { /** * A unique integer value identifying this mcp server. */ id: number, org: string, userId: string, formData?: PatchedMCPServer, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * Delete an MCP server with mentor-aware RBAC validation. * * Validates permissions based on whether the server is mentor-scoped or platform-scoped. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMcpServersDestroy({ id, org, userId, }: { /** * A unique integer value identifying this mcp server. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Check that a given mcp server (where the user specifies oauth authentication) either has pre-configured oauth credentials * or support Dynamic Client Registration. * * This method: * 1. First checks if the MCP server already has a configured OAuth service * 2. If not, attempts to discover and register an OAuth service using Dynamic Client Registration * 3. Returns the OAuth service information if found or registered * @returns OAuthService * @throws ApiError */ public static aiMentorOrgsUsersMcpServersOauthFindCreate({ org, userId, formData, }: { org: string, userId: string, formData: MCPServerOauthFind, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/oauth-find/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * GET/POST /orgs/{org}/users/{user_id}/memsearch-config/ * * Tenant-level memsearch feature flag configuration. * Restricted to platform admins. * @returns any Tenant memsearch configuration * @throws ApiError */ public static aiMentorOrgsUsersMemsearchConfigRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-config/', path: { 'org': org, 'user_id': userId, }, }); } /** * GET/POST /orgs/{org}/users/{user_id}/memsearch-config/ * * Tenant-level memsearch feature flag configuration. * Restricted to platform admins. * @returns any Updated tenant memsearch configuration * @throws ApiError */ public static aiMentorOrgsUsersMemsearchConfigCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: { enable_memsearch: boolean; }, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-config/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request payload`, }, }); } /** * Get user's memory settings. * * Tenant admins may read any user's settings via the ``user_id`` path * segment; everyone else is pinned to their own username, so a non-admin * can never read another user's settings regardless of the path they send. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMemsearchSettingsRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-settings/', path: { 'org': org, 'user_id': userId, }, }); } /** * Update user's memory settings. * * Tenant admins may update any user's settings via the ``user_id`` path * segment; everyone else is pinned to their own username, so a non-admin * can never mutate another user's settings regardless of the path they send. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMemsearchSettingsUpdate({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-settings/', path: { 'org': org, 'user_id': userId, }, }); } /** * GET /orgs/{org}/users/{user_id}/memsearch-status/ * * Returns whether memsearch is enabled for the tenant. * Accessible by students and admins. * @returns any Tenant memsearch status * @throws ApiError */ public static aiMentorOrgsUsersMemsearchStatusRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-status/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve details of a specific user chat feedback entry. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * feedback_id: The ID of the feedback entry to retrieve. * * Returns: * Response: The feedback entry details. * * Raises: * NotFound: If the specified feedback entry does not exist. * Forbidden: If the user doesn't have permission to access this feedback. * @returns UserChatFeedback * @throws ApiError */ public static aiMentorOrgsUsersMentorFeedbackRetrieve({ feedbackId, org, userId, }: { feedbackId: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/{feedback_id}/', path: { 'feedback_id': feedbackId, 'org': org, 'user_id': userId, }, errors: { 404: `Feedback not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Update an existing user chat feedback entry. * * Args: * request: The HTTP request containing the updated feedback data. * org: The organization/tenant identifier. * feedback_id: The ID of the feedback entry to update. * * Returns: * Response: The updated feedback entry. * * Raises: * NotFound: If the specified feedback entry does not exist. * Forbidden: If the user doesn't have permission to update this feedback. * BadRequest: If the provided data is invalid or the mentor does not exist. * @returns UserChatFeedback * @throws ApiError */ public static aiMentorOrgsUsersMentorFeedbackUpdate({ feedbackId, org, userId, requestBody, }: { feedbackId: number, org: string, userId: string, requestBody: UserChatFeedback, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/{feedback_id}/', path: { 'feedback_id': feedbackId, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or mentor not found`, 404: `Feedback not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/create/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/create/` (`mentor` → `agent`) and will be removed in a future release. * * Create a new user chat feedback entry. * * Args: * request: The HTTP request containing the feedback data. * org: The organization/tenant identifier. * * Returns: * Response: The created feedback entry. * * Raises: * BadRequest: If the provided data is invalid or the mentor does not exist. * Forbidden: If the user doesn't have permission to create this feedback. * @returns UserChatFeedback * @throws ApiError */ public static aiMentorOrgsUsersMentorFeedbackCreateCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: UserChatFeedback, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/create/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-llms/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-llms/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve available LLMs for a user. * @returns LLMResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorLlmsList({ org, userId, mentorId, }: { org: string, userId: string, mentorId?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-llms/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor_id': mentorId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-memories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-memories/` (`mentor` → `agent`) and will be removed in a future release. * * List all mentor-specific memories for a user. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorMemoriesRetrieve({ org, userId, email, endDate, mentor, startDate, userId, }: { org: string, userId: string, /** * Filter by user email (admin only) */ email?: string, /** * Filter memories created before this ISO date */ endDate?: string, /** * Filter by mentor unique_id */ mentor?: string, /** * Filter memories created after this ISO date */ startDate?: string, /** * Filter by user_id (admin only) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-memories/', path: { 'org': org, 'user_id': userId, }, query: { 'email': email, 'end_date': endDate, 'mentor': mentor, 'start_date': startDate, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-tools/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-tools/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the list of available mentor tools. * @returns ToolResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorToolsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-tools/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-types/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-types/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve Mentor Types * @returns MentorType * @throws ApiError */ public static aiMentorOrgsUsersMentorTypesList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-types/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release. * * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersMentorWithSettingsCreate({ org, userId, formData, }: { org: string, userId: string, formData: MentorFromTemplateWithSettingRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-with-settings/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release. * * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns MentorFromTemplate * @throws ApiError */ public static aiMentorOrgsUsersMentorWithSettingsUpdate({ org, userId, formData, }: { org: string, userId: string, formData: MentorFromTemplate, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-with-settings/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release. * * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns MentorFromTemplate * @throws ApiError */ public static aiMentorOrgsUsersMentorWithSettingsPartialUpdate({ org, userId, formData, }: { org: string, userId: string, formData?: PatchedMentorFromTemplate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-with-settings/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release. * * View to create a mentor from a template with settings. * * Accessible to tenant admins only. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorWithSettingsDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor-with-settings/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the list of mentor audiences. * * Returns: * - 200: List of mentor audiences. * @returns MentorAudience * @throws ApiError */ public static aiMentorOrgsUsersMentorAudienceList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/audience/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` (`mentor` → `agent`) and will be removed in a future release. * * Create a new mentor audience. * * Accessible to tenant admins only. * * Returns: * - 201: Created mentor audience. * - 401: Unauthorized. * @returns MentorAudience * @throws ApiError */ public static aiMentorOrgsUsersMentorAudienceCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorAudience, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/audience/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 401: `Unauthorized - Only tenant admins can create mentor audiences.`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` (`mentor` → `agent`) and will be removed in a future release. * * Delete a mentor audience. * * Accessible to tenant admins only. * * Returns: * - 204: No content. * - 400: Bad request if audience name is missing. * - 404: Not found if audience does not exist. * - 401: Unauthorized. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorAudienceDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/audience/', path: { 'org': org, 'user_id': userId, }, errors: { 400: `Bad Request - Invalid data.`, 401: `Unauthorized - Only tenant admins can delete mentor audiences.`, 404: `Not Found - Audience does not exist.`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a list of mentor categories. * * Returns: * 200: A list of mentor categories. * @returns MentorCategory * @throws ApiError */ public static aiMentorOrgsUsersMentorCategoriesList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/categories/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` (`mentor` → `agent`) and will be removed in a future release. * * Create a new mentor category. * * Accessible only to tenant admins. * * Returns: * 200: Details of the created mentor category. * @returns MentorCategory * @throws ApiError */ public static aiMentorOrgsUsersMentorCategoriesCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: MentorCategoryCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/categories/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` (`mentor` → `agent`) and will be removed in a future release. * * Delete a mentor category. * * Accessible only to tenant admins. * * Returns: * 204: "No content" when Delete succeeded. * 400: Bad request data received * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorCategoriesDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/categories/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release. * * Seed initial mentors in a tenant. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user initiating the seeding. * * Returns: * Response: A success message with details about the seeded mentors. * * Raises: * BadRequest: If the seeding process fails. * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersMentorSeedRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/', path: { 'org': org, 'user_id': userId, }, errors: { 400: `Seeding failed`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release. * * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersMentorSeedCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: SeedMentorsView, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release. * * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersMentorSeedUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: SeedMentorsView, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release. * * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns SeedMentorsView * @throws ApiError */ public static aiMentorOrgsUsersMentorSeedPartialUpdate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: PatchedSeedMentorsView, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release. * * API view for seeding mentors in a tenant. * * This view allows platform administrators to seed initial mentors * in a tenant from predefined templates. * * Permissions: * - Restricted to platform administrators only * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorSeedDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` (`mentor` → `agent`) and will be removed in a future release. * * List mentor-specific memories grouped by category. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorMemoriesRetrieve({ mentorId, org, userId, email, endDate, myMemory, startDate, userId, }: { mentorId: string, org: string, userId: string, /** * Filter by user email (ignored when my_memory=true) */ email?: string, /** * Filter memories created before this ISO date */ endDate?: string, /** * If true, returns only the authenticated user's memories (skips RBAC and user_id filter) */ myMemory?: boolean, /** * Filter memories created after this ISO date */ startDate?: string, /** * Filter by user_id (ignored when my_memory=true) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories/', path: { 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, query: { 'email': email, 'end_date': endDate, 'my_memory': myMemory, 'start_date': startDate, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` (`mentor` → `agent`) and will be removed in a future release. * * Create a new mentor-specific memory. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorMemoriesCreate({ mentorId, org, userId, }: { mentorId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories/', path: { 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories-list/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories-list/` (`mentor` → `agent`) and will be removed in a future release. * * List mentor-specific memories with pagination. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorMemoriesListRetrieve({ mentorId, org, userId, category, email, endDate, myMemory, page, pageSize, startDate, userId, }: { mentorId: string, org: string, userId: string, /** * Filter by category slug */ category?: string, /** * Filter by user email (ignored when my_memory=true) */ email?: string, /** * Filter memories created before this ISO date */ endDate?: string, /** * If true, returns only the authenticated user's memories (skips RBAC and user_id filter) */ myMemory?: boolean, /** * Page number */ page?: number, /** * Number of results per page (max 100) */ pageSize?: number, /** * Filter memories created after this ISO date */ startDate?: string, /** * Filter by user_id (ignored when my_memory=true) */ userId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories-list/', path: { 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, query: { 'category': category, 'email': email, 'end_date': endDate, 'my_memory': myMemory, 'page': page, 'page_size': pageSize, 'start_date': startDate, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Update a mentor-specific memory (RBAC ownership-aware). * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorMemoriesPartialUpdate({ memoryId, mentorId, org, userId, }: { memoryId: number, mentorId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories/{memory_id}/', path: { 'memory_id': memoryId, 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` (`mentor` → `agent`) and will be removed in a future release. * * Delete a mentor-specific memory (RBAC ownership-aware). * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorMemoriesDestroy({ memoryId, mentorId, org, userId, }: { memoryId: number, mentorId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories/{memory_id}/', path: { 'memory_id': memoryId, 'mentor_id': mentorId, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve details of a specific mentor by slug or name. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/available-tools/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/available-tools/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve tools available for a particular mentor. The 'is_allowed' field indicates whether the tool is compatible with the mentor's current LLM configuration. * @returns ToolResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsAvailableToolsList({ mentor, org, userId, ordering, search, }: { mentor: string, org: string, userId: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A search term. */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/available-tools/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'ordering': ordering, 'search': search, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/create-call-credentials/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/create-call-credentials/` (`mentor` → `agent`) and will be removed in a future release. * * Generate IBL Call Pro authentication parameters for audio calls. * * This endpoint creates the necessary authentication tokens and parameters * for connecting to a IBL Call Pro room for audio communication with a mentor. * * Args: * request: The HTTP request object containing the required parameters. * org: The organization/tenant identifier. * user_id: The ID of the user requesting authentication. * * Returns: * Response: IBL Call Pro authentication parameters including URL, room name, * participant name, and authentication token. * * Raises: * ValidationError: If the request parameters are invalid. * BadRequest: If the IBL Call Pro credentials are not properly configured. * @returns CallAuthenticationResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsCreateCallCredentialsCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: CallAuthenticationRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/create-call-credentials/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request parameters or improperly configured IBL Call Pro credentials`, 401: `Authentication failed`, 404: `No mentor or session found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve memory components for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve memory for. * * Returns: * Response: The memory components for the mentor. * * Raises: * NotFound: If the specified mentor or memory does not exist. * @returns MemoryComponentResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsCurrentMemoryRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/current-memory/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or memory not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` (`mentor` → `agent`) and will be removed in a future release. * * Update memory components for a specific mentor. * * Args: * request: The HTTP request containing the updated memory data. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to update memory for. * * Returns: * Response: The updated memory components for the mentor. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If the specified mentor does not exist. * @returns QuestionResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsCurrentMemoryUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: QuestionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/current-memory/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the current custom voice settings for a mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the mentor link. * mentor: The unique identifier of the mentor. * * Returns: * Response: The current custom voice settings. * * Raises: * NotFound: If the specified mentor or student does not exist. * @returns MentorCustomVoiceResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsCustomVoiceRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/custom-voice/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` (`mentor` → `agent`) and will be removed in a future release. * * Set a custom voice for a mentor. * * This endpoint allows setting a custom voice for a specific mentor, * either using the default voice provider or Elevenlabs. * * Args: * request: The HTTP request containing the voice provider and name. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the mentor link. * mentor: The unique identifier of the mentor. * * Returns: * Response: The updated custom voice settings. * * Raises: * BadRequest: If the provided data is invalid or the voice does not exist. * NotFound: If the mentor or student does not exist. * @returns MentorCustomVoiceResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsCustomVoiceCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: MentorCustomVoice, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/custom-voice/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or voice not found`, 404: `Mentor or student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice-tts/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice-tts/` (`mentor` → `agent`) and will be removed in a future release. * * Generate audio from text using a mentor's custom voice. * * This endpoint converts the provided text to speech using the * custom voice configured for the specified mentor. * * Args: * request: The HTTP request containing the text to convert. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the mentor link. * mentor: The unique identifier of the mentor. * * Returns: * Response: An MP3 audio file of the synthesized speech. * * Raises: * BadRequest: If the text is empty, credentials are not found, or custom voice is not set. * NotFound: If the mentor or student does not exist. * @returns any MP3 audio file * @throws ApiError */ public static aiMentorOrgsUsersMentorsCustomVoiceTtsCreate({ mentor, org, userId, formData, }: { mentor: string, org: string, userId: string, formData?: Record, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/custom-voice-tts/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Invalid data, credentials not found, or custom voice not set`, 404: `Mentor or student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the user's default mentor for this tenant. * * Returns ``null`` when the user has not set a default mentor. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsDefaultRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/default/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` (`mentor` → `agent`) and will be removed in a future release. * * Set (or replace) the user's default mentor for this tenant. * * The unique (student, platform) constraint guarantees at most one * default mentor per user per tenant; setting a new one replaces any * existing default. * @returns UserDefaultMentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsDefaultUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/default/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor, student or platform not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` (`mentor` → `agent`) and will be removed in a future release. * * Clear the user's default mentor for this tenant. * * Idempotent: returns 204 whether or not a default was set. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorsDefaultDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/default/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Student or platform not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/edit-scenarios/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/edit-scenarios/` (`mentor` → `agent`) and will be removed in a future release. * * Update scenarios for a specific mentor. * * Args: * request: The HTTP request containing the updated scenarios. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to update scenarios for. * * Returns: * Response: The updated scenarios for the mentor. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If the specified mentor does not exist. * @returns MentorScenario * @throws ApiError */ public static aiMentorOrgsUsersMentorsEditScenariosUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: MentorScenario, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/edit-scenarios/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release. * * Fork (clone) an existing mentor. * * Args: * request: The HTTP request containing the fork parameters. * org: The organization/tenant identifier. * mentor: The identifier of the mentor to fork. * user_id: The ID of the user initiating the fork. * * Returns: * Response: The newly created forked mentor. * * Raises: * BadRequest: If the provided data is invalid or the fork operation fails. * NotFound: If the specified mentor does not exist. * @returns Mentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsForkCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: MentorFork, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or fork failed`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release. * * API view for forking (cloning) a mentor. * * This view allows users to create a copy of an existing mentor * with its settings and configurations. * * Permissions: * - Restricted to tenant admins and the student themselves * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsForkUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release. * * API view for forking (cloning) a mentor. * * This view allows users to create a copy of an existing mentor * with its settings and configurations. * * Permissions: * - Restricted to tenant admins and the student themselves * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsForkPartialUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release. * * API view for forking (cloning) a mentor. * * This view allows users to create a copy of an existing mentor * with its settings and configurations. * * Permissions: * - Restricted to tenant admins and the student themselves * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorsForkDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/fork/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/historical-memory/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/historical-memory/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve memory history entries for a specific mentor and user. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve memory history for. * mentor: The identifier of the mentor to retrieve memory history for. * * Returns: * Response: The memory history entries for the mentor and user. * * Raises: * NotFound: If the specified mentor or memory history does not exist. * @returns MemoryComponentMemoryDetail * @throws ApiError */ public static aiMentorOrgsUsersMentorsHistoricalMemoryRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/historical-memory/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or memory history not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-progress/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-progress/` (`mentor` → `agent`) and will be removed in a future release. * * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns MemoryProgress * @throws ApiError */ public static aiMentorOrgsUsersMentorsMemoryProgressRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-progress/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve memory settings for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve settings for. * * Returns: * Response: The memory settings for the mentor. * * Raises: * NotFound: If the specified mentor or settings do not exist. * @returns MentorMemorySettingsResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsMemorySettingsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or settings not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Endpoint for mentor memory item settings. * * Accessible to platform admins and superusers. * * Returns: * * 200: Change mentor memory component item. * * 400: When request is not valid. * @returns MentorMemorySettingsResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsMemorySettingsCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: MentorMemorySettingsRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve evaluation criteria for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve evaluations for. * * Returns: * Response: The evaluation criteria for the mentor. * * Raises: * NotFound: If the specified mentor or evaluations do not exist. * @returns MentorEval * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorEvalRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-eval/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or evaluations not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` (`mentor` → `agent`) and will be removed in a future release. * * Create or update evaluation criteria for a specific mentor. * * Args: * request: The HTTP request containing the evaluation data. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to create/update evaluations for. * * Returns: * Response: The created or updated evaluation criteria. * * Raises: * BadRequest: If the provided data is invalid or the mentor does not exist. * @returns MentorEval * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorEvalCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: MentorEvalRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-eval/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data or mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval-execution/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval-execution/` (`mentor` → `agent`) and will be removed in a future release. * * Run an evaluation for a specific mentor. * * Args: * request: The HTTP request containing the evaluation ID. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to evaluate. * * Returns: * Response: The ID of the generated evaluation report. * * Raises: * BadRequest: If the evaluation ID is invalid or the mentor does not match. * @returns any Evaluation execution started successfully * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorEvalExecutionCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: RunMentorEval, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-eval-execution/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid evaluation ID or mentor mismatch`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Endpoint to get user settings for a mentor. * * * GET https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/mentors/unique-id/mentor-user-settings/ * * Sample response * ``` * {"reference_saved_memories": true} * ``` * @returns MentorUserSetting * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorUserSettingsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Endpoint to set user settings for a mentor. * * * POST https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/mentors/unique-id/mentor-user-settings/ * * Sample request * ``` * {"reference_saved_memories": true} * ``` * * Sample response * ``` * {"reference_saved_memories": true} * ``` * @returns MentorUserSetting * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorUserSettingsCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: MentorUserSetting, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Mixin to set the auditlog actor context for DRF views. * * For Django auth.User (admin users): Uses auditlog's native actor FK. * For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry. * * IMPORTANT: This mixin only works for views that DO NOT override the * HTTP/action methods (post, put, patch, delete, create, update, partial_update, * destroy). For views that define their own methods, use the @with_auditlog_actor * decorator on those methods instead. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorUserSettingsUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Mixin to set the auditlog actor context for DRF views. * * For Django auth.User (admin users): Uses auditlog's native actor FK. * For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry. * * IMPORTANT: This mixin only works for views that DO NOT override the * HTTP/action methods (post, put, patch, delete, create, update, partial_update, * destroy). For views that define their own methods, use the @with_auditlog_actor * decorator on those methods instead. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorUserSettingsPartialUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Mixin to set the auditlog actor context for DRF views. * * For Django auth.User (admin users): Uses auditlog's native actor FK. * For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry. * * IMPORTANT: This mixin only works for views that DO NOT override the * HTTP/action methods (post, put, patch, delete, create, update, partial_update, * destroy). For views that define their own methods, use the @with_auditlog_actor * decorator on those methods instead. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorsMentorUserSettingsDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-user-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-settings/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve public mentor settings. * * Args: * request: HTTP request instance. * user_id: The ID of the user requesting settings. * mentor: The mentor identifier (name, slug, or unique_id). * org: The organization key. * * Returns: * Response containing the mentor settings or an error message. * @returns MentorSettingsPublic * @throws ApiError */ public static aiMentorOrgsUsersMentorsPublicSettingsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/public-settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor not found.`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-sharable-link/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-sharable-link/` (`mentor` → `agent`) and will be removed in a future release. * * Return True if the token is valid and link is enabled, else False * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersMentorsPublicSharableLinkRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/public-sharable-link/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/reports/{report_id}/agent-eval-report/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/reports/{report_id}/agent-eval-report/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a specific evaluation report. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor that was evaluated. * report_id: The ID of the evaluation report to retrieve. * * Returns: * Response: The detailed evaluation report. * * Raises: * BadRequest: If the report does not exist, does not match the mentor, or is still being generated. * @returns MentorEvalReport * @throws ApiError */ public static aiMentorOrgsUsersMentorsReportsMentorEvalReportRetrieve({ mentor, org, reportId, userId, }: { mentor: string, org: string, reportId: number, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/reports/{report_id}/mentor-eval-report/', path: { 'mentor': mentor, 'org': org, 'report_id': reportId, 'user_id': userId, }, errors: { 400: `Report not found or still being generated`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/scenarios/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/scenarios/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve available scenarios for a specific mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * mentor: The identifier of the mentor to retrieve scenarios for. * * Returns: * Response: The available scenarios for the mentor. * * Raises: * NotFound: If the specified mentor or scenarios do not exist. * @returns MentorScenario * @throws ApiError */ public static aiMentorOrgsUsersMentorsScenariosRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/scenarios/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or scenarios not found`, }, }); } /** * @deprecated * Retrieve Mentor Settings * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release. * * Fetch the settings of a mentor within an organization. Only accessible to tenant admins. * @returns MentorSettingsPublic * @throws ApiError */ public static aiMentorOrgsUsersMentorsSettingsRetrieve({ mentor, org, userId, departmentId, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, errors: { 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release. * * API view to retrieve and update mentor settings. * * Permissions: * - Only accessible to tenant admins. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsUsersMentorsSettingsCreate({ mentor, org, userId, departmentId, formData, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, formData?: MentorSettings, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * @deprecated * Update Mentor Settings * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release. * * Update various mentor settings including system prompts, tool permissions, and UI configurations. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsUsersMentorsSettingsUpdate({ mentor, org, userId, departmentId, formData, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, formData?: MentorSettingsRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Invalid request data`, 404: `Mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release. * * API view to retrieve and update mentor settings. * * Permissions: * - Only accessible to tenant admins. * @returns MentorSettings * @throws ApiError */ public static aiMentorOrgsUsersMentorsSettingsPartialUpdate({ mentor, org, userId, departmentId, formData, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, formData?: PatchedMentorSettings, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, formData: formData, mediaType: 'multipart/form-data', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release. * * API view to retrieve and update mentor settings. * * Permissions: * - Only accessible to tenant admins. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorsSettingsDestroy({ mentor, org, userId, departmentId, }: { mentor: string, org: string, userId: string, /** * Department to authorize users by */ departmentId?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release. * * Enpoints to manage mentor shareable links * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharableLinkRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release. * * Enpoints to manage mentor shareable links * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharableLinkCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: ShareableMentorLink, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release. * * Enpoints to manage mentor shareable links * @returns ShareableMentorLink * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharableLinkUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody?: ShareableMentorLink, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release. * * Enpoints to manage mentor shareable links * @returns void * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharableLinkDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/sharable-link', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * List mentors sharing this mentor's system prompt * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release. * * Share one mentor's system prompt with mentors in any tenant. * * The mentor in the URL is the **source**: its own `system_prompt` field is * the shared prompt, so there is no separate copy to keep in sync. Targets * resolve to it at chat time and keep their own prompt untouched, which is * what makes unsharing a clean restore. * * Permissions: * - The caller must be a platform admin of the source tenant *and* of * every tenant named in the request. Unlike forking, there is no * carve-out for the `main` platform. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharedPromptRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor not found`, }, }); } /** * @deprecated * Share this mentor's system prompt with more mentors * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release. * * Adds targets to the source mentor's sharing list. Idempotent: a target already consuming this source is left as-is. Requires at least one target. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharedPromptCreate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: SharedSystemPromptRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid target or share would chain`, 403: `Not a platform admin of every tenant`, 404: `Mentor or target not found`, }, }); } /** * @deprecated * Replace the set of mentors sharing this system prompt * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release. * * Share one mentor's system prompt with mentors in any tenant. * * The mentor in the URL is the **source**: its own `system_prompt` field is * the shared prompt, so there is no separate copy to keep in sync. Targets * resolve to it at chat time and keep their own prompt untouched, which is * what makes unsharing a clean restore. * * Permissions: * - The caller must be a platform admin of the source tenant *and* of * every tenant named in the request. Unlike forking, there is no * carve-out for the `main` platform. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharedPromptUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: SharedSystemPromptRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid target or share would chain`, 403: `Not a platform admin of every tenant`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release. * * Share one mentor's system prompt with mentors in any tenant. * * The mentor in the URL is the **source**: its own `system_prompt` field is * the shared prompt, so there is no separate copy to keep in sync. Targets * resolve to it at chat time and keep their own prompt untouched, which is * what makes unsharing a clean restore. * * Permissions: * - The caller must be a platform admin of the source tenant *and* of * every tenant named in the request. Unlike forking, there is no * carve-out for the `main` platform. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharedPromptPartialUpdate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * Stop sharing this mentor's system prompt * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release. * * Removes the named targets from the sharing list. Omit `targets` to remove every consumer. Each unshared mentor goes back to its own preserved system prompt. * @returns SharedSystemPromptResponse * @throws ApiError */ public static aiMentorOrgsUsersMentorsSharedPromptDestroy({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/shared-prompt/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 403: `Not a platform admin of every tenant`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-question-stats/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-question-stats/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve spaced repetition question statistics. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve statistics for. * mentor: The unique identifier of the mentor. * * Returns: * Response: Statistics about the user's performance on spaced repetition questions. * * Raises: * NotFound: If the mentor or student does not exist. * @returns SpacedRepetitionQuestionStats * @throws ApiError */ public static aiMentorOrgsUsersMentorsSpacedRepetitionQuestionStatsRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/spaced-repetition-question-stats/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a list of learning paths associated with a specific mentor and student. * * This endpoint uses the memory component to establish the learning context for a student * under the guidance of a mentor. It verifies that the provided organization identifier matches * the mentor's platform key, and then retrieves learning path tags associated with the student's * question cards. Each tag is annotated with the total number of question cards and the count of * cards with successful repetitions (i.e., correct answers). The learning paths are ordered by the * number of correct answers and limited to the top five entries. * * Args: * request: The HTTP request containing the necessary context. * org (str): The organization identifier/platform key. * user_id (str): The username of the student. * mentor (str): The unique identifier of the mentor. * *args: Additional positional arguments. * **kwargs: Additional keyword arguments. * * Returns: * Resp200onse: memory component detail infomrmation * * Raises: * NotFound: If the memory component for the specified mentor and student cannot be found, * or if the organization identifier does not match the mentor's platform key. * @returns QuestionCardTag * @throws ApiError */ public static aiMentorOrgsUsersMentorsSpacedRepetitionRecommendedPathsList({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/spaced-repetition-recommended-paths/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 404: `Mentor or student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` (`mentor` → `agent`) and will be removed in a future release. * * Set a specific learning path for spaced repetition. * * Args: * request: The HTTP request containing the learning path. * org: The organization/tenant identifier. * user_id: The ID of the user to set the learning path for. * mentor: The unique identifier of the mentor. * * Returns: * Response: The set learning path. * * Raises: * BadRequest: If the provided data is invalid. * NotFound: If the learning path, mentor, or student does not exist. * @returns SpacedRepetitionLearningPath * @throws ApiError */ public static aiMentorOrgsUsersMentorsSpacedRepetitionRecommendedPathsUpdate({ mentor, org, userId, requestBody, }: { mentor: string, org: string, userId: string, requestBody: SpacedRepetitionLearningPath, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/spaced-repetition-recommended-paths/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data`, 404: `Learning path, mentor, or student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` (`mentor` → `agent`) and will be removed in a future release. * * Endpoint for getting the star status of a mentor. * * Accessible to students and admins. * * * Returns: * * 200: Star status. * * 400: When request is not valid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsStarRetrieve({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/star/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` (`mentor` → `agent`) and will be removed in a future release. * * Endpoint for starring a mentor. * * Accessible to students and admins. * * * Returns: * * 200: Star status. * * 400: When request is not valid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsStarCreate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/star/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/summaries/{summary_type}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/summaries/{summary_type}/` (`mentor` → `agent`) and will be removed in a future release. * * GET `/api/orgs//users//mentors//summaries//` * * Endpoint to get mentor summary. The summary type can be `user` or `general`. * * Sample response: * ``` * {"rating": 3.9, "summary": "The mentor had a good chat."} * ``` * @returns MentorSummary * @throws ApiError */ public static aiMentorOrgsUsersMentorsSummariesRetrieve({ mentor, org, summaryType, userId, }: { mentor: string, org: string, summaryType: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/summaries/{summary_type}/', path: { 'mentor': mentor, 'org': org, 'summary_type': summaryType, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/unstar/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/unstar/` (`mentor` → `agent`) and will be removed in a future release. * * Remove a mentor from a user's starred list. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user unstarring the mentor. * mentor: The identifier of the mentor to unstar. * * Returns: * Response: The updated star status of the mentor. * * Raises: * NotFound: If the specified mentor or student does not exist. * BadRequest: If the request is invalid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersMentorsUnstarCreate({ mentor, org, userId, }: { mentor: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/unstar/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, errors: { 400: `Invalid request`, 404: `Mentor or student not found`, }, }); } /** * @deprecated * List Mentor Audit Logs * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/audit-logs/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/audit-logs/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve audit log entries for mentor-related models (Mentor, MentorSettings, Prompt, DocumentEmbedding) within a specific organization. Mentor owners can access audit logs for their own mentors when filtering by mentor. Supports filtering by mentor, action type, actor, and date range. * @returns PaginatedMentorAuditLogEntryList * @throws ApiError */ public static aiMentorOrgsUsersMentorsAuditLogsList({ org, userId, action, actorEmail, actorUsername, fromDate, limit, mentor, offset, toDate, }: { org: string, userId: string, /** * Filter by action type: 0=create, 1=update, 2=delete */ action?: 0 | 1 | 2, /** * Filter by actor's email */ actorEmail?: string, /** * Filter by actor's username */ actorUsername?: string, /** * Inclusive lower bound on timestamp (ISO8601 date, e.g., 2024-01-01) */ fromDate?: string, /** * Number of results to return per page. */ limit?: number, /** * Filter by mentor unique_id */ mentor?: string, /** * The initial index from which to return the results. */ offset?: number, /** * Inclusive upper bound on timestamp (ISO8601 date, e.g., 2024-12-31) */ toDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/mentors/audit-logs/', path: { 'org': org, 'user_id': userId, }, query: { 'action': action, 'actor_email': actorEmail, 'actor_username': actorUsername, 'from_date': fromDate, 'limit': limit, 'mentor': mentor, 'offset': offset, 'to_date': toDate, }, errors: { 401: `Authentication required`, 403: `Not a platform administrator`, }, }); } /** * Retrieve metadata for a mentor. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * * Returns: * Response: The mentor metadata. * * Raises: * NotFound: If no metadata exists for the specified mentor. * @returns MentorMetadata * @throws ApiError */ public static aiMentorOrgsUsersMetadataRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/metadata', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Metadata not found`, }, }); } /** * Endpoint to view and delete Moderation Logs for a tenant. * * These can be filtered by username, platform_key and mentor id * * * A search query can be conducted to search through the prompts and reason for the moderation catch event. * @returns PaginatedModerationLogList * @throws ApiError */ public static aiMentorOrgsUsersModerationLogsList({ org, userId, endTime, mentor, ordering, page, pageSize, platformKey, search, startTime, targetSystem, username, }: { org: string, userId: string, endTime?: string, mentor?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, platformKey?: string, /** * A search term. */ search?: string, startTime?: string, /** * * `Safety System` - Safety System * * `Moderation System` - Moderation System * * `Privacy System` - Privacy System * * `PHI System` - Phi System */ targetSystem?: 'Moderation System' | 'PHI System' | 'Privacy System' | 'Safety System', username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/moderation-logs/', path: { 'org': org, 'user_id': userId, }, query: { 'end_time': endTime, 'mentor': mentor, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'search': search, 'start_time': startTime, 'target_system': targetSystem, 'username': username, }, }); } /** * Endpoint to view and delete Moderation Logs for a tenant. * * These can be filtered by username, platform_key and mentor id * * * A search query can be conducted to search through the prompts and reason for the moderation catch event. * @returns ModerationLog * @throws ApiError */ public static aiMentorOrgsUsersModerationLogsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this moderation log. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/moderation-logs/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to view and delete Moderation Logs for a tenant. * * These can be filtered by username, platform_key and mentor id * * * A search query can be conducted to search through the prompts and reason for the moderation catch event. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersModerationLogsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this moderation log. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/moderation-logs/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to view logs for periodic agent runs. * * These logs contain the full mentor output for each run for debugging. * Logs are ordered from newest to oldest. However this can be changed. * * You can also filter logs for a PeriodicAgent by passing the `periodic_agent` query parameter in the URL. * @returns PaginatedPeriodicAgentLogList * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentLogsList({ org, userId, mentorId, ordering, page, pageSize, parentMentorId, parentSessionId, periodicAgent, search, status, username, }: { org: string, userId: string, mentorId?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, parentMentorId?: string, parentSessionId?: string, periodicAgent?: number, /** * A search term. */ search?: string, /** * * `success` - Success * * `error` - Error * * `running` - Running */ status?: 'error' | 'running' | 'success', username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agent-logs/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor_id': mentorId, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'parent_mentor_id': parentMentorId, 'parent_session_id': parentSessionId, 'periodic_agent': periodicAgent, 'search': search, 'status': status, 'username': username, }, }); } /** * Endpoint to view logs for periodic agent runs. * * These logs contain the full mentor output for each run for debugging. * Logs are ordered from newest to oldest. However this can be changed. * * You can also filter logs for a PeriodicAgent by passing the `periodic_agent` query parameter in the URL. * @returns PeriodicAgentLog * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentLogsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this periodic agent log. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agent-logs/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to create and view, update and delete periodic agents. * * Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) * as well as a cron schedule to trigger the periodic agent. * * Access to these are restricted to platform admins and tenant administrators * * Session information for running the periodic agent will be generated with the credentials of the * user (platform administrator) who created the agent. * * A Periodic Agent is allowed to have a `callback_url` and `callback_secret`. * When a `callback_url` is set for a Periodic Agent, a post request with data entries containing the log and timestamp * of the run will be made to the callback_url provided. * Here is the payload structure: * ``` * { * "timestamp": "timestamp when the run completed", * "status": "status of the periodic agent", * "prompt": "input prompt to agent, * "agent_output": "...final response of agent", * "log": "... full agent run log", * "log_id": periodic agent log id., * } * ``` * The payload is encrypted using the `callback_secret` provided. * * You can validate the payload using the X-Hub-Signature-256 signature header for request data. * This is a Sha256 encoded HMAC hex digest of the payload body. * * ```python * import hmac * import haslib * * def validate_payload(request: HttpRequest, callback_secret: str): * # Get the X-Hub-Signature-256 header from the request * received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "") * * if not received_signature.startswith("sha256="): * # Invalid signature format * return False * * received_signature = received_signature[len("sha256=") :] * * try: * # Get the raw request body * payload = request.body * * # Compute the expected signature using the app_secret * expected_signature = hmac.new( * callback_secret.encode(), payload, hashlib.sha256 * ).hexdigest() * * if hmac.compare_digest(received_signature, expected_signature): * # Signatures match, the payload is genuine * return True * else: * # Signatures don't match * return False * except Exception as e: * # Handle any errors that may occur during validation * return False * * ``` * @returns PaginatedPeriodicAgentList * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsList({ org, userId, enabled, mentorId, ordering, page, pageSize, parentMentorId, parentSessionId, previousAgent, previousAgentStatus, search, status, title, username, }: { org: string, userId: string, enabled?: boolean, mentorId?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, parentMentorId?: number, parentSessionId?: string, previousAgent?: number, /** * The status that the previous agent must be in before this agent gets scheduled. * * * `success` - Success * * `error` - Error * * `running` - Running * * `pending` - Pending */ previousAgentStatus?: 'error' | 'pending' | 'running' | 'success', /** * A search term. */ search?: string, /** * * `success` - Success * * `error` - Error * * `running` - Running * * `pending` - Pending */ status?: 'error' | 'pending' | 'running' | 'success', title?: string, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/', path: { 'org': org, 'user_id': userId, }, query: { 'enabled': enabled, 'mentor_id': mentorId, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'parent_mentor_id': parentMentorId, 'parent_session_id': parentSessionId, 'previous_agent': previousAgent, 'previous_agent_status': previousAgentStatus, 'search': search, 'status': status, 'title': title, 'username': username, }, }); } /** * Endpoint to create and view, update and delete periodic agents. * * Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) * as well as a cron schedule to trigger the periodic agent. * * Access to these are restricted to platform admins and tenant administrators * * Session information for running the periodic agent will be generated with the credentials of the * user (platform administrator) who created the agent. * * A Periodic Agent is allowed to have a `callback_url` and `callback_secret`. * When a `callback_url` is set for a Periodic Agent, a post request with data entries containing the log and timestamp * of the run will be made to the callback_url provided. * Here is the payload structure: * ``` * { * "timestamp": "timestamp when the run completed", * "status": "status of the periodic agent", * "prompt": "input prompt to agent, * "agent_output": "...final response of agent", * "log": "... full agent run log", * "log_id": periodic agent log id., * } * ``` * The payload is encrypted using the `callback_secret` provided. * * You can validate the payload using the X-Hub-Signature-256 signature header for request data. * This is a Sha256 encoded HMAC hex digest of the payload body. * * ```python * import hmac * import haslib * * def validate_payload(request: HttpRequest, callback_secret: str): * # Get the X-Hub-Signature-256 header from the request * received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "") * * if not received_signature.startswith("sha256="): * # Invalid signature format * return False * * received_signature = received_signature[len("sha256=") :] * * try: * # Get the raw request body * payload = request.body * * # Compute the expected signature using the app_secret * expected_signature = hmac.new( * callback_secret.encode(), payload, hashlib.sha256 * ).hexdigest() * * if hmac.compare_digest(received_signature, expected_signature): * # Signatures match, the payload is genuine * return True * else: * # Signatures don't match * return False * except Exception as e: * # Handle any errors that may occur during validation * return False * * ``` * @returns PeriodicAgentCreate * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: PeriodicAgentCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoint to create and view, update and delete periodic agents. * * Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) * as well as a cron schedule to trigger the periodic agent. * * Access to these are restricted to platform admins and tenant administrators * * Session information for running the periodic agent will be generated with the credentials of the * user (platform administrator) who created the agent. * * A Periodic Agent is allowed to have a `callback_url` and `callback_secret`. * When a `callback_url` is set for a Periodic Agent, a post request with data entries containing the log and timestamp * of the run will be made to the callback_url provided. * Here is the payload structure: * ``` * { * "timestamp": "timestamp when the run completed", * "status": "status of the periodic agent", * "prompt": "input prompt to agent, * "agent_output": "...final response of agent", * "log": "... full agent run log", * "log_id": periodic agent log id., * } * ``` * The payload is encrypted using the `callback_secret` provided. * * You can validate the payload using the X-Hub-Signature-256 signature header for request data. * This is a Sha256 encoded HMAC hex digest of the payload body. * * ```python * import hmac * import haslib * * def validate_payload(request: HttpRequest, callback_secret: str): * # Get the X-Hub-Signature-256 header from the request * received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "") * * if not received_signature.startswith("sha256="): * # Invalid signature format * return False * * received_signature = received_signature[len("sha256=") :] * * try: * # Get the raw request body * payload = request.body * * # Compute the expected signature using the app_secret * expected_signature = hmac.new( * callback_secret.encode(), payload, hashlib.sha256 * ).hexdigest() * * if hmac.compare_digest(received_signature, expected_signature): * # Signatures match, the payload is genuine * return True * else: * # Signatures don't match * return False * except Exception as e: * # Handle any errors that may occur during validation * return False * * ``` * @returns PeriodicAgent * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this periodic agent. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to create and view, update and delete periodic agents. * * Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) * as well as a cron schedule to trigger the periodic agent. * * Access to these are restricted to platform admins and tenant administrators * * Session information for running the periodic agent will be generated with the credentials of the * user (platform administrator) who created the agent. * * A Periodic Agent is allowed to have a `callback_url` and `callback_secret`. * When a `callback_url` is set for a Periodic Agent, a post request with data entries containing the log and timestamp * of the run will be made to the callback_url provided. * Here is the payload structure: * ``` * { * "timestamp": "timestamp when the run completed", * "status": "status of the periodic agent", * "prompt": "input prompt to agent, * "agent_output": "...final response of agent", * "log": "... full agent run log", * "log_id": periodic agent log id., * } * ``` * The payload is encrypted using the `callback_secret` provided. * * You can validate the payload using the X-Hub-Signature-256 signature header for request data. * This is a Sha256 encoded HMAC hex digest of the payload body. * * ```python * import hmac * import haslib * * def validate_payload(request: HttpRequest, callback_secret: str): * # Get the X-Hub-Signature-256 header from the request * received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "") * * if not received_signature.startswith("sha256="): * # Invalid signature format * return False * * received_signature = received_signature[len("sha256=") :] * * try: * # Get the raw request body * payload = request.body * * # Compute the expected signature using the app_secret * expected_signature = hmac.new( * callback_secret.encode(), payload, hashlib.sha256 * ).hexdigest() * * if hmac.compare_digest(received_signature, expected_signature): * # Signatures match, the payload is genuine * return True * else: * # Signatures don't match * return False * except Exception as e: * # Handle any errors that may occur during validation * return False * * ``` * @returns PeriodicAgentCreate * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this periodic agent. */ id: number, org: string, userId: string, requestBody: PeriodicAgentCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoint to create and view, update and delete periodic agents. * * Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) * as well as a cron schedule to trigger the periodic agent. * * Access to these are restricted to platform admins and tenant administrators * * Session information for running the periodic agent will be generated with the credentials of the * user (platform administrator) who created the agent. * * A Periodic Agent is allowed to have a `callback_url` and `callback_secret`. * When a `callback_url` is set for a Periodic Agent, a post request with data entries containing the log and timestamp * of the run will be made to the callback_url provided. * Here is the payload structure: * ``` * { * "timestamp": "timestamp when the run completed", * "status": "status of the periodic agent", * "prompt": "input prompt to agent, * "agent_output": "...final response of agent", * "log": "... full agent run log", * "log_id": periodic agent log id., * } * ``` * The payload is encrypted using the `callback_secret` provided. * * You can validate the payload using the X-Hub-Signature-256 signature header for request data. * This is a Sha256 encoded HMAC hex digest of the payload body. * * ```python * import hmac * import haslib * * def validate_payload(request: HttpRequest, callback_secret: str): * # Get the X-Hub-Signature-256 header from the request * received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "") * * if not received_signature.startswith("sha256="): * # Invalid signature format * return False * * received_signature = received_signature[len("sha256=") :] * * try: * # Get the raw request body * payload = request.body * * # Compute the expected signature using the app_secret * expected_signature = hmac.new( * callback_secret.encode(), payload, hashlib.sha256 * ).hexdigest() * * if hmac.compare_digest(received_signature, expected_signature): * # Signatures match, the payload is genuine * return True * else: * # Signatures don't match * return False * except Exception as e: * # Handle any errors that may occur during validation * return False * * ``` * @returns PeriodicAgentCreate * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this periodic agent. */ id: number, org: string, userId: string, requestBody?: PatchedPeriodicAgentCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoint to create and view, update and delete periodic agents. * * Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) * as well as a cron schedule to trigger the periodic agent. * * Access to these are restricted to platform admins and tenant administrators * * Session information for running the periodic agent will be generated with the credentials of the * user (platform administrator) who created the agent. * * A Periodic Agent is allowed to have a `callback_url` and `callback_secret`. * When a `callback_url` is set for a Periodic Agent, a post request with data entries containing the log and timestamp * of the run will be made to the callback_url provided. * Here is the payload structure: * ``` * { * "timestamp": "timestamp when the run completed", * "status": "status of the periodic agent", * "prompt": "input prompt to agent, * "agent_output": "...final response of agent", * "log": "... full agent run log", * "log_id": periodic agent log id., * } * ``` * The payload is encrypted using the `callback_secret` provided. * * You can validate the payload using the X-Hub-Signature-256 signature header for request data. * This is a Sha256 encoded HMAC hex digest of the payload body. * * ```python * import hmac * import haslib * * def validate_payload(request: HttpRequest, callback_secret: str): * # Get the X-Hub-Signature-256 header from the request * received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "") * * if not received_signature.startswith("sha256="): * # Invalid signature format * return False * * received_signature = received_signature[len("sha256=") :] * * try: * # Get the raw request body * payload = request.body * * # Compute the expected signature using the app_secret * expected_signature = hmac.new( * callback_secret.encode(), payload, hashlib.sha256 * ).hexdigest() * * if hmac.compare_digest(received_signature, expected_signature): * # Signatures match, the payload is genuine * return True * else: * # Signatures don't match * return False * except Exception as e: * # Handle any errors that may occur during validation * return False * * ``` * @returns void * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this periodic agent. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieve statistics for periodic agents, including counts of succeeded and failed tasks. A task is considered failed if its latest log has a failed status, and succeeded if its latest log has a success status. Query parameters can be used for filtering. * @returns PeriodicAgentStatistics Statistics for periodic agents. * @throws ApiError */ public static aiMentorOrgsUsersPeriodicAgentsStatisticsRetrieve({ org, userId, mentorId, }: { org: string, userId: string, mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/statistics/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor_id': mentorId, }, }); } /** * Retrieve pinned sessions for a user. * * Returns a lightweight paginated list of pinned sessions containing: * - session_id: UUID of the session * - mentor_unique_id: UUID of the mentor * - mentor: Object with unique_id (for backward compatibility) * - title: AI-generated session title * - messages: Array containing only the first message * * Query Parameters: * mentor: Filter by mentor unique_id, slug, or name (optional) * * Args: * request: The HTTP request. * org: Organization key identifier. * user_id: The username of the student. * * Returns: * Response: Paginated list of pinned sessions. * @returns SessionSummary * @throws ApiError */ public static aiMentorOrgsUsersPinMessageList({ org, userId, mentor, search, }: { org: string, userId: string, /** * Filter by mentor unique_id, slug, or name */ mentor?: string, /** * Case-insensitive search across the session title and the content of its chat messages (both human and AI). */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/pin-message/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor': mentor, 'search': search, }, }); } /** * Create a pinned message for a user session. * * Args: * request: The HTTP request containing session details. * org: Organization key identifier. * user_id: The username of the student. * * Returns: * Response: Status 201 on success. * * Raises: * NotFound: If the student does not exist. * ValidationError: If request data is invalid. * @returns PinnedMessageCreate * @throws ApiError */ public static aiMentorOrgsUsersPinMessageCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: PinnedMessageRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/pin-message/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a pinned message for a user. * * Args: * request: The HTTP request containing session details. * org: Organization key identifier. * user_id: The username of the student. * * Returns: * Response: Status 204 on success. * * Raises: * NotFound: If the student or pinned message does not exist. * ValidationError: If request data is invalid. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersPinMessageDestroy({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/pin-message/', path: { 'org': org, 'user_id': userId, }, }); } /** * Endpoints for viewing jobs and their status * A job run refers to a task with steps that an agent is going to undertake. * You can filter job runs by their status. * Note that for a single user and a specified session, at most only one JobRun instance * is active at any point in time. * @returns PaginatedJobRunList * @throws ApiError */ public static aiMentorOrgsUsersPlannedJobsList({ org, userId, active, ordering, page, pageSize, search, session, }: { org: string, userId: string, active?: boolean, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * A search term. */ search?: string, session?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/planned-jobs/', path: { 'org': org, 'user_id': userId, }, query: { 'active': active, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'search': search, 'session': session, }, }); } /** * Endpoints for viewing jobs and their status * A job run refers to a task with steps that an agent is going to undertake. * You can filter job runs by their status. * Note that for a single user and a specified session, at most only one JobRun instance * is active at any point in time. * @returns JobRun * @throws ApiError */ public static aiMentorOrgsUsersPlannedJobsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this job run. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/planned-jobs/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoints for viewing playwright scripts and updating playwright scripts for a tenant and user. * @returns PaginatedPlayWrightScriptList * @throws ApiError */ public static aiMentorOrgsUsersPlaywrightScriptsList({ org, userId, isPublic, ordering, page, pageSize, search, student, }: { org: string, userId: string, isPublic?: boolean, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * A search term. */ search?: string, /** * edX user ID */ student?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/', path: { 'org': org, 'user_id': userId, }, query: { 'is_public': isPublic, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'search': search, 'student': student, }, }); } /** * Endpoints for viewing playwright scripts and updating playwright scripts for a tenant and user. * @returns PlayWrightScript * @throws ApiError */ public static aiMentorOrgsUsersPlaywrightScriptsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: PlayWrightScript, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoints for viewing playwright scripts and updating playwright scripts for a tenant and user. * @returns PlayWrightScript * @throws ApiError */ public static aiMentorOrgsUsersPlaywrightScriptsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this play wright script. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoints for viewing playwright scripts and updating playwright scripts for a tenant and user. * @returns PlayWrightScript * @throws ApiError */ public static aiMentorOrgsUsersPlaywrightScriptsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this play wright script. */ id: number, org: string, userId: string, requestBody: PlayWrightScript, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoints for viewing playwright scripts and updating playwright scripts for a tenant and user. * @returns PlayWrightScript * @throws ApiError */ public static aiMentorOrgsUsersPlaywrightScriptsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this play wright script. */ id: number, org: string, userId: string, requestBody?: PatchedPlayWrightScript, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Endpoints for viewing playwright scripts and updating playwright scripts for a tenant and user. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersPlaywrightScriptsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this play wright script. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieve predictive analytics based on historical data variables. * * Args: * request: HTTP request containing predictive analytics input. * org: Organization key identifier. * * Returns: * - 200: Object containing predicted data. * - 400: When AI response cannot be loaded into JSON. * - 404: When OpenAI key for the tenant is not set. * - 429: When OpenAI request exceeds the rate limit. * * Example: * **POST** `/api/ai-prompt/orgs/main/users/johndoe/predictive-analytics/` * @returns PredictiveAnalyticsResponse * @throws ApiError */ public static aiMentorOrgsUsersPredictiveAnalyticsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: PredictiveAnalyticsRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/predictive-analytics/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * List projects * Retrieve a list of projects with optional filtering and search. * @returns PaginatedProjectList * @throws ApiError */ public static aiMentorOrgsUsersProjectsList({ org, userId, limit, offset, ordering, search, shared, sort, username, }: { org: string, userId: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * Which field to use when ordering the results. */ ordering?: string, /** * Search in project name and description */ search?: string, /** * Filter by shared status (true/false) */ shared?: boolean, /** * Order by field (prefix with - for descending). Example: name or -created_at */ sort?: string, /** * Filter projects by owner's username */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/projects/', path: { 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'offset': offset, 'ordering': ordering, 'search': search, 'shared': shared, 'sort': sort, 'username': username, }, }); } /** * Create a new project * Create a new project with optional mentors. * @returns Project * @throws ApiError */ public static aiMentorOrgsUsersProjectsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: Project, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/projects/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data provided`, }, }); } /** * Retrieve a project * Get detailed information about a specific project including its mentors. * @returns Project * @throws ApiError */ public static aiMentorOrgsUsersProjectsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this Project. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/projects/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 404: `Project not found`, }, }); } /** * Update a project * Update project information and optionally modify its mentors. * @returns Project * @throws ApiError */ public static aiMentorOrgsUsersProjectsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this Project. */ id: number, org: string, userId: string, requestBody: Project, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/projects/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data provided`, 403: `Permission denied`, }, }); } /** * API ViewSet for managing projects. * * Projects are groups of mentors that can be created by anyone (students and tenant admins). * They serve as a way to organize and group related mentors together. * * Projects can be: * - Personal (shared=False): Only visible to their owners * - Shared (shared=True): Visible to platform admins and potentially other users * * Projects are accessed through integrated URLs within the mentor router: * /orgs//projects/ - All accessible projects in a platform (admin access) * /orgs//projects// - Specific project (admin access) * /orgs//users//projects/ - User's projects (user access) * /orgs//users//projects// - User's specific project * * Query Parameters: * - username: Filter projects by owner's username (admin routes only) * - shared: Filter by shared status (true/false) * - search: Search in name and description * - sort: Order by field (prefix with - for descending). Example: sort=name or sort=-created_at * * Permissions: * - GET: Accessible to project owners and platform admins (for shared projects) * - POST: Any authenticated user can create projects * - PUT, PATCH, DELETE: Accessible to project owners only * @returns Project * @throws ApiError */ public static aiMentorOrgsUsersProjectsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this Project. */ id: number, org: string, userId: string, requestBody?: PatchedProject, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/projects/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a project * Delete a project permanently. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersProjectsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this Project. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/projects/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 403: `Permission denied`, }, }); } /** * Upload an asset to HeyGen * Upload a media asset to HeyGen (image/video/audio, multipart). * @returns any Asset with asset_id/url, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoAssetsCreate({ org, userId, formData, }: { org: string, userId: string, formData?: { file: Blob; }, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/assets/', path: { 'org': org, 'user_id': userId, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Missing file or over the size cap`, 403: `Permission denied`, 502: `HeyGen credential/availability error`, }, }); } /** * Create a HeyGen avatar (digital twin or photo) * Create a digital-twin or photo avatar (billable). * @returns any Avatar group/item, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoAvatarGroupsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: HeygenAvatarCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 402: `Insufficient credits`, 403: `Permission denied`, 429: `HeyGen rate limit`, 502: `HeyGen credential/availability error`, }, }); } /** * Get a HeyGen avatar group (training status) * Avatar group detail — the digital-twin training-status poll target. * @returns any Avatar group detail, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoAvatarGroupsRetrieve({ groupId, org, userId, }: { groupId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/{group_id}/', path: { 'group_id': groupId, 'org': org, 'user_id': userId, }, errors: { 403: `Permission denied`, 404: `Unknown group`, }, }); } /** * Create a HeyGen avatar consent URL * Create the consent URL for a digital-twin avatar group. * @returns any Consent URL, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoAvatarGroupsConsentCreate({ groupId, org, userId, }: { groupId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/{group_id}/consent/', path: { 'group_id': groupId, 'org': org, 'user_id': userId, }, errors: { 403: `Permission denied`, 404: `Unknown group`, }, }); } /** * List a HeyGen avatar group's looks * List the looks of an avatar group. * @returns any Looks list, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoAvatarGroupsLooksRetrieve({ groupId, org, userId, }: { groupId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/{group_id}/looks/', path: { 'group_id': groupId, 'org': org, 'user_id': userId, }, errors: { 403: `Permission denied`, }, }); } /** * List HeyGen interactive streaming avatars * List interactive-capable streaming avatars. * @returns any Streaming avatars, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoStreamingAvatarsRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/avatars/', path: { 'org': org, 'user_id': userId, }, errors: { 403: `Permission denied`, }, }); } /** * List HeyGen streaming knowledge bases * List streaming knowledge bases (flattened envelope). * @returns any Flattened list: {"data": [...]} * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoStreamingKnowledgeBasesRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/knowledge-bases/', path: { 'org': org, 'user_id': userId, }, errors: { 403: `Permission denied`, }, }); } /** * Create a HeyGen interactive streaming session * Create an interactive streaming session (billable). * * Returns ``session_id``/``access_token``/``url`` verbatim — the browser * connects to LiveKit and the streaming.chat websocket directly with the * access token; media never touches this server. * @returns any Session with session_id/access_token/url, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoStreamingSessionsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: HeygenStreamingSession, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/sessions/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 402: `Insufficient credits`, 403: `Permission denied`, 429: `HeyGen rate/session limit`, 502: `HeyGen credential/availability error`, }, }); } /** * Send a HeyGen streaming session control * `action` is one of start, stop, interrupt, keep-alive, start-listening, stop-listening, task. The session_id comes from the URL; `task` additionally takes text/task_type/task_mode. * @returns any Control result, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoStreamingSessionsControl({ action, org, sessionId, userId, requestBody, }: { action: string, org: string, sessionId: string, userId: string, requestBody: HeygenStreamingTask, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/sessions/{session_id}/{action}/', path: { 'action': action, 'org': org, 'session_id': sessionId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 403: `Permission denied`, 404: `Unknown action`, 502: `HeyGen credential/availability error`, }, }); } /** * Create a HeyGen video (avatar or image) * Create an avatar or image video (billable). * @returns any Video creation result with video_id * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoVideosCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: HeygenVideoCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/videos/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 402: `Insufficient credits`, 403: `Permission denied`, 429: `HeyGen rate limit`, 502: `HeyGen credential/availability error`, }, }); } /** * Get a HeyGen video (generation status) * Video detail — the generation-status poll target. * @returns any Video detail, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoVideosRetrieve({ org, userId, videoId, }: { org: string, userId: string, videoId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/videos/{video_id}/', path: { 'org': org, 'user_id': userId, 'video_id': videoId, }, errors: { 403: `Permission denied`, 404: `Unknown video`, }, }); } /** * List HeyGen voices * List HeyGen voices (paginated, filterable). * @returns any HeyGen voice page, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoVoicesRetrieve({ org, userId, engine, gender, language, limit, token, type, }: { org: string, userId: string, engine?: string, gender?: string, language?: string, limit?: number, token?: string, type?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/voices/', path: { 'org': org, 'user_id': userId, }, query: { 'engine': engine, 'gender': gender, 'language': language, 'limit': limit, 'token': token, 'type': type, }, errors: { 403: `Permission denied`, }, }); } /** * Clone a HeyGen voice * Clone a voice from an uploaded audio asset (billable). * @returns any Clone result with voice_clone_id * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoVoicesCloneCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: HeygenVoiceClone, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/voices/clone/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 402: `Insufficient credits`, 403: `Permission denied`, 429: `HeyGen rate limit`, 502: `HeyGen credential/availability error`, }, }); } /** * Generate a HeyGen TTS preview * Generate a TTS speech preview (billable). * @returns any Audio URL and timing, body verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersHeygenVideoVoicesSpeechCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: HeygenTtsPreview, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/voices/speech/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 402: `Insufficient credits`, 403: `Permission denied`, 429: `HeyGen rate limit`, 502: `HeyGen credential/availability error`, }, }); } /** * List Stripe checkout sessions * Stripe checkout sessions: list the collection, create a session. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCheckoutSessionsList({ org, userId, endingBefore, limit, startingAfter, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, endingBefore?: string, limit?: number, startingAfter?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/', path: { 'org': org, 'user_id': userId, }, query: { 'ending_before': endingBefore, 'limit': limit, 'starting_after': startingAfter, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Create a Stripe checkout session * Stripe checkout sessions: list the collection, create a session. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCheckoutSessionsCreate({ org, userId, idempotencyKey, requestBody, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, requestBody?: StripeCheckoutSessionCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/', path: { 'org': org, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Retrieve a Stripe checkout session * One Stripe checkout session: retrieve (sessions are not updatable here). * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCheckoutSessionsRetrieve({ org, sessionId, userId, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Expire a Stripe checkout session * Expire an open Stripe checkout session. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCheckoutSessionsExpire({ org, sessionId, userId, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, sessionId: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/{session_id}/expire/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * List Stripe customers * Stripe customers: list the collection, create a customer. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCustomersList({ org, userId, endingBefore, limit, startingAfter, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, endingBefore?: string, limit?: number, startingAfter?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/', path: { 'org': org, 'user_id': userId, }, query: { 'ending_before': endingBefore, 'limit': limit, 'starting_after': startingAfter, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Create a Stripe customer * Stripe customers: list the collection, create a customer. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCustomersCreate({ org, userId, idempotencyKey, requestBody, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, requestBody?: StripeCustomerCreate, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/', path: { 'org': org, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Retrieve a Stripe customer * One Stripe customer: retrieve, update (Stripe updates are POSTs). * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCustomersRetrieve({ customerId, org, userId, }: { customerId: string, /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/{customer_id}/', path: { 'customer_id': customerId, 'org': org, 'user_id': userId, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Update a Stripe customer * One Stripe customer: retrieve, update (Stripe updates are POSTs). * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCustomersUpdate({ customerId, org, userId, idempotencyKey, }: { customerId: string, /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/{customer_id}/', path: { 'customer_id': customerId, 'org': org, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Search Stripe customers * Search Stripe customers with the Stripe search query language. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsCustomersSearch({ org, query, userId, limit, page, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, query: string, userId: string, limit?: number, page?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/search/', path: { 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'page': page, 'query': query, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * List Stripe payment links * Stripe payment links: list the collection, create a payment link. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaymentLinksList({ org, userId, endingBefore, limit, startingAfter, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, endingBefore?: string, limit?: number, startingAfter?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/payment-links/', path: { 'org': org, 'user_id': userId, }, query: { 'ending_before': endingBefore, 'limit': limit, 'starting_after': startingAfter, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Create a Stripe payment link * Stripe payment links: list the collection, create a payment link. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaymentLinksCreate({ org, userId, requestBody, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, requestBody: StripePaymentLinkCreate, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/payment-links/', path: { 'org': org, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Retrieve a Stripe payment link * One Stripe payment link: retrieve, update (e.g. deactivate). * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaymentLinksRetrieve({ org, paymentLinkId, userId, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, paymentLinkId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/payment-links/{payment_link_id}/', path: { 'org': org, 'payment_link_id': paymentLinkId, 'user_id': userId, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Update a Stripe payment link * One Stripe payment link: retrieve, update (e.g. deactivate). * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaymentLinksUpdate({ org, paymentLinkId, userId, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, paymentLinkId: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/payment-links/{payment_link_id}/', path: { 'org': org, 'payment_link_id': paymentLinkId, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Check paywall access for a user * Answers from, in order: a short cache (grants 60s, denies 15s), the platform's recorded one-time payments, the `session_id` the buyer returned with (read-after-write safe — pass it on the checkout return page; Stripe search is ~1 min eventually consistent), then a customer search. Subscriptions are checked live so cancellation takes effect within the cache window. If Stripe is unreachable, recorded payers keep access (`stale: true`); unknown users fail closed. * @returns StripePaywallAccessResponse * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaywallAccessRead({ app, org, userId, sessionId, }: { app: string, /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, sessionId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/paywall/access/', path: { 'org': org, 'user_id': userId, }, query: { 'app': app, 'session_id': sessionId, }, errors: { 400: `Invalid input or missing tenant credential`, 403: `Permission denied`, 404: `Non-member path user`, }, }); } /** * Start a paywall checkout for a user * Creates a Stripe Checkout Session on the tenant's account for the path user. The price must belong to an active product tagged `metadata.app`; `success_url`/`cancel_url` must point at one of the platform's deployed apps, its custom domains, or localhost. Mode (one-time vs subscription) follows the price type. * @returns StripePaywallCheckoutResponse * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaywallCheckoutCreate({ org, userId, requestBody, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, requestBody: StripePaywallCheckout, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/paywall/checkout/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid input, untrusted redirect URL, price/app mismatch, or missing tenant credential`, 403: `Permission denied`, 404: `Non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * List recorded paywall payments * Payments and subscriptions the paywall has observed for this platform, newest first, served from the DM's own records — answers 'who paid for app X' without touching Stripe. Rows carry the last observed status; subscriptions refresh on every uncached access check. Body: `{count, results}`. * @returns any `{count, results: [payment, ...]}`, newest first * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPaywallPaymentsList({ org, userId, app, limit, offset, username, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, app?: string, limit?: number, offset?: number, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/paywall/payments/', path: { 'org': org, 'user_id': userId, }, query: { 'app': app, 'limit': limit, 'offset': offset, 'username': username, }, errors: { 403: `Permission denied`, 404: `Non-member path user`, }, }); } /** * List Stripe prices * Stripe prices: list the collection, create a price. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPricesList({ org, userId, endingBefore, limit, startingAfter, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, endingBefore?: string, limit?: number, startingAfter?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/prices/', path: { 'org': org, 'user_id': userId, }, query: { 'ending_before': endingBefore, 'limit': limit, 'starting_after': startingAfter, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Create a Stripe price * Stripe prices: list the collection, create a price. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPricesCreate({ org, userId, requestBody, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, requestBody: StripePriceCreate, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/prices/', path: { 'org': org, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Retrieve a Stripe price * One Stripe price: retrieve, update. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPricesRetrieve({ org, priceId, userId, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, priceId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/prices/{price_id}/', path: { 'org': org, 'price_id': priceId, 'user_id': userId, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Update a Stripe price * One Stripe price: retrieve, update. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsPricesUpdate({ org, priceId, userId, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, priceId: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/prices/{price_id}/', path: { 'org': org, 'price_id': priceId, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * List Stripe products * Stripe products: list the collection, create a product. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsProductsList({ org, userId, endingBefore, limit, startingAfter, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, endingBefore?: string, limit?: number, startingAfter?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/products/', path: { 'org': org, 'user_id': userId, }, query: { 'ending_before': endingBefore, 'limit': limit, 'starting_after': startingAfter, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Create a Stripe product * Stripe products: list the collection, create a product. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsProductsCreate({ org, userId, requestBody, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, userId: string, requestBody: StripeProductCreate, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/products/', path: { 'org': org, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * Retrieve a Stripe product * One Stripe product: retrieve, update. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsProductsRetrieve({ org, productId, userId, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, productId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/products/{product_id}/', path: { 'org': org, 'product_id': productId, 'user_id': userId, }, errors: { 400: `Invalid request or missing tenant credential`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error`, }, }); } /** * Update a Stripe product * One Stripe product: retrieve, update. * @returns any Stripe response body, verbatim * @throws ApiError */ public static aiMentorOrgsUsersProvidersStripePaymentsProductsUpdate({ org, productId, userId, idempotencyKey, }: { /** * Platform **key** (not the platform's `org` value). Must match the calling token's platform. OAuth2 client-credentials service accounts with superuser rights may name any platform. */ org: string, productId: string, userId: string, /** * Forwarded to Stripe verbatim. No server-side retries happen; supply this header to make client retries safe. */ idempotencyKey?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/products/{product_id}/', path: { 'org': org, 'product_id': productId, 'user_id': userId, }, headers: { 'Idempotency-Key': idempotencyKey, }, errors: { 400: `Invalid request or missing tenant credential`, 402: `Stripe card error, passed through`, 403: `Permission denied`, 404: `Unknown object or non-member path user`, 429: `Stripe rate limit`, 502: `Stripe credential/availability error. On a mutating call the outcome is indeterminate — the request may have been applied upstream (read timeout). Retry only with the same Idempotency-Key.`, }, }); } /** * List the user's hosting projects * Lists the path user's hosting projects, merged with live latest-deployment state from Vercel (one bulk call). When Vercel is unreachable the cached state is served with `stale: true`. * @returns any Projects with live deployment state * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDeploymentRetrieve({ org, userId, provider, }: { org: string, userId: string, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/deployment/', path: { 'org': org, 'user_id': userId, }, query: { 'provider': provider, }, errors: { 403: `Permission denied`, }, }); } /** * Deploy a project zip to Vercel * Validates the upload and credit balance synchronously, spools the zip and queues the push to Vercel. Returns 202 with `push_state: pending`; poll the detail endpoint for progress. The project is created on first deploy as `{platform}-{username}-{project}-` (the deterministic hash suffix keeps names collision-free). The live *.vercel.app host is Vercel's to mint — long names get right-truncated — so read the URL from the response (`url`/`vercel_alias`, or the poll's `deployment.aliases`), never reconstruct it from the name. Archive structure (valid zip, safe paths, size/count caps) is rejected synchronously with a 400; corruption inside a member is only detectable when the worker reads the bytes, so it surfaces asynchronously as `push_state: failed` on the poll endpoint. * @returns HostingProject * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDeploymentCreate({ org, userId, provider, formData, }: { org: string, userId: string, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, formData?: { file: Blob; project: string; /** * 'nextjs' uploads app source; Vercel installs from the lockfile and builds — poll ready_state for the build result */ framework?: 'static' | 'nextjs'; }, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/deployment/', path: { 'org': org, 'user_id': userId, }, query: { 'provider': provider, }, formData: formData, mediaType: 'multipart/form-data', errors: { 400: `Validation / credential error`, 402: `Insufficient credits`, 403: `Permission denied`, 409: `Name collision or push in progress`, }, }); } /** * Get a hosting project with live deployment state * Poll target for deploys. While a push/build is in flight only the deployment status is fetched (slim poll); once terminal the full fan-out adds project info, domains, recent deployments and — for failed builds — a build log tail. Serves cached state with `stale: true` when Vercel is unreachable. * @returns any Project with live deployment state * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDeploymentRetrieve2({ id, org, userId, provider, }: { id: number, org: string, userId: string, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/deployment/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'provider': provider, }, errors: { 403: `Permission denied`, 404: `Not found`, }, }); } /** * Delete a hosting project * Deletes the Vercel project (tolerating out-of-band deletion), its mirrored custom-domain rows and the local record. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDeploymentDestroy({ id, org, userId, provider, }: { id: number, org: string, userId: string, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/deployment/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'provider': provider, }, errors: { 400: `No Vercel credential configured`, 403: `Permission denied`, 404: `Not found`, }, }); } /** * List or inspect a project's custom domains * Without `domain`: list the project's domains. With `domain`: full detail — verification is re-checked and the DNS records the user must set (A/CNAME/TXT) are included. * @returns any Domain list or detail * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDnsRetrieve({ org, project, userId, domain, provider, }: { org: string, project: number, userId: string, domain?: string, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/dns/', path: { 'org': org, 'user_id': userId, }, query: { 'domain': domain, 'project': project, 'provider': provider, }, errors: { 403: `Permission denied`, 404: `Not found`, }, }); } /** * Attach a custom domain to a hosting project * Reserves the domain locally (mirrored into the unified /api/custom-domains/ listing), attaches it to the Vercel project and returns the DNS records to configure at the registrar. * @returns any Domain attached * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDnsCreate({ org, userId, requestBody, provider, }: { org: string, userId: string, requestBody: DomainAttach, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/dns/', path: { 'org': org, 'user_id': userId, }, query: { 'provider': provider, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation / credential error`, 403: `Permission denied`, 409: `Domain already in use`, }, }); } /** * Detach a custom domain from a hosting project * Custom domains on a hosting project, mirrored into CustomDomain. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersProvidersVercelHostingDnsDestroy({ domain, org, project, userId, provider, }: { domain: string, org: string, project: number, userId: string, /** * Hosting provider. Only 'vercel' is supported (default). */ provider?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/dns/', path: { 'org': org, 'user_id': userId, }, query: { 'domain': domain, 'project': project, 'provider': provider, }, errors: { 400: `Validation / credential error`, 403: `Permission denied`, }, }); } /** * Get recent chat sessions of a user within an organization. * @returns SessionSummary * @throws ApiError */ public static aiMentorOrgsUsersRecentMessagesList({ org, userId, mentor, search, }: { org: string, userId: string, /** * Filter by mentor unique_id, slug, or name */ mentor?: string, /** * Case-insensitive search across the session title and the content of its chat messages (both human and AI). */ search?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/recent-messages/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor': mentor, 'search': search, }, }); } /** * Endpoint for listing most recently accessed mentors. * * Accessible to students and admins. * * * Returns: * * 200: List of most recently accessed mentors. * * 400: When request is not valid. * @returns RecentlyAccessedMentor * @throws ApiError */ public static aiMentorOrgsUsersRecentlyAccessedAgentsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-agents/', path: { 'org': org, 'user_id': userId, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-agents/` (`mentor` → `agent`) and will be removed in a future release. * * Endpoint for listing most recently accessed mentors. * * Accessible to students and admins. * * * Returns: * * 200: List of most recently accessed mentors. * * 400: When request is not valid. * @returns RecentlyAccessedMentor * @throws ApiError */ public static aiMentorOrgsUsersRecentlyAccessedMentorsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-mentors/', path: { 'org': org, 'user_id': userId, }, }); } /** * Search for web resources based on a query. * * Args: * request: The HTTP request containing the search query. * org: The organization/tenant identifier. * user_id: The ID of the user making the request. * * Returns: * Response: A list of web resources matching the query. * * Raises: * ValidationError: If the search fails or returns no results. * @returns WebResource * @throws ApiError */ public static aiMentorOrgsUsersResourcesWebCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: WebResourcesQuery, }): CancelablePromise> { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/resources/web/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Failed to fetch web resources`, }, }); } /** * Endpoint to view and delete Safety System Logs for a tenant. * * These can be filtered by username, platform_key and mentor id * * * A search query can be conducted to search through the prompts and reason for the moderation catch event. * @returns PaginatedModerationLogList * @throws ApiError */ public static aiMentorOrgsUsersSafetyLogsList({ org, userId, endTime, mentor, ordering, page, pageSize, platformKey, search, startTime, targetSystem, username, }: { org: string, userId: string, endTime?: string, mentor?: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, platformKey?: string, /** * A search term. */ search?: string, startTime?: string, /** * * `Safety System` - Safety System * * `Moderation System` - Moderation System * * `Privacy System` - Privacy System * * `PHI System` - Phi System */ targetSystem?: 'Moderation System' | 'PHI System' | 'Privacy System' | 'Safety System', username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/safety-logs/', path: { 'org': org, 'user_id': userId, }, query: { 'end_time': endTime, 'mentor': mentor, 'ordering': ordering, 'page': page, 'page_size': pageSize, 'platform_key': platformKey, 'search': search, 'start_time': startTime, 'target_system': targetSystem, 'username': username, }, }); } /** * Endpoint to view and delete Safety System Logs for a tenant. * * These can be filtered by username, platform_key and mentor id * * * A search query can be conducted to search through the prompts and reason for the moderation catch event. * @returns ModerationLog * @throws ApiError */ public static aiMentorOrgsUsersSafetyLogsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this moderation log. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/safety-logs/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to view and delete Safety System Logs for a tenant. * * These can be filtered by username, platform_key and mentor id * * * A search query can be conducted to search through the prompts and reason for the moderation catch event. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersSafetyLogsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this moderation log. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/safety-logs/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieve session details including message counts and timestamps. * * Query Parameters: * page (optional, int): Page number for pagination. * * Returns: * - 200: Paginated list of session details. * - 404: Session not found. * @returns SessionDetail * @throws ApiError */ public static aiMentorOrgsUsersSessionDetailAgentsList({ mentor, org, userId, page, }: { mentor: string, org: string, userId: string, /** * Page number for pagination */ page?: number, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/agents/{mentor}/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'page': page, }, errors: { 404: `Session not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/agents/{mentor}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/agents/{mentor}/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve session details including message counts and timestamps. * * Query Parameters: * page (optional, int): Page number for pagination. * * Returns: * - 200: Paginated list of session details. * - 404: Session not found. * @returns SessionDetail * @throws ApiError */ public static aiMentorOrgsUsersSessionDetailMentorsList({ mentor, org, userId, page, }: { mentor: string, org: string, userId: string, /** * Page number for pagination */ page?: number, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/mentors/{mentor}/', path: { 'mentor': mentor, 'org': org, 'user_id': userId, }, query: { 'page': page, }, errors: { 404: `Session not found`, }, }); } /** * Retrieve user sessions filtered by start date and end date. * * Query Parameters: * start_date (optional, ISO format): Start date for filtering sessions. * end_date (optional, ISO format): End date for filtering sessions. * * Returns: * - 200: List of session IDs with insertion timestamps. * - 400: Invalid request parameters. * @returns ChatHistorySessionId * @throws ApiError */ public static aiMentorOrgsUsersSessionidList({ org, userId, endDate, startDate, }: { org: string, userId: string, endDate?: string, startDate?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessionid/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Bad request`, }, }); } /** * Retrieve or create a chat session with a mentor. * * Passing `null` as `tools` results in using all tools assigned to the mentor. * To specify that no tools be used, pass an empty list. * * Session identity is derived from the request itself, never from user * input: an authenticated caller is attributed via `request.user` * (tenant-scoped to `org`), while an anonymous caller gets no student * linkage and is only permitted on `allow_anonymous` mentors. * * Args: * request: HTTP request containing mentor details. * org: Organization key identifier. * * Returns: * Response: JSON object containing the session ID. * * Raises: * Http404: If the mentor is not found. * ValidationError: If the username is invalid. * ValidationError: If one or more tool slugs are invalid. * @returns ChatSessionResponse * @throws ApiError */ public static aiMentorOrgsUsersSessionsCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: ChatSessionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve Chat Messages * Fetches chat messages for a specific session. * @returns MessageView * @throws ApiError */ public static aiMentorOrgsUsersSessionsRetrieve({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, }); } /** * Update the title of a chat session and its tools * @returns MessageViewUpdatResponse * @throws ApiError */ public static aiMentorOrgsUsersSessionsUpdate({ org, sessionId, userId, requestBody, }: { org: string, sessionId: string, userId: string, requestBody?: MessageViewRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Deletes all messages in a chat session. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersSessionsDestroy({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, }); } /** * Endpoint to fetch the logs of a session. * Logs are cached for up to 1 hour of their creation: accessing the logs after an hour will result in an empty data. * * This is intentional and made to avoid cases where logs bloat our in-memory db. * * Accessible to tenant admins and students. * * Url Args: * org (str): The organization's platform key. * user_id (str): The username identifier of the individual. * session_id (str): The session id. * * Returns: * * 200: a SessionBrowserScreenshot object * @returns SessionBrowserScreenshot * @throws ApiError */ public static aiMentorOrgsUsersSessionsBrowserScreenshotRetrieve({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/browser-screenshot/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, errors: { 404: `Session or screenshots not found`, }, }); } /** * Disable chat history on a session (one-way) * Sets `disable_chathistory=True` on an existing session and nulls `Session.student` to sever the user↔session link. Subsequent messages are not written to ChatMessageHistory. Pre-toggle messages are NOT retroactively removed. The flag cannot be flipped back to False once set. * @returns SessionDisableChathistoryResponse * @throws ApiError */ public static aiMentorOrgsUsersSessionsDisableChathistoryCreate({ org, sessionId, userId, requestBody, }: { org: string, sessionId: string, userId: string, requestBody: SessionDisableChathistoryRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/disable-chathistory/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `True→False transition rejected (one-way door)`, 404: `Session not found in this org, or caller is not the owner / a platform admin.`, }, }); } /** * Retrieves the chat history for a session as a plain text file. * * Returns: * 200: txt file containing coversation * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersSessionsDownloadSessionRetrieve({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/download-session', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, }); } /** * Retrieve memory data for a specific session. * * This endpoint returns the memory components (knowledge gaps, lessons learned, * help requests) that were generated during the specified chat session. * * Args: * org: The organization/tenant identifier. * user_id: The ID of the user who owns the session. * session_id: The ID of the session to retrieve memory for. * * Returns: * Response: The memory data associated with the session. * * Raises: * NotFound: If the session does not exist or does not belong to the user. * @returns SessionMemoryStorage * @throws ApiError */ public static aiMentorOrgsUsersSessionsMemoryRetrieve({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/memory/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, errors: { 404: `Session not found or does not belong to user`, }, }); } /** * Retrieve Shared Messages * Fetches shared chat messages for a specific session. * @returns MessageView * @throws ApiError */ public static aiMentorOrgsUsersSessionsSharedRetrieve({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/shared/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, }); } /** * Share Session * Allows users to mark their session as shared. Anonymous users can only share sessions created in anonymous mode. * @returns SharedSessionUpdateResponse * @throws ApiError */ public static aiMentorOrgsUsersSessionsSharedUpdate({ org, sessionId, userId, requestBody, }: { org: string, sessionId: string, userId: string, requestBody: SharedSessionUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/shared/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve shell logs for a specific session. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user who owns the session. * session_id: The ID of the session to retrieve logs for. * * Returns: * Response: The shell logs for the specified session. * * Raises: * NotFound: If the specified session does not exist. * @returns ShellLogs * @throws ApiError */ public static aiMentorOrgsUsersSessionsShellLogsRetrieve({ org, sessionId, userId, }: { org: string, sessionId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/shell-logs/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, errors: { 404: `Session not found`, }, }); } /** * Retrieve a list of related questions based on a chat session. * @returns RelatedText * @throws ApiError */ public static aiMentorOrgsUsersSessionsSuggestionList({ org, sessionId, userId, numQuestions = 3, }: { org: string, sessionId: string, userId: string, numQuestions?: number, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/suggestion', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, query: { 'num_questions': numQuestions, }, }); } /** * Retrieves the chat history for a given session if the export task is ready. * * Returns: * * 200: When task is not ready. * * 200: chat history object * * 400: When data is not valid. * @returns ChatHistoryItem * @throws ApiError */ public static aiMentorOrgsUsersSessionsTasksRetrieve({ org, sessionId, taskId, userId, toCsv = false, }: { org: string, sessionId: string, taskId: string, userId: string, /** * Choose download in csv or not */ toCsv?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/tasks/{task_id}/', path: { 'org': org, 'session_id': sessionId, 'task_id': taskId, 'user_id': userId, }, query: { 'to_csv': toCsv, }, }); } /** * Retrieve all LLM models assigned to a specific tenant. * * Args: * request: The HTTP request. * org: The unique identifier of the tenant. * * Returns: * Response: A list of LLM models assigned to the tenant. * * Raises: * NotFound: If the specified tenant does not have any associated models. * ValidationError: If an unexpected error occurs. * @returns LLMModelForTenant * @throws ApiError */ public static aiMentorOrgsUsersSettingsTenantLlmList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/settings/tenant-llm/', path: { 'org': org, 'user_id': userId, }, }); } /** * Create or update an LLM model for a tenant. * * Accessible only to tenant administrators. * * Args: * request: The HTTP request containing LLM model details. * org: The unique identifier of the tenant. * * Returns: * Response: Details of the newly created or updated LLM model. * * Raises: * ValidationError: If request data is invalid. * NotFound: If the tenant does not exist. * @returns LLMModelForTenant * @throws ApiError */ public static aiMentorOrgsUsersSettingsTenantLlmCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: LLMModelForTenant, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/settings/tenant-llm/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve a list of mentors starred by a specific user. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve starred mentors for. * * Returns: * Response: A list of the user's starred mentors, sorted by most recently accessed. * * Raises: * NotFound: If the specified student does not exist. * BadRequest: If the request is invalid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersStarredAgentsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/starred-agents/', path: { 'org': org, 'user_id': userId, }, errors: { 400: `Invalid request`, 404: `Student not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/starred-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/starred-agents/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve a list of mentors starred by a specific user. * * Args: * request: The HTTP request. * org: The organization/tenant identifier. * user_id: The ID of the user to retrieve starred mentors for. * * Returns: * Response: A list of the user's starred mentors, sorted by most recently accessed. * * Raises: * NotFound: If the specified student does not exist. * BadRequest: If the request is invalid. * @returns StarMentor * @throws ApiError */ public static aiMentorOrgsUsersStarredMentorsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/starred-mentors/', path: { 'org': org, 'user_id': userId, }, errors: { 400: `Invalid request`, 404: `Student not found`, }, }); } /** * Stop an active chat generation * Stops an ongoing LLM generation for a mentor chat session. The generation_id is returned when starting a chat and can be used to stop the generation before it completes. * @returns any Generation stopped successfully * @throws ApiError */ public static aiMentorOrgsUsersStopGenerationCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: StopGenerationRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/stop-generation/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation error`, 404: `Generation not found`, 500: `Internal server error`, }, }); } /** * Retrieve Subjects * @returns Subject * @throws ApiError */ public static aiMentorOrgsUsersSubjectsList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/subjects/', path: { 'org': org, 'user_id': userId, }, }); } /** * ViewSet for managing ticket messages. * * This ViewSet provides endpoints to retrieve, create, and update ticket messages. * * Permissions: * - Platform Admins: * - Platform admins are able to view all ticket messages for the tenant. * - Students: * - Students are able to view all ticket messages for only the ticket they are associated with. * @returns PaginatedTicketMessageList * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketMessagesList({ org, userId, page, pageSize, sender, ticket, }: { org: string, userId: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, sender?: string, ticket?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/', path: { 'org': org, 'user_id': userId, }, query: { 'page': page, 'page_size': pageSize, 'sender': sender, 'ticket': ticket, }, }); } /** * ViewSet for managing ticket messages. * * This ViewSet provides endpoints to retrieve, create, and update ticket messages. * * Permissions: * - Platform Admins: * - Platform admins are able to view all ticket messages for the tenant. * - Students: * - Students are able to view all ticket messages for only the ticket they are associated with. * @returns TicketMessage * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketMessagesCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: TicketMessage, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing ticket messages. * * This ViewSet provides endpoints to retrieve, create, and update ticket messages. * * Permissions: * - Platform Admins: * - Platform admins are able to view all ticket messages for the tenant. * - Students: * - Students are able to view all ticket messages for only the ticket they are associated with. * @returns TicketMessage * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketMessagesRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this ticket message. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * ViewSet for managing ticket messages. * * This ViewSet provides endpoints to retrieve, create, and update ticket messages. * * Permissions: * - Platform Admins: * - Platform admins are able to view all ticket messages for the tenant. * - Students: * - Students are able to view all ticket messages for only the ticket they are associated with. * @returns TicketMessage * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketMessagesUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this ticket message. */ id: number, org: string, userId: string, requestBody: TicketMessage, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing ticket messages. * * This ViewSet provides endpoints to retrieve, create, and update ticket messages. * * Permissions: * - Platform Admins: * - Platform admins are able to view all ticket messages for the tenant. * - Students: * - Students are able to view all ticket messages for only the ticket they are associated with. * @returns TicketMessage * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketMessagesPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this ticket message. */ id: number, org: string, userId: string, requestBody?: PatchedTicketMessage, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing ticket messages. * * This ViewSet provides endpoints to retrieve, create, and update ticket messages. * * Permissions: * - Platform Admins: * - Platform admins are able to view all ticket messages for the tenant. * - Students: * - Students are able to view all ticket messages for only the ticket they are associated with. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketMessagesDestroy({ id, org, userId, }: { /** * A unique integer value identifying this ticket message. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * ViewSet for managing Human Support Tickets. * * This ViewSet provides endpoints to retrieve, create, and update Human Support Tickets. * * Permissions: * Platform Admins: * - Platform admins are able to update the ticket status, and view all tickets for the tenant. * - Platform admins can only update the `subject`, `description` and `status` fields. * Students: * - Students are only able to view their own created tickets. * - students can modify only the `subject` and `description` entries * * Field Updates: * - subject: Modifiable by both student and platform admin * - description: Modifiable by only student. * - status: Modifiable by only platform admin. * @returns PaginatedHumanSupportTicketList * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketsList({ org, userId, mentorId, page, pageSize, session, status, username, }: { org: string, userId: string, mentorId?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, session?: string, /** * * `open` - Open * * `in_progress` - In Progress * * `closed` - Closed */ status?: 'closed' | 'in_progress' | 'open', username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor_id': mentorId, 'page': page, 'page_size': pageSize, 'session': session, 'status': status, 'username': username, }, }); } /** * ViewSet for managing Human Support Tickets. * * This ViewSet provides endpoints to retrieve, create, and update Human Support Tickets. * * Permissions: * Platform Admins: * - Platform admins are able to update the ticket status, and view all tickets for the tenant. * - Platform admins can only update the `subject`, `description` and `status` fields. * Students: * - Students are only able to view their own created tickets. * - students can modify only the `subject` and `description` entries * * Field Updates: * - subject: Modifiable by both student and platform admin * - description: Modifiable by only student. * - status: Modifiable by only platform admin. * @returns HumanSupportTicket * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketsRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this human support ticket. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * ViewSet for managing Human Support Tickets. * * This ViewSet provides endpoints to retrieve, create, and update Human Support Tickets. * * Permissions: * Platform Admins: * - Platform admins are able to update the ticket status, and view all tickets for the tenant. * - Platform admins can only update the `subject`, `description` and `status` fields. * Students: * - Students are only able to view their own created tickets. * - students can modify only the `subject` and `description` entries * * Field Updates: * - subject: Modifiable by both student and platform admin * - description: Modifiable by only student. * - status: Modifiable by only platform admin. * @returns HumanSupportTicket * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketsUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this human support ticket. */ id: number, org: string, userId: string, requestBody: HumanSupportTicket, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing Human Support Tickets. * * This ViewSet provides endpoints to retrieve, create, and update Human Support Tickets. * * Permissions: * Platform Admins: * - Platform admins are able to update the ticket status, and view all tickets for the tenant. * - Platform admins can only update the `subject`, `description` and `status` fields. * Students: * - Students are only able to view their own created tickets. * - students can modify only the `subject` and `description` entries * * Field Updates: * - subject: Modifiable by both student and platform admin * - description: Modifiable by only student. * - status: Modifiable by only platform admin. * @returns HumanSupportTicket * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketsPartialUpdate({ id, org, userId, requestBody, }: { /** * A unique integer value identifying this human support ticket. */ id: number, org: string, userId: string, requestBody?: PatchedHumanSupportTicket, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * ViewSet for managing Human Support Tickets. * * This ViewSet provides endpoints to retrieve, create, and update Human Support Tickets. * * Permissions: * Platform Admins: * - Platform admins are able to update the ticket status, and view all tickets for the tenant. * - Platform admins can only update the `subject`, `description` and `status` fields. * Students: * - Students are only able to view their own created tickets. * - students can modify only the `subject` and `description` entries * * Field Updates: * - subject: Modifiable by both student and platform admin * - description: Modifiable by only student. * - status: Modifiable by only platform admin. * @returns void * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketsDestroy({ id, org, userId, }: { /** * A unique integer value identifying this human support ticket. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Endpoint to close a Human support ticket. * * This endpoint is used to close a Human support ticket. * * Permissions: * - available to both platform admins and the student who created the ticket. * * Returns: * Response: A response object containing the closed ticket data. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsUsersSupportTicketsCloseCreate({ id, org, userId, }: { /** * A unique integer value identifying this human support ticket. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/close/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieves the status of a task using its task ID. * * Accessible to both tenant admins and students. * * Returns: * * 200: task id * @returns RetrieveTask * @throws ApiError */ public static aiMentorOrgsUsersTasksRetrieve({ org, taskId, userId, }: { org: string, taskId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/tasks/{task_id}', path: { 'org': org, 'task_id': taskId, 'user_id': userId, }, }); } /** * Export chat history for a session. * * Returns: * 200: Task ID for the export operation. * @returns TaskView * @throws ApiError */ public static aiMentorOrgsUsersTasksSessionsCreate({ org, sessionId, userId, requestBody, }: { org: string, sessionId: string, userId: string, requestBody: TaskView, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/tasks/sessions/{session_id}/', path: { 'org': org, 'session_id': sessionId, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve Tool Categories * @returns ToolCategory * @throws ApiError */ public static aiMentorOrgsUsersToolCategoriesList({ org, userId, }: { org: string, userId: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/tool-categories/', path: { 'org': org, 'user_id': userId, }, }); } /** * Retrieve a list of available voice options. * * Args: * request: The HTTP request. * * Returns: * Response: A list of available voice options. * * Raises: * NotFound: If no voice options are available. * @returns PaginatedVoiceList * @throws ApiError */ public static aiMentorOrgsUsersVoicesList({ org, userId, ordering, page, pageSize, provider, search, }: { org: string, userId: string, /** * Which field to use when ordering the results. */ ordering?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, /** * * `browser` - Browser * * `openai` - Openai * * `google` - Google * * `iblai` - ibl.ai * * `elevenlabs` - Elevenlabs */ provider?: 'browser' | 'elevenlabs' | 'google' | 'iblai' | 'openai', /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/voices/', path: { 'org': org, 'user_id': userId, }, query: { 'ordering': ordering, 'page': page, 'page_size': pageSize, 'provider': provider, 'search': search, }, errors: { 404: `Voice options not found`, }, }); } /** * Retrieve details of a specific voice option. * * Args: * request: The HTTP request. * pk: The primary key of the voice option to retrieve. * * Returns: * Response: The details of the specified voice option. * * Raises: * NotFound: If the specified voice option does not exist. * @returns Voice * @throws ApiError */ public static aiMentorOrgsUsersVoicesRetrieve({ id, org, userId, }: { /** * A unique integer value identifying this voice. */ id: number, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/users/{user_id}/voices/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, errors: { 404: `Voice option not found`, }, }); } /** * OpenAI-compatible chat completions. Set `stream=true` for a Server-Sent Events (`text/event-stream`) response of `chat.completion.chunk` objects terminated by `data: [DONE]`; otherwise a single `chat.completion` object is returned. Streaming is async-native and served only from the ASGI deployment. The `model` field must be in `provider/model` form (e.g. `openai/gpt-4o`). * @returns ChatCompletionRequest * @throws ApiError */ public static aiMentorOrgsV1ChatCompletionsCreate({ org, requestBody, format, }: { org: string, requestBody: ChatCompletionRequest, format?: 'event-stream' | 'json', }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/v1/chat/completions', path: { 'org': org, }, query: { 'format': format, }, body: requestBody, mediaType: 'application/json', }); } /** * ``GET /orgs//v1/models`` — list available models for the tenant. * * Model ids are returned in ``provider/model`` form so they can be passed * straight back to the chat completions endpoint. * @returns any No response body * @throws ApiError */ public static aiMentorOrgsV1ModelsRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/v1/models', path: { 'org': org, }, }); } /** * @returns any No response body * @throws ApiError */ public static aiMentorOrgsWebhooksAzureTriggerCreate({ org, slug, }: { org: string, slug: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/webhooks/azure/trigger/{slug}/', path: { 'org': org, 'slug': slug, }, }); } /** * List workflows * Retrieve a list of workflows in the platform with optional filtering and search. * @returns PaginatedWorkflowList * @throws ApiError */ public static aiMentorOrgsWorkflowsList({ org, createdBy, isActive, isTemplate, limit, offset, search, sort, }: { org: string, /** * Filter by creator username */ createdBy?: string, /** * Filter by active status */ isActive?: boolean, /** * Filter by template status */ isTemplate?: boolean, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * Search in workflow name and description */ search?: string, /** * Order by field (prefix with - for descending). Example: name or -created_at */ sort?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/workflows/', path: { 'org': org, }, query: { 'created_by': createdBy, 'is_active': isActive, 'is_template': isTemplate, 'limit': limit, 'offset': offset, 'search': search, 'sort': sort, }, }); } /** * Create a new workflow * Create a new workflow definition. Basic ReactFlow JSON validation is performed. * @returns Workflow * @throws ApiError */ public static aiMentorOrgsWorkflowsCreate({ org, requestBody, }: { org: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data provided`, }, }); } /** * Retrieve a workflow * Get detailed information about a specific workflow. * @returns Workflow * @throws ApiError */ public static aiMentorOrgsWorkflowsRetrieve({ org, uniqueId, }: { org: string, uniqueId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, }, errors: { 404: `Workflow not found`, }, }); } /** * Update a workflow * Update workflow information. Basic ReactFlow JSON validation is performed. * @returns Workflow * @throws ApiError */ public static aiMentorOrgsWorkflowsUpdate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Invalid data provided`, 403: `Permission denied`, }, }); } /** * API ViewSet for managing workflows. * * Provides CRUD operations for workflow definitions with platform-scoped access. * All operations require platform admin permissions. * * Endpoints: * - GET /orgs//workflows/ - List workflows in platform * - POST /orgs//workflows/ - Create new workflow * - GET /orgs//workflows// - Retrieve workflow * - PUT/PATCH /orgs//workflows// - Update workflow * - DELETE /orgs//workflows// - Delete workflow * - POST /orgs//workflows//validate/ - Validate workflow for execution * - POST /orgs//workflows//publish/ - Save, validate, and activate * - POST /orgs//workflows//activate/ - Validate and activate (no save) * - POST /orgs//workflows//deactivate/ - Take offline * - POST /orgs//workflows//unpublish/ - Alias for deactivate * - GET/POST /orgs//workflows//chat/ - Get entry mentor info for chat * * Query Parameters: * - search: Search in name and description fields * - is_active: Filter by active status (true/false) * - is_template: Filter by template status (true/false) * - created_by: Filter by creator username * - sort: Order by field (prefix with - for descending) * Examples: sort=name, sort=-created_at, sort=updated_at * * Permissions: * - Uses RBAC for fine-grained access control * - Owner-based access via created_by field * * Note: The 'org' URL parameter maps to Platform.key (platform key). * This is a naming convention in the codebase for consistency. * @returns Workflow * @throws ApiError */ public static aiMentorOrgsWorkflowsPartialUpdate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody?: PatchedWorkflow, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', }); } /** * Delete a workflow * Delete a workflow permanently. * @returns void * @throws ApiError */ public static aiMentorOrgsWorkflowsDestroy({ org, uniqueId, }: { org: string, uniqueId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/', path: { 'org': org, 'unique_id': uniqueId, }, errors: { 403: `Permission denied`, }, }); } /** * Activate a workflow * Validate and activate an already-saved workflow. Unlike publish, this does not save changes - it uses the current saved state. * @returns any Workflow activated * @throws ApiError */ public static aiMentorOrgsWorkflowsActivateCreate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/activate/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation failed`, }, }); } /** * Chat with workflow * Send a message to the workflow and receive a response. The workflow must be active. Messages are routed through the entry mentor. * @returns any Chat response * @throws ApiError */ public static aiMentorOrgsWorkflowsChatCreate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody?: { /** * The message to send */ message: string; }, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/chat/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request`, }, }); } /** * Deactivate a workflow * Take a workflow offline while preserving its saved state. * @returns any Workflow deactivated * @throws ApiError */ public static aiMentorOrgsWorkflowsDeactivateCreate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/deactivate/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', }); } /** * Publish a workflow * Save, validate, and activate a workflow in one operation. Optionally accepts partial workflow updates in the request body. If validation fails, the workflow is saved but not activated. * @returns any Workflow published successfully * @throws ApiError */ public static aiMentorOrgsWorkflowsPublishCreate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/publish/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Validation failed`, }, }); } /** * Unpublish a workflow * Alias for deactivate. Takes a workflow offline while preserving its saved state. * @returns any Workflow unpublished * @throws ApiError */ public static aiMentorOrgsWorkflowsUnpublishCreate({ org, uniqueId, requestBody, }: { org: string, uniqueId: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/unpublish/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', }); } /** * Validate workflow for execution * Phase 2: Comprehensive execution validation. Validates workflow definition for schema, connectivity, security, and executability. This is separate from the basic validation done during create/update, allowing users to save draft workflows. * @returns any Validation results * @throws ApiError */ public static aiMentorOrgsWorkflowsValidateCreate({ org, uniqueId, requestBody, }: { org: string, /** * Workflow unique identifier */ uniqueId: string, requestBody: Workflow, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/orgs/{org}/workflows/{unique_id}/validate/', path: { 'org': org, 'unique_id': uniqueId, }, body: requestBody, mediaType: 'application/json', errors: { 404: `Workflow not found`, }, }); } /** * Get available node types * Returns metadata about all available workflow node types. Use this endpoint to populate the workflow editor with available nodes, their categories, required fields, and configuration options. * @returns any Node types metadata * @throws ApiError */ public static aiMentorOrgsWorkflowsNodeTypesRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/orgs/{org}/workflows/node-types/', path: { 'org': org, }, }); } /** * Health check for the voice transcription provider. * * Optional query params: * - ``provider``: one of ``openai``, ``google``, ``groq``. Defaults to ``openai``. * - ``tenant``: tenant key whose credentials should be used. Falls back * to global credentials when omitted. * * Returns 200 if the provider transcribed a synthetic silent audio sample * successfully (an empty transcript is still a successful round-trip). * Returns 503 with details otherwise. * @returns any No response body * @throws ApiError */ public static aiMentorVoiceTranscriptionHealthRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-mentor/voice-transcription/health/', }); } /** * @returns any No response body * @throws ApiError */ public static aiMentorWebhooksAzureEmailchatCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/webhooks/azure/emailchat/', }); } /** * This is the endpoint called by N8N workflows from N8N, to report progress to the mentor SPA(DM) * * Example request: * ``` * {"unique_id": "the-unique-id", "progress": "the email was successfully sent.", "finished": false} * ``` * @returns any No response body * @throws ApiError */ public static aiMentorWebhooksN8NProgressCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-mentor/webhooks/n8n-progress/', }); } }