diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 15b10135d..0915fa345 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -166,18 +166,18 @@ types: recordsFiltered: integer source: openapi: openapi/openapi.yaml - AllRolesProjectListSampling: + AllRolesProjectListSkipQueue: discriminated: false union: - - SamplingEnum + - SkipQueueEnum - NullEnum source: openapi: openapi/openapi.yaml inline: true - AllRolesProjectListSkipQueue: + AllRolesProjectListSampling: discriminated: false union: - - SkipQueueEnum + - SamplingEnum - NullEnum source: openapi: openapi/openapi.yaml @@ -187,169 +187,169 @@ types: Serializer get numbers from project queryset annotation, make sure, that you use correct one(Project.objects.with_counts()) properties: - workspace_title: string - ready: string - overlap_cohort_percentage: + annotation_limit_count: type: optional validation: - min: -2147483648 - max: 2147483647 - queue_left: string + min: 1 + description: + type: optional + docs: Project description + start_training_on_annotation_update: + type: boolean + docs: Start model training after any annotations are submitted or updated + num_tasks_with_annotations: string + control_weights: optional + skip_queue: optional + data_types: unknown + members_count: string config_suitable_for_bulk_annotation: type: boolean docs: Flag to detect is project ready for bulk annotation - has_blueprints: string - show_overlap_first: optional - queue_total: string - enable_empty_annotation: - type: optional - docs: Allow annotators to submit empty annotations + expert_instruction: + type: optional + docs: Labeling instructions in HTML format custom_task_lock_ttl: type: optional docs: TTL in seconds for task reservations, on new and existing tasks validation: min: 1 max: 86400 - prompts: string - start_training_on_annotation_update: - type: boolean - docs: Start model training after any annotations are submitted or updated - evaluate_predictions_automatically: + skipped_annotations_number: string + reveal_preannotations_interactively: type: optional - docs: Retrieve and display predictions when loading a task + docs: Reveal pre-annotations interactively + reviewed_number: string + show_ground_truth_first: optional + custom_script: optional + show_skip_button: + type: optional + docs: Show a skip button in interface and allow annotators to skip the task show_instruction: type: optional docs: Show instructions to the annotator before they start + id: integer + description_short: string color: type: optional validation: maxLength: 16 - sampling: optional - created_by: - type: optional - docs: Project owner - reveal_preannotations_interactively: - type: optional - docs: Reveal pre-annotations interactively - pinned_at: - type: optional - docs: Pinned date and time - finished_task_number: integer - parsed_label_config: unknown - duplication_done: - type: optional - default: false - reviewer_queue_total: string - show_ground_truth_first: optional - task_number: - type: integer - docs: Total task number in project - num_tasks_with_annotations: string - description_short: string - id: integer - allow_stream: string + annotator_evaluation_minimum_score: + type: optional + default: '95.00' + validation: + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + has_blueprints: string annotation_limit_percent: type: optional validation: pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + assignment_settings: AssignmentSettings + prompts: string + workspace_title: string created_at: datetime - annotation_limit_count: - type: optional - validation: - min: 1 - queue_done: string - control_weights: optional - data_types: unknown - reviewed_number: string - total_annotations_number: string - total_predictions_number: integer - config_has_control_tags: - type: boolean - docs: Flag to detect is project ready for labeling - blueprints: list - is_published: - type: optional - docs: Whether or not the project is published to annotators duplication_status: optional - review_total_tasks: string - show_skip_button: - type: optional - docs: Show a skip button in interface and allow annotators to skip the task - is_draft: - type: optional - docs: Whether or not the project is in the middle of being created title: type: optional docs: Project name. Must be between 3 and 50 characters long. validation: minLength: 3 maxLength: 50 + ground_truth_number: + type: integer + docs: Honeypot annotation number in project + label_config: + type: optional + docs: Label config in XML format. See more about it in documentation + pause_on_failed_annotator_evaluation: + type: optional + default: false + task_number: + type: integer + docs: Total task number in project + queue_total: string + organization: optional show_collab_predictions: type: optional docs: If set, the annotator can view model predictions - members: string - min_annotations_to_start_training: + overlap_cohort_percentage: type: optional - docs: >- - Minimum number of completed tasks after which model training is - started validation: min: -2147483648 max: 2147483647 - workspace: string - organization: optional - assignment_settings: AssignmentSettings annotator_evaluation_minimum_tasks: type: optional default: 10 validation: min: 0 - skipped_annotations_number: string - annotator_evaluation_minimum_score: - type: optional - default: '95.00' + ready: string + config_has_control_tags: + type: boolean + docs: Flag to detect is project ready for labeling + maximum_annotations: + type: optional + docs: >- + Maximum number of annotations for one task. If the number of + annotations per task is equal or greater to this value, the task is + completed (is_labeled=True) validation: - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - comment_classification_config: optional - description: - type: optional - docs: Project description - expert_instruction: - type: optional - docs: Labeling instructions in HTML format + min: -2147483648 + max: 2147483647 + is_published: + type: optional + docs: Whether or not the project is published to annotators + review_total_tasks: string + total_predictions_number: integer + reviewer_queue_total: string + review_settings: ReviewSettings show_annotation_history: type: optional docs: Show annotation history to annotator - skip_queue: optional - review_settings: ReviewSettings - members_count: string - model_version: - type: optional - docs: Machine learning model version - useful_annotation_number: string - custom_script: optional - require_comment_on_skip: + pinned_at: + type: optional + docs: Pinned date and time + workspace: string + enable_empty_annotation: + type: optional + docs: Allow annotators to submit empty annotations + sampling: optional + members: string + parsed_label_config: unknown + total_annotations_number: string + queue_done: string + duplication_done: type: optional default: false - ground_truth_number: - type: integer - docs: Honeypot annotation number in project - pause_on_failed_annotator_evaluation: + queue_left: string + rejected: string + finished_task_number: integer + is_draft: + type: optional + docs: Whether or not the project is in the middle of being created + comment_classification_config: optional + blueprints: list + require_comment_on_skip: type: optional default: false - label_config: - type: optional - docs: Label config in XML format. See more about it in documentation - maximum_annotations: + show_overlap_first: optional + min_annotations_to_start_training: type: optional docs: >- - Maximum number of annotations for one task. If the number of - annotations per task is equal or greater to this value, the task is - completed (is_labeled=True) + Minimum number of completed tasks after which model training is + started validation: min: -2147483648 max: 2147483647 - rejected: string + allow_stream: string + evaluate_predictions_automatically: + type: optional + docs: Retrieve and display predictions when loading a task + model_version: + type: optional + docs: Machine learning model version + useful_annotation_number: string + created_by: + type: optional + docs: Project owner source: openapi: openapi/openapi.yaml AnnotatedEnum: diff --git a/.mock/definition/actions.yml b/.mock/definition/actions.yml index f450fd613..281714ee4 100644 --- a/.mock/definition/actions.yml +++ b/.mock/definition/actions.yml @@ -406,6 +406,9 @@ service: request: name: ActionsListRequest query-parameters: + organization: + type: integer + docs: Organization ID project: type: integer docs: Project ID @@ -415,6 +418,7 @@ service: examples: - name: response query-parameters: + organization: 1 project: 1 response: body: diff --git a/.mock/definition/projects.yml b/.mock/definition/projects.yml index 7a45604b3..4cc1b3ba5 100644 --- a/.mock/definition/projects.yml +++ b/.mock/definition/projects.yml @@ -160,89 +160,89 @@ service: next: http://api.example.org/accounts/?page=4 previous: http://api.example.org/accounts/?page=2 results: - - workspace_title: workspace_title - ready: ready - overlap_cohort_percentage: 1 - queue_left: queue_left + - annotation_limit_count: 1 + description: description + start_training_on_annotation_update: true + num_tasks_with_annotations: num_tasks_with_annotations + control_weights: + key: value + skip_queue: REQUEUE_FOR_ME + data_types: + key: value + members_count: members_count config_suitable_for_bulk_annotation: true - has_blueprints: has_blueprints - show_overlap_first: true - queue_total: queue_total - enable_empty_annotation: true + expert_instruction: expert_instruction custom_task_lock_ttl: 1 - prompts: prompts - start_training_on_annotation_update: true - evaluate_predictions_automatically: true - show_instruction: true - color: color - sampling: Sequential sampling - created_by: - id: 1 - avatar: avatar + skipped_annotations_number: skipped_annotations_number reveal_preannotations_interactively: true - pinned_at: '2024-01-15T09:30:00Z' - finished_task_number: 1 - parsed_label_config: - key: value - duplication_done: true - reviewer_queue_total: reviewer_queue_total + reviewed_number: reviewed_number show_ground_truth_first: true - task_number: 1 - num_tasks_with_annotations: num_tasks_with_annotations - description_short: description_short + custom_script: custom_script + show_skip_button: true + show_instruction: true id: 1 - allow_stream: allow_stream + description_short: description_short + color: color + annotator_evaluation_minimum_score: annotator_evaluation_minimum_score + has_blueprints: has_blueprints annotation_limit_percent: annotation_limit_percent + assignment_settings: + id: 1 + prompts: prompts + workspace_title: workspace_title created_at: '2024-01-15T09:30:00Z' - annotation_limit_count: 1 - queue_done: queue_done - control_weights: - key: value - data_types: + duplication_status: duplication_status + title: title + ground_truth_number: 1 + label_config: label_config + pause_on_failed_annotator_evaluation: true + task_number: 1 + queue_total: queue_total + organization: 1 + show_collab_predictions: true + overlap_cohort_percentage: 1 + annotator_evaluation_minimum_tasks: 1 + ready: ready + config_has_control_tags: true + maximum_annotations: 1 + is_published: true + review_total_tasks: review_total_tasks + total_predictions_number: 1 + reviewer_queue_total: reviewer_queue_total + review_settings: + id: 1 + requeue_rejected_tasks_to_annotator: true + show_annotation_history: true + pinned_at: '2024-01-15T09:30:00Z' + workspace: workspace + enable_empty_annotation: true + sampling: Sequential sampling + members: members + parsed_label_config: key: value - reviewed_number: reviewed_number total_annotations_number: total_annotations_number - total_predictions_number: 1 - config_has_control_tags: true + queue_done: queue_done + duplication_done: true + queue_left: queue_left + rejected: rejected + finished_task_number: 1 + is_draft: true + comment_classification_config: comment_classification_config blueprints: - id: 1 share_id: share_id short_url: short_url created_at: '2024-01-15T09:30:00Z' - is_published: true - duplication_status: duplication_status - review_total_tasks: review_total_tasks - show_skip_button: true - is_draft: true - title: title - show_collab_predictions: true - members: members + require_comment_on_skip: true + show_overlap_first: true min_annotations_to_start_training: 1 - workspace: workspace - organization: 1 - assignment_settings: - id: 1 - annotator_evaluation_minimum_tasks: 1 - skipped_annotations_number: skipped_annotations_number - annotator_evaluation_minimum_score: annotator_evaluation_minimum_score - comment_classification_config: comment_classification_config - description: description - expert_instruction: expert_instruction - show_annotation_history: true - skip_queue: REQUEUE_FOR_ME - review_settings: - id: 1 - requeue_rejected_tasks_to_annotator: true - members_count: members_count + allow_stream: allow_stream + evaluate_predictions_automatically: true model_version: model_version useful_annotation_number: useful_annotation_number - custom_script: custom_script - require_comment_on_skip: true - ground_truth_number: 1 - pause_on_failed_annotator_evaluation: true - label_config: label_config - maximum_annotations: 1 - rejected: rejected + created_by: + id: 1 + avatar: avatar audiences: - public create: diff --git a/.mock/definition/prompts.yml b/.mock/definition/prompts.yml index 39429ebb4..811cf9764 100644 --- a/.mock/definition/prompts.yml +++ b/.mock/definition/prompts.yml @@ -424,89 +424,89 @@ service: next: http://api.example.org/accounts/?page=4 previous: http://api.example.org/accounts/?page=2 results: - - workspace_title: workspace_title - ready: ready - overlap_cohort_percentage: 1 - queue_left: queue_left + - annotation_limit_count: 1 + description: description + start_training_on_annotation_update: true + num_tasks_with_annotations: num_tasks_with_annotations + control_weights: + key: value + skip_queue: REQUEUE_FOR_ME + data_types: + key: value + members_count: members_count config_suitable_for_bulk_annotation: true - has_blueprints: has_blueprints - show_overlap_first: true - queue_total: queue_total - enable_empty_annotation: true + expert_instruction: expert_instruction custom_task_lock_ttl: 1 - prompts: prompts - start_training_on_annotation_update: true - evaluate_predictions_automatically: true - show_instruction: true - color: color - sampling: Sequential sampling - created_by: - id: 1 - avatar: avatar + skipped_annotations_number: skipped_annotations_number reveal_preannotations_interactively: true - pinned_at: '2024-01-15T09:30:00Z' - finished_task_number: 1 - parsed_label_config: - key: value - duplication_done: true - reviewer_queue_total: reviewer_queue_total + reviewed_number: reviewed_number show_ground_truth_first: true - task_number: 1 - num_tasks_with_annotations: num_tasks_with_annotations - description_short: description_short + custom_script: custom_script + show_skip_button: true + show_instruction: true id: 1 - allow_stream: allow_stream + description_short: description_short + color: color + annotator_evaluation_minimum_score: annotator_evaluation_minimum_score + has_blueprints: has_blueprints annotation_limit_percent: annotation_limit_percent + assignment_settings: + id: 1 + prompts: prompts + workspace_title: workspace_title created_at: '2024-01-15T09:30:00Z' - annotation_limit_count: 1 - queue_done: queue_done - control_weights: - key: value - data_types: + duplication_status: duplication_status + title: title + ground_truth_number: 1 + label_config: label_config + pause_on_failed_annotator_evaluation: true + task_number: 1 + queue_total: queue_total + organization: 1 + show_collab_predictions: true + overlap_cohort_percentage: 1 + annotator_evaluation_minimum_tasks: 1 + ready: ready + config_has_control_tags: true + maximum_annotations: 1 + is_published: true + review_total_tasks: review_total_tasks + total_predictions_number: 1 + reviewer_queue_total: reviewer_queue_total + review_settings: + id: 1 + requeue_rejected_tasks_to_annotator: true + show_annotation_history: true + pinned_at: '2024-01-15T09:30:00Z' + workspace: workspace + enable_empty_annotation: true + sampling: Sequential sampling + members: members + parsed_label_config: key: value - reviewed_number: reviewed_number total_annotations_number: total_annotations_number - total_predictions_number: 1 - config_has_control_tags: true + queue_done: queue_done + duplication_done: true + queue_left: queue_left + rejected: rejected + finished_task_number: 1 + is_draft: true + comment_classification_config: comment_classification_config blueprints: - id: 1 share_id: share_id short_url: short_url created_at: '2024-01-15T09:30:00Z' - is_published: true - duplication_status: duplication_status - review_total_tasks: review_total_tasks - show_skip_button: true - is_draft: true - title: title - show_collab_predictions: true - members: members + require_comment_on_skip: true + show_overlap_first: true min_annotations_to_start_training: 1 - workspace: workspace - organization: 1 - assignment_settings: - id: 1 - annotator_evaluation_minimum_tasks: 1 - skipped_annotations_number: skipped_annotations_number - annotator_evaluation_minimum_score: annotator_evaluation_minimum_score - comment_classification_config: comment_classification_config - description: description - expert_instruction: expert_instruction - show_annotation_history: true - skip_queue: REQUEUE_FOR_ME - review_settings: - id: 1 - requeue_rejected_tasks_to_annotator: true - members_count: members_count + allow_stream: allow_stream + evaluate_predictions_automatically: true model_version: model_version useful_annotation_number: useful_annotation_number - custom_script: custom_script - require_comment_on_skip: true - ground_truth_number: 1 - pause_on_failed_annotator_evaluation: true - label_config: label_config - maximum_annotations: 1 - rejected: rejected + created_by: + id: 1 + avatar: avatar audiences: - public source: diff --git a/.mock/openapi/openapi.yaml b/.mock/openapi/openapi.yaml index bfc111cc1..055109834 100644 --- a/.mock/openapi/openapi.yaml +++ b/.mock/openapi/openapi.yaml @@ -2456,6 +2456,12 @@ paths: manager can use. summary: Get actions parameters: + - in: query + name: organization + schema: + type: integer + description: Organization ID + required: true - in: query name: project schema: @@ -15576,267 +15582,267 @@ components: Serializer get numbers from project queryset annotation, make sure, that you use correct one(Project.objects.with_counts()) properties: - workspace_title: + annotation_limit_count: + type: integer + minimum: 1 + nullable: true + description: type: string + nullable: true + description: Project description + start_training_on_annotation_update: + type: boolean readOnly: true - ready: + description: Start model training after any annotations are submitted or + updated + num_tasks_with_annotations: type: string readOnly: true - overlap_cohort_percentage: - type: integer - maximum: 2147483647 - minimum: -2147483648 - queue_left: + control_weights: + nullable: true + description: 'Dict of weights for each control tag in metric calculation. + Each control tag (e.g. label or choice) will have it''s own key in control + weight dict with weight for each label and overall weight.For example, + if bounding box annotation with control tag named my_bbox should be included + with 0.33 weight in agreement calculation, and the first label Car should + be twice more important than Airplaine, then you have to need the specify: + {''my_bbox'': {''type'': ''RectangleLabels'', ''labels'': {''Car'': 1.0, + ''Airplaine'': 0.5}, ''overall'': 0.33}' + skip_queue: + nullable: true + oneOf: + - $ref: '#/components/schemas/SkipQueueEnum' + - $ref: '#/components/schemas/NullEnum' + data_types: + readOnly: true + nullable: true + members_count: type: string readOnly: true config_suitable_for_bulk_annotation: type: boolean readOnly: true description: Flag to detect is project ready for bulk annotation - has_blueprints: - type: string - readOnly: true - show_overlap_first: - type: boolean - queue_total: + expert_instruction: type: string - readOnly: true - enable_empty_annotation: - type: boolean - description: Allow annotators to submit empty annotations + nullable: true + description: Labeling instructions in HTML format custom_task_lock_ttl: type: integer maximum: 86400 minimum: 1 nullable: true description: TTL in seconds for task reservations, on new and existing tasks - prompts: + skipped_annotations_number: type: string readOnly: true - start_training_on_annotation_update: - type: boolean - readOnly: true - description: Start model training after any annotations are submitted or - updated - evaluate_predictions_automatically: - type: boolean - description: Retrieve and display predictions when loading a task - show_instruction: - type: boolean - description: Show instructions to the annotator before they start - color: - type: string - nullable: true - maxLength: 16 - sampling: - nullable: true - oneOf: - - $ref: '#/components/schemas/SamplingEnum' - - $ref: '#/components/schemas/NullEnum' - created_by: - allOf: - - $ref: '#/components/schemas/UserSimple' - description: Project owner reveal_preannotations_interactively: type: boolean description: Reveal pre-annotations interactively - pinned_at: + reviewed_number: type: string - format: date-time - nullable: true - description: Pinned date and time - finished_task_number: - type: integer readOnly: true - parsed_label_config: - readOnly: true - description: JSON-formatted labeling configuration - duplication_done: + show_ground_truth_first: type: boolean - default: false - reviewer_queue_total: + custom_script: type: string - readOnly: true - show_ground_truth_first: + show_skip_button: type: boolean - task_number: + description: Show a skip button in interface and allow annotators to skip + the task + show_instruction: + type: boolean + description: Show instructions to the annotator before they start + id: type: integer readOnly: true - description: Total task number in project - num_tasks_with_annotations: - type: string - readOnly: true description_short: type: string readOnly: true - id: - type: integer - readOnly: true - allow_stream: + color: type: string - readOnly: true - annotation_limit_percent: + nullable: true + maxLength: 16 + annotator_evaluation_minimum_score: type: string format: decimal pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ nullable: true - created_at: + default: '95.00' + has_blueprints: type: string - format: date-time readOnly: true - annotation_limit_count: - type: integer - minimum: 1 - nullable: true - queue_done: + annotation_limit_percent: type: string - readOnly: true - control_weights: - nullable: true - description: 'Dict of weights for each control tag in metric calculation. - Each control tag (e.g. label or choice) will have it''s own key in control - weight dict with weight for each label and overall weight.For example, - if bounding box annotation with control tag named my_bbox should be included - with 0.33 weight in agreement calculation, and the first label Car should - be twice more important than Airplaine, then you have to need the specify: - {''my_bbox'': {''type'': ''RectangleLabels'', ''labels'': {''Car'': 1.0, - ''Airplaine'': 0.5}, ''overall'': 0.33}' - data_types: - readOnly: true + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ nullable: true - reviewed_number: + assignment_settings: + $ref: '#/components/schemas/AssignmentSettings' + prompts: type: string readOnly: true - total_annotations_number: + workspace_title: type: string readOnly: true - total_predictions_number: - type: integer - readOnly: true - config_has_control_tags: - type: boolean - readOnly: true - description: Flag to detect is project ready for labeling - blueprints: - type: array - items: - $ref: '#/components/schemas/BlueprintList' + created_at: + type: string + format: date-time readOnly: true - is_published: - type: boolean - title: Published - description: Whether or not the project is published to annotators duplication_status: type: string - review_total_tasks: - type: string - readOnly: true - show_skip_button: - type: boolean - description: Show a skip button in interface and allow annotators to skip - the task - is_draft: - type: boolean - description: Whether or not the project is in the middle of being created title: type: string nullable: true description: Project name. Must be between 3 and 50 characters long. maxLength: 50 minLength: 3 - show_collab_predictions: - type: boolean - title: Show predictions to annotator - description: If set, the annotator can view model predictions - members: - type: string + ground_truth_number: + type: integer readOnly: true - min_annotations_to_start_training: + description: Honeypot annotation number in project + label_config: + type: string + nullable: true + description: Label config in XML format. See more about it in documentation + pause_on_failed_annotator_evaluation: + type: boolean + nullable: true + default: false + task_number: type: integer - maximum: 2147483647 - minimum: -2147483648 - description: Minimum number of completed tasks after which model training - is started - workspace: + readOnly: true + description: Total task number in project + queue_total: type: string readOnly: true organization: type: integer nullable: true - assignment_settings: - $ref: '#/components/schemas/AssignmentSettings' + show_collab_predictions: + type: boolean + title: Show predictions to annotator + description: If set, the annotator can view model predictions + overlap_cohort_percentage: + type: integer + maximum: 2147483647 + minimum: -2147483648 annotator_evaluation_minimum_tasks: type: integer minimum: 0 nullable: true default: 10 - skipped_annotations_number: + ready: type: string readOnly: true - annotator_evaluation_minimum_score: + config_has_control_tags: + type: boolean + readOnly: true + description: Flag to detect is project ready for labeling + maximum_annotations: + type: integer + maximum: 2147483647 + minimum: -2147483648 + title: Maximum annotation number + description: Maximum number of annotations for one task. If the number of + annotations per task is equal or greater to this value, the task is completed + (is_labeled=True) + is_published: + type: boolean + title: Published + description: Whether or not the project is published to annotators + review_total_tasks: type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - nullable: true - default: '95.00' - comment_classification_config: + readOnly: true + total_predictions_number: + type: integer + readOnly: true + reviewer_queue_total: type: string - description: + readOnly: true + review_settings: + $ref: '#/components/schemas/ReviewSettings' + show_annotation_history: + type: boolean + description: Show annotation history to annotator + pinned_at: type: string + format: date-time nullable: true - description: Project description - expert_instruction: + description: Pinned date and time + workspace: type: string - nullable: true - description: Labeling instructions in HTML format - show_annotation_history: + readOnly: true + enable_empty_annotation: type: boolean - description: Show annotation history to annotator - skip_queue: + description: Allow annotators to submit empty annotations + sampling: nullable: true oneOf: - - $ref: '#/components/schemas/SkipQueueEnum' + - $ref: '#/components/schemas/SamplingEnum' - $ref: '#/components/schemas/NullEnum' - review_settings: - $ref: '#/components/schemas/ReviewSettings' - members_count: + members: type: string readOnly: true - model_version: - type: string - nullable: true - description: Machine learning model version - useful_annotation_number: + parsed_label_config: + readOnly: true + description: JSON-formatted labeling configuration + total_annotations_number: type: string readOnly: true - custom_script: + queue_done: type: string - require_comment_on_skip: + readOnly: true + duplication_done: type: boolean default: false - ground_truth_number: + queue_left: + type: string + readOnly: true + rejected: + type: string + readOnly: true + finished_task_number: type: integer readOnly: true - description: Honeypot annotation number in project - pause_on_failed_annotator_evaluation: + is_draft: type: boolean - nullable: true - default: false - label_config: + description: Whether or not the project is in the middle of being created + comment_classification_config: type: string - nullable: true - description: Label config in XML format. See more about it in documentation - maximum_annotations: + blueprints: + type: array + items: + $ref: '#/components/schemas/BlueprintList' + readOnly: true + require_comment_on_skip: + type: boolean + default: false + show_overlap_first: + type: boolean + min_annotations_to_start_training: type: integer maximum: 2147483647 minimum: -2147483648 - title: Maximum annotation number - description: Maximum number of annotations for one task. If the number of - annotations per task is equal or greater to this value, the task is completed - (is_labeled=True) - rejected: + description: Minimum number of completed tasks after which model training + is started + allow_stream: type: string readOnly: true + evaluate_predictions_automatically: + type: boolean + description: Retrieve and display predictions when loading a task + model_version: + type: string + nullable: true + description: Machine learning model version + useful_annotation_number: + type: string + readOnly: true + created_by: + allOf: + - $ref: '#/components/schemas/UserSimple' + description: Project owner required: - allow_stream - assignment_settings diff --git a/pyproject.toml b/pyproject.toml index 544c7faa2..c74418a4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "label-studio-sdk" [tool.poetry] name = "label-studio-sdk" -version = "2.0.1.dev" +version = "2.0.1" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 793adfc2c..1e8279f76 100644 --- a/reference.md +++ b/reference.md @@ -2310,6 +2310,7 @@ client = LabelStudio( api_key="YOUR_API_KEY", ) client.actions.list( + organization=1, project=1, ) @@ -2327,6 +2328,14 @@ client.actions.list(
+**organization:** `int` — Organization ID + +
+
+ +
+
+ **project:** `int` — Project ID
diff --git a/src/label_studio_sdk/actions/client.py b/src/label_studio_sdk/actions/client.py index 7bd10226d..3ab03c5b7 100644 --- a/src/label_studio_sdk/actions/client.py +++ b/src/label_studio_sdk/actions/client.py @@ -23,13 +23,16 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( - self, *, project: int, request_options: typing.Optional[RequestOptions] = None + self, *, organization: int, project: int, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[ActionsListResponseItem]: """ Retrieve all the registered actions with descriptions that data manager can use. Parameters ---------- + organization : int + Organization ID + project : int Project ID @@ -49,6 +52,7 @@ def list( api_key="YOUR_API_KEY", ) client.actions.list( + organization=1, project=1, ) """ @@ -56,6 +60,7 @@ def list( "api/dm/actions/", method="GET", params={ + "organization": organization, "project": project, }, request_options=request_options, @@ -185,13 +190,16 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( - self, *, project: int, request_options: typing.Optional[RequestOptions] = None + self, *, organization: int, project: int, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[ActionsListResponseItem]: """ Retrieve all the registered actions with descriptions that data manager can use. Parameters ---------- + organization : int + Organization ID + project : int Project ID @@ -216,6 +224,7 @@ async def list( async def main() -> None: await client.actions.list( + organization=1, project=1, ) @@ -226,6 +235,7 @@ async def main() -> None: "api/dm/actions/", method="GET", params={ + "organization": organization, "project": project, }, request_options=request_options, diff --git a/src/label_studio_sdk/types/all_roles_project_list.py b/src/label_studio_sdk/types/all_roles_project_list.py index 68b64ca5d..27cd07cf3 100644 --- a/src/label_studio_sdk/types/all_roles_project_list.py +++ b/src/label_studio_sdk/types/all_roles_project_list.py @@ -3,13 +3,13 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing import pydantic -from .all_roles_project_list_sampling import AllRolesProjectListSampling -from .user_simple import UserSimple -import datetime as dt -from .blueprint_list import BlueprintList -from .assignment_settings import AssignmentSettings from .all_roles_project_list_skip_queue import AllRolesProjectListSkipQueue +from .assignment_settings import AssignmentSettings +import datetime as dt from .review_settings import ReviewSettings +from .all_roles_project_list_sampling import AllRolesProjectListSampling +from .blueprint_list import BlueprintList +from .user_simple import UserSimple from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -19,21 +19,30 @@ class AllRolesProjectList(UncheckedBaseModel): make sure, that you use correct one(Project.objects.with_counts()) """ - workspace_title: str - ready: str - overlap_cohort_percentage: typing.Optional[int] = None - queue_left: str + annotation_limit_count: typing.Optional[int] = None + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Project description + """ + + start_training_on_annotation_update: bool = pydantic.Field() + """ + Start model training after any annotations are submitted or updated + """ + + num_tasks_with_annotations: str + control_weights: typing.Optional[typing.Optional[typing.Any]] = None + skip_queue: typing.Optional[AllRolesProjectListSkipQueue] = None + data_types: typing.Optional[typing.Any] = None + members_count: str config_suitable_for_bulk_annotation: bool = pydantic.Field() """ Flag to detect is project ready for bulk annotation """ - has_blueprints: str - show_overlap_first: typing.Optional[bool] = None - queue_total: str - enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None) + expert_instruction: typing.Optional[str] = pydantic.Field(default=None) """ - Allow annotators to submit empty annotations + Labeling instructions in HTML format """ custom_task_lock_ttl: typing.Optional[int] = pydantic.Field(default=None) @@ -41,15 +50,18 @@ class AllRolesProjectList(UncheckedBaseModel): TTL in seconds for task reservations, on new and existing tasks """ - prompts: str - start_training_on_annotation_update: bool = pydantic.Field() + skipped_annotations_number: str + reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None) """ - Start model training after any annotations are submitted or updated + Reveal pre-annotations interactively """ - evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None) + reviewed_number: str + show_ground_truth_first: typing.Optional[bool] = None + custom_script: typing.Optional[str] = None + show_skip_button: typing.Optional[bool] = pydantic.Field(default=None) """ - Retrieve and display predictions when loading a task + Show a skip button in interface and allow annotators to skip the task """ show_instruction: typing.Optional[bool] = pydantic.Field(default=None) @@ -57,136 +69,123 @@ class AllRolesProjectList(UncheckedBaseModel): Show instructions to the annotator before they start """ + id: int + description_short: str color: typing.Optional[str] = None - sampling: typing.Optional[AllRolesProjectListSampling] = None - created_by: typing.Optional[UserSimple] = pydantic.Field(default=None) + annotator_evaluation_minimum_score: typing.Optional[str] = None + has_blueprints: str + annotation_limit_percent: typing.Optional[str] = None + assignment_settings: AssignmentSettings + prompts: str + workspace_title: str + created_at: dt.datetime + duplication_status: typing.Optional[str] = None + title: typing.Optional[str] = pydantic.Field(default=None) """ - Project owner + Project name. Must be between 3 and 50 characters long. """ - reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None) + ground_truth_number: int = pydantic.Field() """ - Reveal pre-annotations interactively + Honeypot annotation number in project """ - pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + label_config: typing.Optional[str] = pydantic.Field(default=None) """ - Pinned date and time + Label config in XML format. See more about it in documentation """ - finished_task_number: int - parsed_label_config: typing.Optional[typing.Any] = None - duplication_done: typing.Optional[bool] = None - reviewer_queue_total: str - show_ground_truth_first: typing.Optional[bool] = None + pause_on_failed_annotator_evaluation: typing.Optional[bool] = None task_number: int = pydantic.Field() """ Total task number in project """ - num_tasks_with_annotations: str - description_short: str - id: int - allow_stream: str - annotation_limit_percent: typing.Optional[str] = None - created_at: dt.datetime - annotation_limit_count: typing.Optional[int] = None - queue_done: str - control_weights: typing.Optional[typing.Optional[typing.Any]] = None - data_types: typing.Optional[typing.Any] = None - reviewed_number: str - total_annotations_number: str - total_predictions_number: int + queue_total: str + organization: typing.Optional[int] = None + show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None) + """ + If set, the annotator can view model predictions + """ + + overlap_cohort_percentage: typing.Optional[int] = None + annotator_evaluation_minimum_tasks: typing.Optional[int] = None + ready: str config_has_control_tags: bool = pydantic.Field() """ Flag to detect is project ready for labeling """ - blueprints: typing.List[BlueprintList] - is_published: typing.Optional[bool] = pydantic.Field(default=None) + maximum_annotations: typing.Optional[int] = pydantic.Field(default=None) """ - Whether or not the project is published to annotators + Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True) """ - duplication_status: typing.Optional[str] = None - review_total_tasks: str - show_skip_button: typing.Optional[bool] = pydantic.Field(default=None) + is_published: typing.Optional[bool] = pydantic.Field(default=None) """ - Show a skip button in interface and allow annotators to skip the task + Whether or not the project is published to annotators """ - is_draft: typing.Optional[bool] = pydantic.Field(default=None) + review_total_tasks: str + total_predictions_number: int + reviewer_queue_total: str + review_settings: ReviewSettings + show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None) """ - Whether or not the project is in the middle of being created + Show annotation history to annotator """ - title: typing.Optional[str] = pydantic.Field(default=None) + pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ - Project name. Must be between 3 and 50 characters long. + Pinned date and time """ - show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None) + workspace: str + enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None) """ - If set, the annotator can view model predictions + Allow annotators to submit empty annotations """ + sampling: typing.Optional[AllRolesProjectListSampling] = None members: str - min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None) + parsed_label_config: typing.Optional[typing.Any] = None + total_annotations_number: str + queue_done: str + duplication_done: typing.Optional[bool] = None + queue_left: str + rejected: str + finished_task_number: int + is_draft: typing.Optional[bool] = pydantic.Field(default=None) """ - Minimum number of completed tasks after which model training is started + Whether or not the project is in the middle of being created """ - workspace: str - organization: typing.Optional[int] = None - assignment_settings: AssignmentSettings - annotator_evaluation_minimum_tasks: typing.Optional[int] = None - skipped_annotations_number: str - annotator_evaluation_minimum_score: typing.Optional[str] = None comment_classification_config: typing.Optional[str] = None - description: typing.Optional[str] = pydantic.Field(default=None) - """ - Project description - """ - - expert_instruction: typing.Optional[str] = pydantic.Field(default=None) + blueprints: typing.List[BlueprintList] + require_comment_on_skip: typing.Optional[bool] = None + show_overlap_first: typing.Optional[bool] = None + min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None) """ - Labeling instructions in HTML format + Minimum number of completed tasks after which model training is started """ - show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None) + allow_stream: str + evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None) """ - Show annotation history to annotator + Retrieve and display predictions when loading a task """ - skip_queue: typing.Optional[AllRolesProjectListSkipQueue] = None - review_settings: ReviewSettings - members_count: str model_version: typing.Optional[str] = pydantic.Field(default=None) """ Machine learning model version """ useful_annotation_number: str - custom_script: typing.Optional[str] = None - require_comment_on_skip: typing.Optional[bool] = None - ground_truth_number: int = pydantic.Field() - """ - Honeypot annotation number in project - """ - - pause_on_failed_annotator_evaluation: typing.Optional[bool] = None - label_config: typing.Optional[str] = pydantic.Field(default=None) - """ - Label config in XML format. See more about it in documentation - """ - - maximum_annotations: typing.Optional[int] = pydantic.Field(default=None) + created_by: typing.Optional[UserSimple] = pydantic.Field(default=None) """ - Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True) + Project owner """ - rejected: str - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/tests/test_actions.py b/tests/test_actions.py index 8d170ce26..44b054fc8 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -43,10 +43,10 @@ async def test_list_(client: LabelStudio, async_client: AsyncLabelStudio) -> Non } }, ) - response = client.actions.list(project=1) + response = client.actions.list(organization=1, project=1) validate_response(response, expected_response, expected_types) - async_response = await async_client.actions.list(project=1) + async_response = await async_client.actions.list(organization=1, project=1) validate_response(async_response, expected_response, expected_types) diff --git a/tests/test_prompts.py b/tests/test_prompts.py index 01d8ef2bc..f1c36064e 100644 --- a/tests/test_prompts.py +++ b/tests/test_prompts.py @@ -213,79 +213,79 @@ async def test_compatible_projects(client: LabelStudio, async_client: AsyncLabel "previous": "http://api.example.org/accounts/?page=2", "results": [ { - "workspace_title": "workspace_title", - "ready": "ready", - "overlap_cohort_percentage": 1, - "queue_left": "queue_left", + "annotation_limit_count": 1, + "description": "description", + "start_training_on_annotation_update": True, + "num_tasks_with_annotations": "num_tasks_with_annotations", + "control_weights": {"key": "value"}, + "skip_queue": "REQUEUE_FOR_ME", + "data_types": {"key": "value"}, + "members_count": "members_count", "config_suitable_for_bulk_annotation": True, - "has_blueprints": "has_blueprints", - "show_overlap_first": True, - "queue_total": "queue_total", - "enable_empty_annotation": True, + "expert_instruction": "expert_instruction", "custom_task_lock_ttl": 1, - "prompts": "prompts", - "start_training_on_annotation_update": True, - "evaluate_predictions_automatically": True, - "show_instruction": True, - "color": "color", - "sampling": "Sequential sampling", - "created_by": {"id": 1, "avatar": "avatar"}, + "skipped_annotations_number": "skipped_annotations_number", "reveal_preannotations_interactively": True, - "pinned_at": "2024-01-15T09:30:00Z", - "finished_task_number": 1, - "parsed_label_config": {"key": "value"}, - "duplication_done": True, - "reviewer_queue_total": "reviewer_queue_total", + "reviewed_number": "reviewed_number", "show_ground_truth_first": True, - "task_number": 1, - "num_tasks_with_annotations": "num_tasks_with_annotations", - "description_short": "description_short", + "custom_script": "custom_script", + "show_skip_button": True, + "show_instruction": True, "id": 1, - "allow_stream": "allow_stream", + "description_short": "description_short", + "color": "color", + "annotator_evaluation_minimum_score": "annotator_evaluation_minimum_score", + "has_blueprints": "has_blueprints", "annotation_limit_percent": "annotation_limit_percent", + "assignment_settings": {"id": 1}, + "prompts": "prompts", + "workspace_title": "workspace_title", "created_at": "2024-01-15T09:30:00Z", - "annotation_limit_count": 1, - "queue_done": "queue_done", - "control_weights": {"key": "value"}, - "data_types": {"key": "value"}, - "reviewed_number": "reviewed_number", - "total_annotations_number": "total_annotations_number", - "total_predictions_number": 1, - "config_has_control_tags": True, - "blueprints": [ - {"id": 1, "share_id": "share_id", "short_url": "short_url", "created_at": "2024-01-15T09:30:00Z"} - ], - "is_published": True, "duplication_status": "duplication_status", - "review_total_tasks": "review_total_tasks", - "show_skip_button": True, - "is_draft": True, "title": "title", - "show_collab_predictions": True, - "members": "members", - "min_annotations_to_start_training": 1, - "workspace": "workspace", + "ground_truth_number": 1, + "label_config": "label_config", + "pause_on_failed_annotator_evaluation": True, + "task_number": 1, + "queue_total": "queue_total", "organization": 1, - "assignment_settings": {"id": 1}, + "show_collab_predictions": True, + "overlap_cohort_percentage": 1, "annotator_evaluation_minimum_tasks": 1, - "skipped_annotations_number": "skipped_annotations_number", - "annotator_evaluation_minimum_score": "annotator_evaluation_minimum_score", - "comment_classification_config": "comment_classification_config", - "description": "description", - "expert_instruction": "expert_instruction", - "show_annotation_history": True, - "skip_queue": "REQUEUE_FOR_ME", + "ready": "ready", + "config_has_control_tags": True, + "maximum_annotations": 1, + "is_published": True, + "review_total_tasks": "review_total_tasks", + "total_predictions_number": 1, + "reviewer_queue_total": "reviewer_queue_total", "review_settings": {"id": 1, "requeue_rejected_tasks_to_annotator": True}, - "members_count": "members_count", + "show_annotation_history": True, + "pinned_at": "2024-01-15T09:30:00Z", + "workspace": "workspace", + "enable_empty_annotation": True, + "sampling": "Sequential sampling", + "members": "members", + "parsed_label_config": {"key": "value"}, + "total_annotations_number": "total_annotations_number", + "queue_done": "queue_done", + "duplication_done": True, + "queue_left": "queue_left", + "rejected": "rejected", + "finished_task_number": 1, + "is_draft": True, + "comment_classification_config": "comment_classification_config", + "blueprints": [ + {"id": 1, "share_id": "share_id", "short_url": "short_url", "created_at": "2024-01-15T09:30:00Z"} + ], + "require_comment_on_skip": True, + "show_overlap_first": True, + "min_annotations_to_start_training": 1, + "allow_stream": "allow_stream", + "evaluate_predictions_automatically": True, "model_version": "model_version", "useful_annotation_number": "useful_annotation_number", - "custom_script": "custom_script", - "require_comment_on_skip": True, - "ground_truth_number": 1, - "pause_on_failed_annotator_evaluation": True, - "label_config": "label_config", - "maximum_annotations": 1, - "rejected": "rejected", + "created_by": {"id": 1, "avatar": "avatar"}, } ], } @@ -297,80 +297,80 @@ async def test_compatible_projects(client: LabelStudio, async_client: AsyncLabel "list", { 0: { - "workspace_title": None, - "ready": None, - "overlap_cohort_percentage": "integer", - "queue_left": None, + "annotation_limit_count": "integer", + "description": None, + "start_training_on_annotation_update": None, + "num_tasks_with_annotations": None, + "control_weights": None, + "skip_queue": None, + "data_types": None, + "members_count": None, "config_suitable_for_bulk_annotation": None, - "has_blueprints": None, - "show_overlap_first": None, - "queue_total": None, - "enable_empty_annotation": None, + "expert_instruction": None, "custom_task_lock_ttl": "integer", - "prompts": None, - "start_training_on_annotation_update": None, - "evaluate_predictions_automatically": None, - "show_instruction": None, - "color": None, - "sampling": None, - "created_by": {"id": "integer", "avatar": None}, + "skipped_annotations_number": None, "reveal_preannotations_interactively": None, - "pinned_at": "datetime", - "finished_task_number": "integer", - "parsed_label_config": None, - "duplication_done": None, - "reviewer_queue_total": None, + "reviewed_number": None, "show_ground_truth_first": None, - "task_number": "integer", - "num_tasks_with_annotations": None, - "description_short": None, + "custom_script": None, + "show_skip_button": None, + "show_instruction": None, "id": "integer", - "allow_stream": None, + "description_short": None, + "color": None, + "annotator_evaluation_minimum_score": None, + "has_blueprints": None, "annotation_limit_percent": None, + "assignment_settings": {"id": "integer"}, + "prompts": None, + "workspace_title": None, "created_at": "datetime", - "annotation_limit_count": "integer", - "queue_done": None, - "control_weights": None, - "data_types": None, - "reviewed_number": None, - "total_annotations_number": None, - "total_predictions_number": "integer", + "duplication_status": None, + "title": None, + "ground_truth_number": "integer", + "label_config": None, + "pause_on_failed_annotator_evaluation": None, + "task_number": "integer", + "queue_total": None, + "organization": "integer", + "show_collab_predictions": None, + "overlap_cohort_percentage": "integer", + "annotator_evaluation_minimum_tasks": "integer", + "ready": None, "config_has_control_tags": None, + "maximum_annotations": "integer", + "is_published": None, + "review_total_tasks": None, + "total_predictions_number": "integer", + "reviewer_queue_total": None, + "review_settings": {"id": "integer", "requeue_rejected_tasks_to_annotator": None}, + "show_annotation_history": None, + "pinned_at": "datetime", + "workspace": None, + "enable_empty_annotation": None, + "sampling": None, + "members": None, + "parsed_label_config": None, + "total_annotations_number": None, + "queue_done": None, + "duplication_done": None, + "queue_left": None, + "rejected": None, + "finished_task_number": "integer", + "is_draft": None, + "comment_classification_config": None, "blueprints": ( "list", {0: {"id": "integer", "share_id": None, "short_url": None, "created_at": "datetime"}}, ), - "is_published": None, - "duplication_status": None, - "review_total_tasks": None, - "show_skip_button": None, - "is_draft": None, - "title": None, - "show_collab_predictions": None, - "members": None, + "require_comment_on_skip": None, + "show_overlap_first": None, "min_annotations_to_start_training": "integer", - "workspace": None, - "organization": "integer", - "assignment_settings": {"id": "integer"}, - "annotator_evaluation_minimum_tasks": "integer", - "skipped_annotations_number": None, - "annotator_evaluation_minimum_score": None, - "comment_classification_config": None, - "description": None, - "expert_instruction": None, - "show_annotation_history": None, - "skip_queue": None, - "review_settings": {"id": "integer", "requeue_rejected_tasks_to_annotator": None}, - "members_count": None, + "allow_stream": None, + "evaluate_predictions_automatically": None, "model_version": None, "useful_annotation_number": None, - "custom_script": None, - "require_comment_on_skip": None, - "ground_truth_number": "integer", - "pause_on_failed_annotator_evaluation": None, - "label_config": None, - "maximum_annotations": "integer", - "rejected": None, + "created_by": {"id": "integer", "avatar": None}, } }, ),