forked from aws-samples/mistral-on-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sharon Li
committed
Jun 17, 2024
1 parent
c3eb02b
commit e2acffc
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Bedrock Mistral prompting examples πͺ¨π | ||
|
||
## Getting Started π | ||
|
||
Please visit [Amazon Bedrock user guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) on how to enable model access. π | ||
|
||
The notebooks are executed from SageMaker studio with Data Science 3.0 image. π»π¬ | ||
|
||
## Introduction π | ||
|
||
Welcome to the Bedrock Mistral prompting examples repository! This collection aims to provide you with a wide range of prompting examples and techniques to enhance your experience with the Mistral language model. Whether you're a beginner or an experienced user, these examples will help you unlock the full potential of this powerful tool. π‘ | ||
|
||
## Resources π | ||
|
||
Looking for additional resources? Check out these helpful links: | ||
|
||
- [Mistral Documentation](https://mistral.ai/) | ||
- [Bedrock Documentation](https://aws.amazon.com/bedrock/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Main Notebooks π | ||
|
||
- **Mistral Getting Started Guide**: π This notebook adds tool use to the comprehensive guide on utilizing the Converse API with the Mistral models, focusing on defining tools, understanding tool_choice impacts, and leveraging the API for enhanced functionality. Users will learn to configure tools, observe the effects of different tool choices on model outputs, and gain practical experience with the Converse API to maximize the Mistral models' potential in various scenarios. | ||
|
||
- **Prompt Engineering 101 w/ Mistral**: π οΈ This notebook provides a comprehensive guide on how to get started with the Mistral AI models on Amazon Bedrock. It highlights the significance of prompt engineering techniques, such as zero-shot, few-shot, and chain-of-thought prompting, to enhance the quality and accuracy of model outputs. The notebook demonstrates how to effectively utilize special tokens and instruction templates to maximize the potential of LLMs. Additionally, it offers a detailed comparison of the capabilities of Mistral Large, Mixtral 8x7B, and Mistral Small models, showcasing their respective strengths in analytical reasoning and multilingual tasks through insightful examples. Overall, the notebook equips users with the necessary knowledge and techniques to leverage the power of Mistral AI models on Amazon Bedrock effectively. | ||
|
||
- **OpenAI to Mistral**: π This guide provides a foundation for transitioning OpenAI prompts and workloads to Mistral models, demonstrating their capabilities and efficiency through practical examples. | ||
|
||
- **Agentic Workflows with tool use - now with native tool use!**: π€ We demonstrate an agentic workflow that leverages Mistral models on Amazon Bedrock to create a seamless function calling experience. We explore techniques for crafting effective prompts over function calling and developing custom helper functions capable of understanding an API's data structure. These helper functions can identify the necessary tools and methods to be executed during the agentic workflow interactions. | ||
|
||
- **Advanced RAG Pipeline with Q&A Automation and Model Evaluation**: βοΈ This notebook automates and evaluates the RAG pipeline with Mistral 7B Instruct as the generator. It utilizes LlamaIndex and Ragas to automate Q&A, generating questions based on your data, allowing you to test your RAG pipeline's performance on a diverse set of queries without manual effort. Additionally, it assesses performance metrics such as faithfulness, relevancy, correctness, semantic similarity, and others on tailored test sets, aiming to identify strengths, limitations, and areas for improvement in the pipeline. | ||
|
||
- **Summarizing long documents with LangChain**: π This Python notebook explores summarizing long documents using the Mistral Large language model on Amazon Bedrock with the LangChain library. It covers three main summarization techniques: Stuff (passing the entire document to the model in a single call), Map Reduce (a scalable technique, splitting the document into chunks, summarizing each chunk in parallel, and combining these summaries), and Refine (an iterative approach, generating an initial summary and refining it with additional context from subsequent chunks). The notebook includes detailed code examples for each technique using LangChain's utilities and chains. It demonstrates loading PDF documents, splitting them into text chunks, and customizing prompt templates. Additionally, it showcases the Mistral model's multilingual capabilities by generating a summary in French. | ||
|
||
- **Multi-chain Routing in LangChain**: π This notebook demonstrates the use of multi-chain routing in LangChain, a Python library for building applications with large language models (LLMs) and integrating different Mistral AI models from Amazon Bedrock (Mistral Large, Mistral 7B, and Mixtral 8X7B). The notebook explores a use case in the Financial Services Industry (FSI), where a user can query information about their investments, retrieve financial reports, and search for relevant news articles using a single pipeline. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
site_name: Mistral on AWS | ||
copyright: Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
theme: | ||
name: material | ||
icon: | ||
annotation: material/plus-circle-outline | ||
repo: material/github | ||
palette: | ||
- media: "(prefers-color-scheme: light)" | ||
scheme: default | ||
primary: white | ||
accent: deep purple | ||
toggle: | ||
icon: material/weather-night | ||
name: "Switch to dark mode" | ||
- media: "(prefers-color-scheme: dark)" | ||
scheme: slate | ||
primary: black | ||
accent: deep purple | ||
toggle: | ||
icon: material/weather-sunny | ||
name: "Switch to light mode" | ||
features: | ||
- header.autohide | ||
- content.code.copy | ||
- content.code.annotate | ||
- navigation.indexes | ||
- navigation.footer | ||
- navigation.top | ||
- navigation.tabs | ||
repo_url: https://github.com/aws-samples/bedrock-mistral-prompting-examples | ||
repo_name: aws-samples/bedrock-mistral-prompting-examples | ||
nav: | ||
- Home: index.md | ||
- Notebooks: notebooks.md |