Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between SDK and API #405

Open
mbrutrifork opened this issue Jan 29, 2025 · 0 comments
Open

Inconsistency between SDK and API #405

mbrutrifork opened this issue Jan 29, 2025 · 0 comments

Comments

@mbrutrifork
Copy link

I have previously created predictions using the Python SDK like this:

prediction = PredictionValue(
    model_version="test", score=0.99, result=[result]
)
client.predictions.create(task=task.id, **prediction.model_dump())

I am now trying to create annotations through the Python SDK like this:

annotation = AnnotationValue(result=[result])
client.annotations.create(id=task.id, **annotation.model_dump())

Unfortunately, AnnotationValue requires the field completed_by, not required by the API, which makes me get this error:

pydantic_core._pydantic_core.ValidationError: 1 validation error for AnnotationValue
completed_by

and AnnotationValue includes fields like result_count which is not expected from the API, which makes me get this error:

TypeError: AnnotationsClient.create() got an unexpected keyword argument 'result_count'

Initially, I thought this could be an issue with missmatch of versions, since I was using label-studio-sdk==1.0.8 and label-studio:1.15.0 (docker image). I saw in the release notes that the last time the SDK version was bumped was for release 1.13.1 to SDK version 1.05, so I changed to label-studio-sdk==1.0.5, but it still doesn't work.

Questions

Are PredictionValue and AnnotationValue supposed to be used not in this context? Did I do something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant