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 or jsonl_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 or jsonl_path must be provided.

  • api_key (Optional[str]) – An API key. If this argument is None, then the value of tonita.api_key will be used.

Returns:

See docstring for SubmitFeedbackResponse.

Return type:

SubmitFeedbackResponse

Raises: