Expand description
Bindings to the OpenHarmony QoS (Quality of Service) thread scheduling APIs.
See also the QoS development guide and the Gewu development guide for the on-device LLM inference surface that ships in the same library.
§Feature flags
api-12— Enables bindings for OpenHarmony API-level 12. This is the lowest API level at which any QoS APIs are available — selecting this feature is required to useOH_QoS_SetThreadQoS/OH_QoS_ResetThreadQoS/OH_QoS_GetThreadQoS.api-20— Enables bindings for OpenHarmony API-level 20, which adds the Gewu on-device LLM inference APIs (OH_QoS_GewuCreateSession,OH_QoS_GewuSubmitRequest, etc.) alongside the existing thread QoS surface.api-21— Enables bindings for OpenHarmony API-level 21.api-22— Enables bindings for OpenHarmony API-level 22.api-23— Enables bindings for OpenHarmony API-level 23.document-features— Document available features when building the documentation
Structs§
- OH_
QoS_ Gewu Create Session Result api-12andapi-20 - Arguments
- OH_
QoS_ Gewu Error Code api-12andapi-20 - Gewu error codes.
- OH_
QoS_ Gewu Submit Request Result api-12andapi-20 - Arguments
- QoS_
Level api-12 - Describes the level of QoS.
Constants§
- OH_
QOS_ GEWU_ INVALID_ REQUEST_ ID api-12andapi-20 - OH_
QOS_ GEWU_ INVALID_ SESSION_ ID api-12andapi-20
Functions§
- OH_
QoS_ ⚠GetThread QoS api-12 - Obtains the QoS level of the current thread.
- OH_
QoS_ ⚠Gewu Abort Request api-20 - Abort the specified request. Note that after calling this function successfully, the client will not receive further responses for this request, and the request object cannot be used by the user code any more.
- OH_
QoS_ ⚠Gewu Create Session api-20 - Create a gewu session for inference. The lifecycle of the returned session object spans from the return of CreateSession to the call to DestroySession.
- OH_
QoS_ ⚠Gewu Destroy Session api-20 - Destroy the specified session. It is recommended that the client shall wait until all ongoing requests are done before calling this interface to destroy the session. If there are remaining requests in the session when this interface is called, those requests will be aborted and no further responses for those requests will be sent to the client. Note that after calling this function successfully, the session cannot be used by the user code any more.
- OH_
QoS_ ⚠Gewu Submit Request api-20 - Submit a request.
- OH_
QoS_ ⚠Reset Thread QoS api-12 - Cancel the QoS level of the current thread.
- OH_
QoS_ ⚠SetThread QoS api-12 - Set the QoS level of the current thread.
Type Aliases§
- OH_
QoS_ Gewu OnResponse api-12andapi-20 - Callback to receive response of the request.
- OH_
QoS_ Gewu Request api-12andapi-20 - Request id
- OH_
QoS_ Gewu Result api-12andapi-20 - OH_
QoS_ Gewu Session api-12andapi-20 - Session id