trubrics / trubrics-sdk

Product analytics for AI Assistants
https://www.trubrics.com/
Apache License 2.0
131 stars 25 forks source link

Bug Report: KeyError in Trubrics Streamlit Application #90

Open stepwise-ai-dev opened 9 months ago

stepwise-ai-dev commented 9 months ago

Bug Report: KeyError in Trubrics Streamlit Application

Project

Trubrics Streamlit Integration

Issue Type

Bug

Severity

High

Reported On

2024-01-20

Description

The Trubrics Streamlit application is throwing a KeyError when initializing the FeedbackCollector with the project parameter set to "default". This error persists even when trying with a newly created project in Trubrics.

Steps to Reproduce

  1. Install the Trubrics Streamlit library using pip install "trubrics[streamlit]".
  2. Set up a Trubrics account and obtain the necessary credentials.
  3. Initialize FeedbackCollector in a Streamlit app using the provided credentials and the project set to "default" or a newly created project name.
  4. Run the Streamlit application.

Expected Behavior

The FeedbackCollector should initialize without errors, allowing the Streamlit application to collect feedback using the specified Trubrics project.

Actual Behavior

The application throws a KeyError indicating that the project "default" is not found, even though it's specified in the Trubrics account. The error message is:

KeyError: "Project 'default' not found. Please select one of []."

Environment

Additional Information

Attached Logs

2024-01-20 20:10:29.629 Uncaught app exception

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/french_learning/streamlit_app.py", line 17, in <module>
    collector = FeedbackCollector(
  File "/home/adminuser/venv/lib/python3.9/site-packages/trubrics/integrations/streamlit/collect.py", line 27, in __init__
    super().__init__(
  File "/home/adminuser/venv/lib/python3.9/site-packages/trubrics/platform/__init__.py", line 42, in __init__
    raise KeyError(f"Project '{project}' not found. Please select one of {projects}.")

Suggested Next Steps

jeffkayne commented 9 months ago

Hey, could you give me your email for this account?