|
| 1 | +# Examples |
| 2 | + |
| 3 | +This directory contains example scripts that demonstrate various functionalities of the Ragbits library. |
| 4 | +Each script showcases a specific use case, providing a practical guide to using Ragbits components. |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +To run the script, you will need to have `uv` installed. |
| 9 | +Some scripts may also require additional dependencies or API keys for external services. |
| 10 | + |
| 11 | +All necessary details are provided in the comments at the top of each script. |
| 12 | + |
| 13 | +## Scripts Overview |
| 14 | + |
| 15 | +| Script | Ragbits Package | Description | |
| 16 | +|:-------------------------------------------------------------------------------------------------|:------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 17 | +| [Text Prompt](/examples/core/prompt/text.py) | [ragbits-core](/packages/ragbits-core) | Example of how to use the `Prompt` class to generate themed text using an LLM with a simple text prompt. | |
| 18 | +| [Text Prompt with Few Shots](/examples/core/prompt/text_with_few_shots.py) | [ragbits-core](/packages/ragbits-core) | Example of how to use the `Prompt` class to generate themed text using an LLM with a text prompt and few-shot examples. | |
| 19 | +| [Multimodal Prompt](/examples/core/prompt/multimodal.py) | [ragbits-core](/packages/ragbits-core) | Example of how to use the `Prompt` class to generate themed text using an LLM with both text and image inputs. | |
| 20 | +| [Multimodal Prompt with Few Shots](/examples/core/prompt/multimodal_with_few_shots.py) | [ragbits-core](/packages/ragbits-core) | Example of how to use the `Prompt` class to generate themed text using an LLM with multimodal inputs and few-shot examples. | |
| 21 | +| [Tool Use with LLM](/examples/core/llms/tool_use.py) | [ragbits-core](/packages/ragbits-core) | Example of how to provide tools and return tool calls from LLM. | |
| 22 | +| [OpenTelemetry Audit](/examples/core/audit/otel.py) | [ragbits-core](/packages/ragbits-core) | Example of how to collect traces and metrics using Ragbits audit module with OpenTelemetry. | |
| 23 | +| [Logfire Audit](/examples/core/audit/logfire_.py) | [ragbits-core](/packages/ragbits-core) | Example of how to collect traces and metrics using Ragbits audit module with Logfire. | |
| 24 | +| [Basic Document Search](/examples/document-search/basic.py) | [ragbits-document-search](/packages/ragbits-document-search) | Example of how to use the `DocumentSearch` class to search for documents with the `InMemoryVectorStore` class to store the embeddings. | |
| 25 | +| [Chroma Document Search](/examples/document-search/chroma.py) | [ragbits-document-search](/packages/ragbits-document-search) | Example of how to use the `DocumentSearch` class to search for documents with the `ChromaVectorStore` class to store the embeddings. | |
| 26 | +| [Multimodal Document Search](/examples/document-search/multimodal.py) | [ragbits-document-search](/packages/ragbits-document-search) | Example of how to use the `DocumentSearch` to index and search for images and text documents with the `MultimodalEmbedding` from VertexAI. | |
| 27 | +| [PgVector Document Search](/examples/document-search/pgvector.py) | [ragbits-document-search](/packages/ragbits-document-search) | Example of how to use the `DocumentSearch` class to search for documents with the `PgVectorStore` class to store the embeddings in a Postgres database. | |
| 28 | +| [Qdrant Document Search](/examples/document-search/qdrant.py) | [ragbits-document-search](/packages/ragbits-document-search) | Example of how to use the `DocumentSearch` class to search for documents with the `QdrantVectorStore` class to store the embeddings. | |
| 29 | +| [Weaviate Document Search](/examples/document-search/weaviate_.py) | [ragbits-document-search](/packages/ragbits-document-search) | Example of how to use the `DocumentSearch` class to search for documents with the `WeaviateVectorStore` class to store the embeddings. | |
| 30 | +| [Dataset Generation](/examples/evaluate/dataset-generator/generate.py) | [ragbits-evaluate](/packages/ragbits-evaluate) | Example of how to generate a synthetic dataset using the `DatasetGenerationPipeline` class. | |
| 31 | +| [Basic Document Search Evaluation](/examples/evaluate/document-search/basic/evaluate.py) | [ragbits-evaluate](/packages/ragbits-evaluate) | Example of how to evaluate a basic document search pipeline using the `Evaluator` class. | |
| 32 | +| [Basic Document Search Optimization](/examples/evaluate/document-search/basic/optimize.py) | [ragbits-evaluate](/packages/ragbits-evaluate) | Example of how to optimize a basic document search pipeline using the `Optimizer` class. | |
| 33 | +| [Advanced Document Search Evaluation](/examples/evaluate/document-search/advanced/evaluate.py) | [ragbits-evaluate](/packages/ragbits-evaluate) | Example of how to evaluate an advanced document search pipeline using the `Evaluator` class. | |
| 34 | +| [Advanced Document Search Optimization](/examples/evaluate/document-search/advanced/optimize.py) | [ragbits-evaluate](/packages/ragbits-evaluate) | Example of how to optimize an advanced document search pipeline using the `Optimizer` class. | |
| 35 | +| [Chat Interface](/examples/chat/chat.py) | [ragbits-chat](/packages/ragbits-chat) | Example of how to use the `ChatInterface` to create a simple chat application. | |
| 36 | +| [Offline Chat Interface](/examples/chat/offline_chat.py) | [ragbits-chat](/packages/ragbits-chat) | Example of how to use the `ChatInterface` to create a simple chat application that works offline. | |
| 37 | +| [Recontextualize Last Message](/examples/chat/recontextualize_message.py) | [ragbits-chat](/packages/ragbits-chat) | Example of how to use the `StandaloneMessageCompressor` compressor to recontextualize the last message in a conversation history. | |
| 38 | +| [Agents Tool Use](/examples/agents/tool_use.py) | [ragbits-agents](/packages/ragbits-agents) | Example of how to use agent with tools. | |
0 commit comments