> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deasylabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Suggest a taxonomy from a description

> Suggests a taxonomy structure and tags from a free-form description of the data. Nothing is saved. When validate_tags is true and a datasource_id is given, the suggested tags are scored against a sample of that datasource's files.



## OpenAPI

````yaml /deasy-openapi.yml post /v2/taxonomies/generate-from-context
openapi: 3.1.0
info:
  title: Collibra Unstructured API
  description: >
    REST API for Collibra Unstructured.


    ## Authentication


    Every endpoint accepts either HTTP Basic credentials, or a bearer token sent
    together with the

    `X-User-ID` header identifying the user the call runs as.


    ## Base URL


    Your Unstructured deployment, for example
    `https://unstructured.your-company.com/rest/unstructured`.
  version: 0.1.14
servers:
  - url: /rest/unstructured
security:
  - BasicAuth: []
  - BearerAuth: []
    UserIdAuth: []
tags:
  - name: Core
    description: Endpoints for core functionality
  - name: Data
    description: Endpoints for source data
  - name: Metadata
    description: Endpoints for metadata management
  - name: Tags
    description: Endpoints for tag management
  - name: Taxonomy
    description: Endpoints for taxonomy management
  - name: Dataslice
    description: Endpoints for dataslice management
  - name: Progress Tracker
    description: Endpoints for tracking progress
  - name: Classification
    description: Endpoints for classification
  - name: Ingestion
    description: Endpoints for document ingestion
  - name: Workflows
    description: Endpoints for workflow management
  - name: Deduplication
    description: Endpoints for deduplication
paths:
  /v2/taxonomies/generate-from-context:
    post:
      tags:
        - Taxonomies
      summary: Suggest a taxonomy from a description
      description: >-
        Suggests a taxonomy structure and tags from a free-form description of
        the data. Nothing is saved. When validate_tags is true and a
        datasource_id is given, the suggested tags are scored against a sample
        of that datasource's files.
      operationId: generateTaxonomyFromContext
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateTaxonomyFromContextRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateTaxonomyFromContextResponse'
        '400':
          description: The request is invalid, or no LLM profile is configured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: The caller may not create taxonomies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '404':
          description: No accessible datasource with that id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      x-codeSamples:
        - lang: Python
          source: |
            # pip install deasy-sdk
            import os
            from deasy import DeasyClient

            client = DeasyClient(
                base_url=os.environ["UNSTRUCTURED_CLIENT_BASE_URL"],
                username=os.environ["UNSTRUCTURED_USERNAME"],
                password=os.environ["UNSTRUCTURED_PASSWORD"],
            )

            response = client.taxonomy.generate_from_context(
                user_context="example_user_context",
            )
            print(response.taxonomy_data)
components:
  schemas:
    GenerateTaxonomyFromContextRequest:
      properties:
        user_context:
          type: string
          title: User Context
        industry:
          anyOf:
            - type: string
            - type: 'null'
          title: Industry
        data_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Type
        use_case:
          anyOf:
            - type: string
            - type: 'null'
          title: Use Case
        taxonomy_type:
          type: string
          title: Taxonomy Type
          default: hierarchical
        max_depth:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Depth
          default: 3
        llm_profile_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Profile Name
        datasource_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Datasource Id
          description: >-
            Datasource the suggestion is for. Must be accessible to the caller
            (404 otherwise). When validate_tags is true, its files are sampled
            to validate the suggested tags.
        validate_tags:
          type: boolean
          title: Validate Tags
          default: false
      type: object
      required:
        - user_context
      title: GenerateTaxonomyFromContextRequest
    GenerateTaxonomyFromContextResponse:
      properties:
        taxonomy_data:
          additionalProperties: true
          type: object
          title: Taxonomy Data
        taxonomy_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Taxonomy Description
        suggested_tags:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Suggested Tags
        tag_not_found_rates:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Tag Not Found Rates
      type: object
      required:
        - taxonomy_data
      title: GenerateTaxonomyFromContextResponse
    StandardErrorResponse:
      properties:
        statusCode:
          type: integer
          title: Statuscode
          description: HTTP status code, repeated in the body.
        errorCode:
          type: string
          title: Errorcode
          description: Stable, specific, camelCase identifier for this condition.
          examples:
            - tagNotFound
        titleMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Titlemessage
          description: Short human-readable summary of the error class.
        userMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Usermessage
          description: Message safe to show to an end user.
        errorContext:
          anyOf:
            - type: string
            - type: 'null'
          title: Errorcontext
          description: W3C traceparent for the request that produced this error.
          examples:
            - 00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Machine-readable payload specific to this errorCode. Present only
            for conditions a client can act on programmatically; the set of keys
            is documented per errorCode and only ever widens.
      type: object
      required:
        - statusCode
        - errorCode
      title: StandardErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.