Skip to content

Commit

Permalink
docs: Add Phoenix Llamaindex RAG Demo notebook + chunks + questions (#…
Browse files Browse the repository at this point in the history
…4202)

* wip

* wip

* wip

* traces/evals

* updated and fixed

* fix names

* fixtures

* transfer fixtures outsiide of git

* expose new demo data as trace dataset fixture

* remove unnecessary notebook

* remove json files and add to .gitignore

* rename directory/files, fix .gitignore

* rename

* fix notebook and fixtures with renamed files

* missed a section

* formatting

* post-review changes

* updated notebook

---------

Co-authored-by: Chris Park <cjpark@berkeley.edu>
  • Loading branch information
saikolasani and cjunkin authored Aug 17, 2024
1 parent 431b293 commit 7f1b817
Show file tree
Hide file tree
Showing 5 changed files with 1,351 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ coverage.xml

# devtools
pyrightconfig.json

# Demo data
tutorials/internal/demo_llama_index/*.json
22 changes: 22 additions & 0 deletions src/phoenix/trace/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ class TracesFixture:
dataset_fixtures: Iterable[DatasetFixture] = ()


demo_llama_index_rag_fixture = TracesFixture(
name="demo_llama_index_rag",
description="Traces and evaluations of a RAG chatbot using LlamaIndex.",
file_name="demo_llama_index_rag.parquet",
evaluation_fixtures=(
EvaluationFixture(
evaluation_name="Q&A Correctness",
file_name="demo_llama_index_rag_qa_correctness_eval.parquet",
),
EvaluationFixture(
evaluation_name="Hallucination",
file_name="demo_llama_index_rag_hallucination_eval.parquet",
),
DocumentEvaluationFixture(
evaluation_name="Relevance",
file_name="demo_llama_index_rag_doc_relevance_eval.parquet",
),
),
)

llama_index_rag_fixture = TracesFixture(
name="llama_index_rag",
description="Traces from running the llama_index on a RAG use case.",
Expand Down Expand Up @@ -175,6 +195,7 @@ class TracesFixture:
)

TRACES_FIXTURES: List[TracesFixture] = [
demo_llama_index_rag_fixture,
llama_index_rag_fixture,
llama_index_rag_fixture_with_davinci,
langchain_rag_stuff_document_chain_fixture,
Expand Down Expand Up @@ -276,6 +297,7 @@ def send_dataset_fixtures(
def get_evals_from_fixture(fixture_name: str) -> Iterator[pb.Evaluation]:
fixture = get_trace_fixture_by_name(fixture_name)
for eval_fixture in fixture.evaluation_fixtures:
print(eval_fixture)
yield from _read_eval_fixture(eval_fixture)


Expand Down
1 change: 0 additions & 1 deletion tutorials/internal/.gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions tutorials/internal/demo_llama_index/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.json
*.parquet
Loading

0 comments on commit 7f1b817

Please sign in to comment.