Skip to content

Commit

Permalink
Merge pull request #115 from Azure-Samples/oct-update
Browse files Browse the repository at this point in the history
Oct update
  • Loading branch information
john0isaac authored Oct 26, 2024
2 parents a5a3c74 + d97c9cc commit ada08f0
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 61 deletions.
39 changes: 21 additions & 18 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.3.2",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.3",
"globals": "^15.6.0",
"prettier": "^3.0.3",
"typescript": "^5.5.3",
"prettier": "^3.3.3",
"typescript": "^5.6.3",
"typescript-eslint": "^7.13.1",
"vite": "^5.4.8",
"rollup-plugin-visualizer": "^5.12.0"
Expand Down
35 changes: 19 additions & 16 deletions rag-azure-openai-cosmosdb-langchain-notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install langchain==0.3.1\n",
"%pip install langchain-openai==0.2.1\n",
"%pip install pymongo==4.9.1"
"%pip install langchain==0.3.4\n",
"%pip install langchain-openai==0.2.3\n",
"%pip install pymongo==4.10.1"
]
},
{
Expand Down Expand Up @@ -104,7 +104,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/db/x_x115ns61154jxycm1mwr780000gn/T/ipykernel_61994/1277193319.py:17: UserWarning: You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb\n",
"/var/folders/db/x_x115ns61154jxycm1mwr780000gn/T/ipykernel_54773/1277193319.py:17: UserWarning: You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb\n",
" mongo_client = MongoClient(mongo_connection_string)\n"
]
}
Expand Down Expand Up @@ -369,8 +369,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Why don't scientists trust atoms? \n",
"Because they make up everything.\n"
"Why don't scientists trust atoms?\n",
"\n",
"Because they make up everything!\n"
]
}
],
Expand All @@ -389,13 +390,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Education is a fundamental aspect of human life. It is the process of acquiring knowledge, skills, values, and attitudes that enable individuals to lead fulfilling lives. Education plays a crucial role in shaping individuals and communities. It equips people with the necessary tools to navigate the complexities of the world and make informed decisions.\n",
"Education is a fundamental aspect of human development. It plays a pivotal role in shaping individuals' minds, fostering critical thinking skills, and equipping them with the necessary knowledge and skills to succeed in life. Education is not confined to the walls of a classroom; it encompasses a broader spectrum of learning experiences that occur throughout a person's lifetime.\n",
"\n",
"Firstly, education provides individuals with a solid foundation of knowledge. From basic literacy and numeracy skills to more advanced subjects like science, history, and literature, education broadens our understanding of the world around us. It helps us make informed decisions and enables us to contribute meaningfully to society.\n",
"\n",
"Education is not just about academic learning, but also about social, emotional, and ethical development. It teaches individuals how to communicate effectively, work collaboratively, and think critically. Education is essential for personal growth and development, but it also has broader social and economic benefits. Educated individuals are more likely to contribute positively to society and have better employment opportunities.\n",
"Furthermore, education fosters critical thinking and problem-solving skills. It encourages individuals to question, analyze, and think independently. Through various teaching methods such as discussions, research projects, and practical applications, education promotes creativity and innovation. It equips individuals with the ability to tackle challenges and find solutions, preparing them for the complexities of the modern world.\n",
"\n",
"Education is a human right, and access to quality education should be available to all. Unfortunately, not everyone has equal access to education, and this inequality leads to social and economic disparities. Governments must invest in education to ensure that every individual has access to quality education, regardless of their socio-economic background.\n",
"Education also empowers individuals by providing them with opportunities for personal and professional growth. It opens doors to better job prospects, higher earning potential, and improved social status. Moreover, education promotes lifelong learning, allowing individuals to adapt to changing circumstances and acquire new skills throughout their lives.\n",
"\n",
"In conclusion, education is a powerful tool that can transform individuals and communities. It provides individuals with the knowledge, skills, and values necessary to lead fulfilling lives. Governments must prioritize education to ensure that every individual has access to quality education, and to promote social and economic equality."
"In conclusion, education is a powerful tool that has the potential to transform lives. It instills a love for learning, nurtures critical thinking skills, and empowers individuals to reach their full potential. By investing in education, societies can pave the way for a brighter future, where individuals are equipped with the knowledge and skills to overcome challenges and contribute positively to their communities."
]
}
],
Expand Down Expand Up @@ -507,7 +510,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"What vegan options do you offer?\n"
"What vegan options do you have?\n"
]
}
],
Expand All @@ -528,7 +531,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[DataPoint(name='Beyond Burger', description='Served with Romaine lettuce, tomato, pickle, vegan mayonnaise, ketchup, and mustard on a toasted bun. Sandwich made with whole wheat bread. Can be made as a wrap in a whole wheat tortilla. Served with kettle potato chips or corn tortilla chips.', price='9.0 USD', category='Sandwiches', collection=None), DataPoint(name='Tofu Salad Sandwich', description='Served with Romaine lettuce, tomato, vegan mayonnaise, and mustard. Sandwich made with whole wheat bread. Can be made as a wrap in a whole wheat tortilla. Served with kettle potato chips or corn tortilla chips.', price='9.0 USD', category='Sandwiches', collection=None), DataPoint(name=\"Boca Chik'n Sandwich\", description='Served with Romaine lettuce, tomato, pickle, vegan mayonnaise, ketchup, and mustard on a toasted bun. Sandwich made with whole wheat bread. Can be made as a wrap in a whole wheat tortilla. Served with kettle potato chips or corn tortilla chips.', price='9.0 USD', category='Sandwiches', collection=None)]\n"
"[DataPoint(name='Beyond Burger', description='Served with Romaine lettuce, tomato, pickle, vegan mayonnaise, ketchup, and mustard on a toasted bun. Sandwich made with whole wheat bread. Can be made as a wrap in a whole wheat tortilla. Served with kettle potato chips or corn tortilla chips.', price='9.0 USD', category='Sandwiches', collection=None), DataPoint(name='Tofu Salad Sandwich', description='Served with Romaine lettuce, tomato, vegan mayonnaise, and mustard. Sandwich made with whole wheat bread. Can be made as a wrap in a whole wheat tortilla. Served with kettle potato chips or corn tortilla chips.', price='9.0 USD', category='Sandwiches', collection=None)]\n"
]
}
],
Expand All @@ -548,7 +551,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"We offer several vegan options, including the Beyond Burger, Tofu Salad Sandwich, and Boca Chik'n Sandwich. All of these sandwiches come with Romaine lettuce, tomato, and vegan mayonnaise, and can be made as a wrap in a whole wheat tortilla. They are all priced at $9.0 USD and served with kettle potato chips or corn tortilla chips.\n"
"We have a couple of delicious vegan options for you! Our Beyond Burger is made with plant-based ingredients and served with lettuce, tomato, pickle, vegan mayo, ketchup, and mustard on a toasted bun. We also have a Tofu Salad Sandwich with lettuce, tomato, vegan mayo, and mustard. Both sandwiches can be made as wraps and come with kettle potato chips or corn tortilla chips. They are priced at $9. Enjoy your vegan meal!\n"
]
}
],
Expand Down Expand Up @@ -592,8 +595,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Rephrased Question: What is the price of the first vegan option?\n",
"LLM Response: The first vegan option on our menu is the Beyond Burger and it costs 9.0 USD. It comes with Romaine lettuce, tomato, pickle, vegan mayonnaise, ketchup, and mustard on a toasted bun. You can also have it as a wrap in a whole wheat tortilla. It's served with kettle potato chips or corn tortilla chips. Enjoy!\n"
"Rephrased Question: What is the price of the first vegan dish?\n",
"LLM Response: The price of the first vegan dish, Veggie Samosa, is 8.35 USD. Enjoy these triangular pastries filled with spiced potatoes, peas, and lentils, served with a side of mint or tamarind relish!\n"
]
}
],
Expand Down Expand Up @@ -674,7 +677,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand Down
48 changes: 24 additions & 24 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ aiofiles==24.1.0
# via quart
aiohappyeyeballs==2.4.3
# via aiohttp
aiohttp==3.10.8
aiohttp==3.10.10
# via
# langchain
# langchain-community
aiosignal==1.3.1
# via aiohttp
annotated-types==0.7.0
# via pydantic
anyio==4.6.0
anyio==4.6.2.post1
# via
# httpx
# openai
Expand All @@ -31,7 +31,7 @@ certifi==2024.8.30
# httpcore
# httpx
# requests
charset-normalizer==3.3.2
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via
Expand All @@ -41,15 +41,15 @@ dataclasses-json==0.6.7
# via langchain-community
distro==1.9.0
# via openai
dnspython==2.6.1
dnspython==2.7.0
# via pymongo
flask==3.0.3
# via quart
frozenlist==1.4.1
frozenlist==1.5.0
# via
# aiohttp
# aiosignal
greenlet==3.1.1
greenlet==3.0.3
# via sqlalchemy
h11==0.14.0
# via
Expand All @@ -60,7 +60,7 @@ h2==4.1.0
# via hypercorn
hpack==4.0.0
# via h2
httpcore==1.0.5
httpcore==1.0.6
# via httpx
httpx==0.27.2
# via
Expand All @@ -72,7 +72,7 @@ hypercorn==0.17.3
# quartapp (src/pyproject.toml)
hyperframe==6.0.1
# via h2
idna==3.9
idna==3.10
# via
# anyio
# httpx
Expand All @@ -86,39 +86,39 @@ jinja2==3.1.4
# via
# flask
# quart
jiter==0.5.0
jiter==0.6.1
# via openai
jsonpatch==1.33
# via langchain-core
jsonpointer==3.0.0
# via jsonpatch
langchain==0.3.1
langchain==0.3.4
# via
# langchain-community
# quartapp (src/pyproject.toml)
langchain-community==0.3.1
langchain-community==0.3.3
# via quartapp (src/pyproject.toml)
langchain-core==0.3.6
langchain-core==0.3.13
# via
# langchain
# langchain-community
# langchain-openai
# langchain-text-splitters
langchain-openai==0.2.1
langchain-openai==0.2.3
# via quartapp (src/pyproject.toml)
langchain-text-splitters==0.3.0
# via langchain
langsmith==0.1.129
langsmith==0.1.137
# via
# langchain
# langchain-community
# langchain-core
markupsafe==2.1.5
markupsafe==3.0.2
# via
# jinja2
# quart
# werkzeug
marshmallow==3.22.0
marshmallow==3.23.0
# via dataclasses-json
multidict==6.1.0
# via
Expand All @@ -130,9 +130,9 @@ numpy==1.26.4
# via
# langchain
# langchain-community
openai==1.50.2
openai==1.52.2
# via langchain-openai
orjson==3.10.7
orjson==3.10.10
# via langsmith
packaging==24.1
# via
Expand All @@ -151,7 +151,7 @@ pydantic-core==2.23.4
# via pydantic
pydantic-settings==2.5.2
# via langchain-community
pymongo==4.9.1
pymongo==4.10.1
# via quartapp (src/pyproject.toml)
python-dotenv==1.0.1
# via
Expand All @@ -162,7 +162,7 @@ pyyaml==6.0.2
# langchain
# langchain-community
# langchain-core
quart==0.19.6
quart==0.19.8
# via quartapp (src/pyproject.toml)
regex==2024.9.11
# via tiktoken
Expand All @@ -177,7 +177,7 @@ sniffio==1.3.1
# anyio
# httpx
# openai
sqlalchemy==2.0.35
sqlalchemy==2.0.36
# via
# langchain
# langchain-community
Expand All @@ -186,7 +186,7 @@ tenacity==8.5.0
# langchain
# langchain-community
# langchain-core
tiktoken==0.7.0
tiktoken==0.8.0
# via langchain-openai
tqdm==4.66.5
# via openai
Expand All @@ -202,11 +202,11 @@ typing-inspect==0.9.0
# via dataclasses-json
urllib3==2.2.3
# via requests
werkzeug==3.0.4
werkzeug==3.0.6
# via
# flask
# quart
wsproto==1.2.0
# via hypercorn
yarl==1.13.1
yarl==1.16.0
# via aiohttp

0 comments on commit ada08f0

Please sign in to comment.