Dynamic few shot example selection
This feature is currently in closed beta. Please sign up here for access
Configure your datasets so that you can search for few shot examples based on an incoming request.
Pre-conditions
- Your dataset must have the KV store data type (we do not currently support chat model or LLM type datasets)
- You must have an input schema defined for your dataset. See our docs on setting up schema validation in our UI for details.
- You must be enabled for the closed beta
- You must be on LangSmith cloud
Index your dataset to be searched
On the datasets UI, click the Few-shot Index
on the top right corner and hit Start Sync
.
This process will start to index your data to be searchable in the background. A note will appear on the modal above that says if your index is up to date, and if not, what version of your dataset it last indexed.
All new data added to your dataset will automatically be indexed. You do not need to re-index when adding new data.
Search your dataset for similar examples
You can search your dataset via API for similar examples using the POST /datasets/<id>/search
REST API. Its documentation
can be found here.
You can see detailed examples of how use this in your prompts both with and without LangChain in
our cookbook on using indexed datasets with few shot prompts