HumanSignal / label-studio-sdk

Label Studio SDK
https://api.labelstud.io
Apache License 2.0
99 stars 61 forks source link

feat: DIA-1415: Add LabelConfig->ResponseModel generator #327

Closed niklub closed 3 weeks ago

niklub commented 1 month ago

Summary of changes

• Added functionality to convert Label Studio interface configurations to JSON schema, enhancing interoperability with other tools and systems

• Implemented a new utility function json_schema_to_pydantic that dynamically generates Pydantic models from JSON schemas, enabling runtime type checking and validation

• Extended various control tag classes (e.g., ChoicesTag, LabelsTag, NumberTag) with to_json_schema methods, providing detailed schema representations for each tag type

• Added a to_json_schema method to the LabelInterface class, allowing for easy conversion of entire labeling configurations to JSON schema

• Introduced new test cases in test_json_schema.py to verify the correct conversion of Label Studio configurations to JSON schemas and the proper functioning of the Pydantic model generation

• Updated project dependencies to include datamodel-code-generator, supporting the new JSON schema to Pydantic model conversion functionality

• Implemented thread-safe and concurrent processing tests to ensure the reliability of the new JSON schema to Pydantic conversion in multi-threaded environments

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run

robot-ci-heartex commented 1 month ago

Follow Merge downstream workflow has been failed.

Workflow run