Skip to content

Latest commit

 

History

History
142 lines (91 loc) · 10.2 KB

File metadata and controls

142 lines (91 loc) · 10.2 KB

Beta.Users

Overview

Available Operations

get_identity

Get Identity

Example Usage

from mistralai.client import Mistral, models
import os


with Mistral() as mistral:

    res = mistral.beta.users.get_identity(security=models.UsersAPIGetIdentitySecurity(
        dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
    ))

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
security models.UsersAPIGetIdentitySecurity ✔️ The security requirements to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.UserIdentity

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_organizations

List every organization the authenticated user is a member of.

Identity-only: the caller need not have selected an organization, so this reads only the user and never scopes by the active org.

Example Usage

from mistralai.client import Mistral, models
import os


with Mistral() as mistral:

    res = mistral.beta.users.list_organizations(security=models.UsersAPIListOrganizationsSecurity(
        dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
    ), offset=0, limit=100)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
security models.UsersAPIListOrganizationsSecurity ✔️ N/A
offset Optional[int] Number of organizations to skip before returning results. 0
limit Optional[int] Maximum number of organizations to return. 100
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.UsersAPIListOrganizationsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_workspaces

List every workspace the authenticated user is a member of, across all their organizations, each tagged with the organization it belongs to.

Example Usage

from mistralai.client import Mistral, models
import os


with Mistral() as mistral:

    res = mistral.beta.users.list_workspaces(security=models.UsersAPIListWorkspacesSecurity(
        dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
    ), organization_id="1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d", offset=0, limit=100)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
security models.UsersAPIListWorkspacesSecurity ✔️ N/A
organization_id OptionalNullable[str] Return only workspaces belonging to this organization. 1a2b3c4d-5e6f-4a8b-9c0d-1e2f3a4b5c6d
offset Optional[int] Number of workspaces to skip before returning results. 0
limit Optional[int] Maximum number of workspaces to return. 100
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.UsersAPIListWorkspacesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*