{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1c0cf975",
   "metadata": {},
   "source": [
    "# Jina\n",
    "\n",
    "Let's load the Jina Embedding class."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d94c62b4",
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain.embeddings import JinaEmbeddings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "523a09e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "embeddings = JinaEmbeddings(\n",
    "    jina_api_key=\"jina_*\", model_name=\"jina-embeddings-v2-base-en\"\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b212bd5a",
   "metadata": {},
   "outputs": [],
   "source": [
    "text = \"This is a test document.\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "57db66bd",
   "metadata": {},
   "outputs": [],
   "source": [
    "query_result = embeddings.embed_query(text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aea3ca33-1e6e-499c-8284-b7e26f38c514",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(query_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b790fd09",
   "metadata": {},
   "outputs": [],
   "source": [
    "doc_result = embeddings.embed_documents([text])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c2e6b743-768c-4d7e-a331-27d5f0e8e30e",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(doc_result)"
   ]
  }
 ],
 "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.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
