You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The position of self.cookies = cookies is different
the code from 0.0.32
classClient(object):
def__init__(
self,
url: str=None,
api_key: str=None,
credentials=None,
session=None,
extra_headers: dict=None,
cookies: dict=None,
oidc_token=None,
versions=None,
make_request_raise=True,
):
"""Initialize the client. Do this before using other Label Studio SDK classes and methods in your script. Parameters ---------- url: str Label Studio host address. Example: http://localhost:8080 api_key: str User token for the API. You can find this on your user account page in Label Studio. credentials: ClientCredentials User email and password or api_key. session: requests.Session() If None, a new one is created. extra_headers: dict Additional headers that will be passed to each http request cookies: dict Cookies that will be passed to each http request. oidc_token: str Bearer token for proxy authentication - in case the server is behind an authenticating proxy. versions: dict Versions of Label Studio components for the connected instance make_request_raise: bool If true, make_request will raise exceptions on request errors """ifnoturl:
url=os.getenv('LABEL_STUDIO_URL', LABEL_STUDIO_DEFAULT_URL)
self.url=url.rstrip('/')
self.make_request_raise=make_request_raiseself.session=sessionorself.get_session()
# set api key or get it using credentials (username and password)ifapi_keyisNoneandcredentialsisNone:
api_key=os.getenv('LABEL_STUDIO_API_KEY')
ifapi_keyisnotNone:
credentials=ClientCredentials(api_key=api_key)
self.api_key= (
credentials.api_keyifcredentials.api_keyelseself.get_api_key(credentials)
)
# set headersself.headers= {'Authorization': f'Token {self.api_key}'}
ifoidc_token:
self.headers.update({'Proxy-Authorization': f'Bearer {oidc_token}'})
ifextra_headers:
self.headers.update(extra_headers)
# set cookiesself.cookies=cookies# set versions from /version endpointself.versions=versionsifversionselseself.get_versions()
self.is_enterprise='label-studio-enterprise-backend'inself.versions
This code from github master branch
classClient(object):
def__init__(
self,
url: str=None,
api_key: str=None,
credentials=None,
session=None,
extra_headers: dict=None,
cookies: dict=None,
oidc_token=None,
versions=None,
make_request_raise=True,
):
"""Initialize the client. Do this before using other Label Studio SDK classes and methods in your script. Parameters ---------- url: str Label Studio host address. Example: http://localhost:8080 api_key: str User token for the API. You can find this on your user account page in Label Studio. credentials: ClientCredentials User email and password or api_key. session: requests.Session() If None, a new one is created. extra_headers: dict Additional headers that will be passed to each http request cookies: dict Cookies that will be passed to each http request. oidc_token: str Bearer token for proxy authentication - in case the server is behind an authenticating proxy. versions: dict Versions of Label Studio components for the connected instance make_request_raise: bool If true, make_request will raise exceptions on request errors """ifnoturl:
url=os.getenv('LABEL_STUDIO_URL', LABEL_STUDIO_DEFAULT_URL)
self.url=url.rstrip('/')
self.make_request_raise=make_request_raiseself.session=sessionorself.get_session()
# set cookiesself.cookies=cookies# set api key or get it using credentials (username and password)ifapi_keyisNoneandcredentialsisNone:
api_key=os.getenv('LABEL_STUDIO_API_KEY')
ifapi_keyisnotNone:
credentials=ClientCredentials(api_key=api_key)
self.api_key= (
credentials.api_keyifcredentials.api_keyelseself.get_api_key(credentials)
)
# set headersself.headers= {'Authorization': f'Token {self.api_key}'}
ifoidc_token:
self.headers.update({'Proxy-Authorization': f'Bearer {oidc_token}'})
ifextra_headers:
self.headers.update(extra_headers)
# set versions from /version endpointself.versions=versionsifversionselseself.get_versions()
self.is_enterprise='label-studio-enterprise-backend'inself.versions
When will the latest version be released?
0.0.32 has bugs!
The text was updated successfully, but these errors were encountered:
for example,
label_studio_sdk.client.py
The position of
self.cookies = cookies
is differentthe code from 0.0.32
This code from github master branch
When will the latest version be released?
0.0.32 has bugs!
The text was updated successfully, but these errors were encountered: