tonita.feedback
#
- tonita.feedback.submit(feedback_items=None, jsonl_path=None, api_key=None)#
Submits a batch of feedback items.
- Parameters:
feedback_items (Optional[List[FeedbackItem]]) –
The items containing the data to submit.
Exactly one of
feedback_items
orjsonl_path
must be provided.jsonl_path (Optional[str]) –
A path to a JSONL file where each line is a
FeedbackItem
in JSON format, where each field and value of the dataclass has a corresponding key and value in the JSON. For example, consider the following dataclass:FeedbackItem( search_request=SearchRequest( query="famous 90s romcom" ), corpus_id="movies", listing_id="sa395823fn", relevance=0.98 )
As a JSON, this becomes:
{ "search_request": { "query": "famous 90s romcom" }, "corpus_id": "movies", "listing_id": "sa395823fn", "relevance": 0.98 }
Exactly one of
feedback_items
orjsonl_path
must be provided.api_key (Optional[str]) – An API key. If this argument is
None
, then the value oftonita.api_key
will be used.
- Returns:
See docstring for
SubmitFeedbackResponse
.- Return type:
- Raises:
TonitaBadRequestError – The request is malformed; see error message for specifics.
TonitaInternalServerError – A server-side error occurred.
TonitaUnauthorizedError – The API key is missing or invalid.