Truberics collector

Anyone have an idea why truberics collector works in the first instance, but not in the second? The only difference in the code is that the second collector.st_feedback is inside the if statement.

Clue #1: From a UX standpoint it appears to work. The feedback icons can be clicked and they trigger a text input field. But no response is generated.

Clue #2: Trubrics collector.log_prompt works fine in both, which rules out any issues with the feedback collector.

I prefer to have the feedback widget only show once the response results are returned.

Snippet #1

query = st.chat_input("Type your question or task here", max_chars=200)
if query:
        response = ASK.rag(query,retriever)

    collector.log_prompt(
        config_model={"model": "gpt-3.5-turbo"},
        prompt=query,
        generation=response['result'],
    )

user_feedback = collector.st_feedback(
    component="default",
    feedback_type="thumbs",
    model="gpt-3.5-turbo",
    open_feedback_label="[Optional] Provide additional feedback",
    align="flex-end",
    prompt_id=None,  # checkout collector.log_prompt() to log your user prompts
)

Snippet #2

query = st.chat_input("Type your question or task here", max_chars=200)
if query:
        response = ASK.rag(query,retriever)

        collector.log_prompt(
            config_model={"model": "gpt-3.5-turbo"},
            prompt=query,
            generation=response['result'],
        )

        user_feedback = collector.st_feedback(
            component="default",
            feedback_type="thumbs",
            model="gpt-3.5-turbo",
            open_feedback_label="[Optional] Provide additional feedback",
            align="flex-end",
            prompt_id=None,  # checkout collector.log_prompt() to log your user prompts
        )
  1. Share the link to the public deployed app.
    https://ask-test.streamlit.app/

  2. Share the link to your app’s public GitHub repository (including a [requirements file]
    GitHub - dvvilkins/ASK at test

  3. Share the full text of the error message (not a screenshot).

  4. Share the Streamlit and Python versions.
    lastest of Streamlit
    Python 3.9

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.