Skip to content

Commit

Permalink
docs: update llamaindex tutorial (#5578)
Browse files Browse the repository at this point in the history
# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

@davidberenstein1957 I updated the tutorial, as it was already in the
docs. However, reading the last week's Slack discussion, maybe we should
move it to examples or something like that?

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Refactor (change restructuring the codebase without changing
functionality)
- Improvement (change adding some improvement to an existing
functionality)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
  • Loading branch information
sdiazlor authored Oct 8, 2024
1 parent 037fbd1 commit e600b7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 12 additions & 8 deletions argilla/docs/community/integrations/llamaindex_rag_github.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@
"from llama_index.core import (\n",
" Settings,\n",
" VectorStoreIndex,\n",
" set_global_handler,\n",
")\n",
"from llama_index.core.instrumentation import get_dispatcher\n",
"from llama_index.llms.openai import OpenAI\n",
"from llama_index.readers.github import (\n",
" GithubClient,\n",
" GithubRepositoryReader,\n",
")"
")\n",
"\n",
"from argilla_llama_index import ArgillaHandler"
]
},
{
Expand Down Expand Up @@ -104,15 +106,15 @@
"source": [
"## Set the Argilla's LlamaIndex handler\n",
"\n",
"To easily log your data into Argilla within your LlamaIndex workflow, you only need a simple step. Just call the Argilla global handler for Llama Index before starting production with your LLM. This ensured that the predictions obtained using Llama Index are automatically logged to the Argilla instance.\n",
"To easily log your data into Argilla within your LlamaIndex workflow, you only need to initialize the Argilla handler and attach it to the Llama Index dispatcher for spans and events. This ensures that the predictions obtained using Llama Index are automatically logged to the Argilla instance, along with the useful metadata.\n",
"\n",
"- `dataset_name`: The name of the dataset. If the dataset does not exist, it will be created with the specified name. Otherwise, it will be updated.\n",
"- `api_url`: The URL to connect to the Argilla instance.\n",
"- `api_key`: The API key to authenticate with the Argilla instance.\n",
"- `number_of_retrievals`: The number of retrieved documents to be logged. Defaults to 0.\n",
"- `workspace_name`: The name of the workspace to log the data. By default, the first available workspace.\n",
"\n",
"> For more information about the credentials, check the documentation for [users](https://docs.argilla.io/latest/how_to_guides/user/) and [workspaces](https://docs.argilla.io/latest/how_to_guides/workspace/)."
"> For more information about the credentials, check the documentation for [users](https://docs.argilla.io/latest/how_to_guides/user/) and [workspaces](https://docs.argilla.io/latest/how_to_guides/workspace/).\n"
]
},
{
Expand All @@ -121,13 +123,15 @@
"metadata": {},
"outputs": [],
"source": [
"set_global_handler(\n",
" \"argilla\",\n",
" dataset_name=\"github_query_model\",\n",
"argilla_handler = ArgillaHandler(\n",
" dataset_name=\"github_query_llama_index\",\n",
" api_url=\"http://localhost:6900\",\n",
" api_key=\"argilla.apikey\",\n",
" number_of_retrievals=2,\n",
")"
")\n",
"root_dispatcher = get_dispatcher()\n",
"root_dispatcher.add_span_handler(argilla_handler)\n",
"root_dispatcher.add_event_handler(argilla_handler)"
]
},
{
Expand Down

0 comments on commit e600b7c

Please sign in to comment.