Skip to content

Commit

Permalink
Merge pull request #90 from cohere-ai/rag-connector
Browse files Browse the repository at this point in the history
Cleanup notebook
  • Loading branch information
mrmer1 authored Dec 13, 2023
2 parents bfdfec0 + aa5dcff commit 8bc4b20
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions examples/chat_rag_connector/RAG_Chatbot_with_Connectors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,54 +70,6 @@
"print(response.json()[\"message\"])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Documents processed successfully\n"
]
}
],
"source": [
"import requests\n",
"\n",
"# Define the sources for the documents\n",
"# As an example, we'll use LLM University's Module 1: What are Large Language Models?\n",
"# https://docs.cohere.com/docs/intro-large-language-models\n",
"\n",
"sources = [\n",
" {\n",
" \"title\": \"Text Embeddings\", \n",
" \"url\": \"https://docs.cohere.com/docs/text-embeddings\"},\n",
" {\n",
" \"title\": \"Similarity Between Words and Sentences\", \n",
" \"url\": \"https://docs.cohere.com/docs/similarity-between-words-and-sentences\"},\n",
" {\n",
" \"title\": \"The Attention Mechanism\", \n",
" \"url\": \"https://docs.cohere.com/docs/the-attention-mechanism\"},\n",
" {\n",
" \"title\": \"Transformer Models\", \n",
" \"url\": \"https://docs.cohere.com/docs/transformer-models\"} \n",
"]\n",
"\n",
"DEMO_CONNECTOR_API_KEY = \"6qXN7O-FdR9Q-89nW5UpbvRAk9q8oTgtc0EJz98yAg4\" # Replace with your connector API key\n",
"\n",
"headers = {\n",
" \"Authorization\": f\"Bearer {DEMO_CONNECTOR_API_KEY}\"\n",
"}\n",
"\n",
"response = requests.post(\"https://demo-conn.onrender.com/process\", # Replace with your API's URL\n",
" json={\"sources\": sources},\n",
" headers=headers)\n",
"\n",
"print(response.json()[\"message\"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 8bc4b20

Please sign in to comment.