From bc028294d0c6563482d512d8a18295f23bb508e0 Mon Sep 17 00:00:00 2001 From: aditya thomas Date: Sat, 23 Mar 2024 02:32:59 +0530 Subject: [PATCH] docs: delete mistralai embeddings doc from incorrect location (#19432) **Description:** Delete MistralAIEmbeddings usage document from folder partners/mistralai/docs **Issue:** The document is present in the folder docs/docs **Dependencies:** None --- libs/partners/mistralai/docs/embeddings.ipynb | 103 ------------------ 1 file changed, 103 deletions(-) delete mode 100644 libs/partners/mistralai/docs/embeddings.ipynb diff --git a/libs/partners/mistralai/docs/embeddings.ipynb b/libs/partners/mistralai/docs/embeddings.ipynb deleted file mode 100644 index 33ed1137fd..0000000000 --- a/libs/partners/mistralai/docs/embeddings.ipynb +++ /dev/null @@ -1,103 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "b14a24db", - "metadata": {}, - "source": [ - "# MistralAIEmbeddings\n", - "\n", - "This notebook explains how to use MistralAIEmbeddings, which is included in the langchain_mistralai package, to embed texts in langchain." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "0ab948fc", - "metadata": {}, - "outputs": [], - "source": [ - "# pip install -U langchain-mistralai" - ] - }, - { - "cell_type": "markdown", - "id": "67c637ca", - "metadata": {}, - "source": [ - "## import the library" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "5709b030", - "metadata": {}, - "outputs": [], - "source": [ - "from langchain_mistralai import MistralAIEmbeddings" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "1756b1ba", - "metadata": {}, - "outputs": [], - "source": [ - "embedding = MistralAIEmbeddings(mistral_api_key='your-api-key')" - ] - }, - { - "cell_type": "markdown", - "id": "4a2a098d", - "metadata": {}, - "source": [ - "# Using the Embedding Model\n", - "With `MistralAIEmbeddings`, you can directly use the default model 'mistral-embed', or set a different one if available." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "584b9af5", - "metadata": {}, - "outputs": [], - "source": [ - "embedding.model = 'mistral-embed' # or your preferred model if available" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "be18b873", - "metadata": {}, - "outputs": [], - "source": [ - "res_query = embedding.embed_query(\"The test information\")\n", - "res_document = embedding.embed_documents([\"test1\", \"another test\"])" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.4" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}