Skip to content

Commit 8985144

Browse files
committed
update streamlit docs
1 parent 11f1c61 commit 8985144

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

docs/integrations/streamlit.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,20 @@ if st.session_state.logged_prompt:
9696

9797
What's going on here? Let's break down this snippet:
9898

99-
1. `collector = FeedbackCollector()` allows you to authenticate with Trubrics
99+
### 1. `FeedbackCollector()`
100100

101-
!!!tip
102-
The authentication token is cached already, but to optimise your app further, wrap the `FeedbackCollector` in [@st.cache_data](https://docs.streamlit.io/library/api-reference/performance/st.cache_data).
101+
!!!tip
102+
The authentication token is cached already, but to optimise your app further, wrap the `FeedbackCollector` in [@st.cache_data](https://docs.streamlit.io/library/api-reference/performance/st.cache_data).
103103

104-
!!!note "FeedbackCollector object"
105-
:::trubrics.integrations.streamlit.FeedbackCollector.__init__
104+
!!!note "FeedbackCollector object"
105+
:::trubrics.integrations.streamlit.FeedbackCollector.__init__
106106

107-
2. `collector.log_prompt()` allows you to log all user prompts and model generations
107+
### 2. `collector.log_prompt()`
108108

109-
!!!note ".log_prompt() parameters"
110-
:::trubrics.Trubrics.log_prompt
109+
!!!note ".log_prompt() parameters"
110+
:::trubrics.Trubrics.log_prompt
111111

112-
3. `collector.log_feedback()` allows users to embed UI widgets to collect feedback from users
112+
### 3. `collector.st_feedback()`
113113

114-
!!!note ".st_feedback() parameters"
115-
:::trubrics.integrations.streamlit.FeedbackCollector.st_feedback
116-
117-
!!!Note
118-
Each feedback component holds a unique type of feedback. You should create multiple `FeedbackCollector` for collecting different types of feedback in the same app.
114+
!!!note ".st_feedback() parameters"
115+
:::trubrics.integrations.streamlit.FeedbackCollector.st_feedback

docs/platform/user_prompts.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ prompt = trubrics.log_prompt(
4040
!!!note "`trubrics.log_prompt()` arguments"
4141
:::trubrics.Trubrics.log_prompt
4242

43+
### Saving prompts from Streamlit apps
44+
45+
The `FeedbackCollector` Streamlit integration inherits from the `Trubrics` object, meaning that you can log prompts in the same way directly from the `FeedbackCollector`. For more information on this, see the [Streamlit integration](../integrations/streamlit.md) docs.
46+
4347
## Analyse prompts in Trubrics
4448

4549
Various filters allow AI teams to explore user prompts in Trubrics, and export them to csv.

0 commit comments

Comments
 (0)