Skip to content

Commit

Permalink
add new quickstarts to nav (#574)
Browse files Browse the repository at this point in the history
* add new quickstarts to nav

* rename t2t quickstart in nav

* text2text format nits, hf colab button

* fix extra stuff in vector store specification
  • Loading branch information
joshreini1 authored Nov 20, 2023
1 parent a82bce6 commit df3399e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
5 changes: 4 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ nav:
- Getting Started:
- 🚀 Installation: trulens_eval/install.md
- ⚡ Quickstarts:
- Quickstart: trulens_eval/quickstart.ipynb
- LangChain Quickstart: trulens_eval/langchain_quickstart.ipynb
- Llama-Index Quickstart: trulens_eval/llama_index_quickstart.ipynb
- Python Native (Text to Text) Quickstart: trulens_eval/text2text_quickstart.ipynb
- Text to Text Quickstart: trulens_eval/text2text_quickstart.ipynb
- Ground Truth Evaluation Quickstart: trulens_eval/groundtruth_evals.ipynb
- Human Feedback Quickstart: trulens_eval/human_feedback.ipynb
- 🧠 Core Concepts:
- Feedback Functions: trulens_eval/core_concepts_feedback_functions.md
- RAG Triad: trulens_eval/core_concepts_rag_triad.md
Expand Down
4 changes: 3 additions & 1 deletion trulens_eval/examples/quickstart/human_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"source": [
"## Logging Human Feedback\n",
"\n",
"In many situations, it can be useful to log human feedback from your users about your LLM app's performance. Combining human feedback along with automated feedback can help you drill down on subsets of your app that underperform, and uncover new failure modes. This example will walk you through a simple example of recording human feedback with TruLens."
"In many situations, it can be useful to log human feedback from your users about your LLM app's performance. Combining human feedback along with automated feedback can help you drill down on subsets of your app that underperform, and uncover new failure modes. This example will walk you through a simple example of recording human feedback with TruLens.\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/truera/trulens/blob/main/trulens_eval/examples/quickstart/human_feedback.ipynb)"
]
},
{
Expand Down
13 changes: 11 additions & 2 deletions trulens_eval/examples/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"vector_store.add(\n",
" embeddings = students_embeddings,\n",
" documents = [university_info],\n",
" metadatas = [{\"source\": \"student info\"},{\"source\": \"club info\"},{'source':'university info'}],\n",
" ids = [\"id1\", \"id2\", \"id3\"]\n",
" metadatas = [{'source':'university info'}],\n",
" ids = [\"id1\"]\n",
")"
]
},
Expand All @@ -87,6 +87,15 @@
"Build a custom RAG from scratch, and add TruLens custom instrumentation."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"tru.reset_database()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
35 changes: 5 additions & 30 deletions trulens_eval/examples/quickstart/text2text_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,14 @@
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/truera/trulens/blob/main/trulens_eval/examples/quickstart/text2text_quickstart.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# ! pip install trulens_eval==0.17.0 openai==1.1.1"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup\n",
"### Add API keys\n",
"For this quickstart you will need Open AI and Huggingface keys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import logging"
"For this quickstart you will need an OpenAI Key."
]
},
{
Expand All @@ -50,17 +32,6 @@
"os.environ[\"OPENAI_API_KEY\"] = \"...\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from openai import OpenAI\n",
"\n",
"client = OpenAI()"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand All @@ -77,6 +48,10 @@
"source": [
"from IPython.display import JSON\n",
"\n",
"# Create openai client\n",
"from openai import OpenAI\n",
"client = OpenAI()\n",
"\n",
"# Imports main tools:\n",
"from trulens_eval import Feedback, OpenAI as fOpenAI, Tru\n",
"tru = Tru()\n",
Expand Down

0 comments on commit df3399e

Please sign in to comment.