Skip to content

Commit

Permalink
Merge branch 'main' of https://GitHub.com/Aitomatic/OpenSSA into docs
Browse files Browse the repository at this point in the history
# Conflicts:
#	examples/integrations/lepton_ai.ipynb
#	examples/integrations/llama_index.ipynb
#	examples/integrations/openai.ipynb
#	examples/notebooks/integrations/Lepton.ipynb
#	examples/notebooks/integrations/LlamaIndex.ipynb
#	examples/notebooks/integrations/OpenAI.ipynb
#	examples/notebooks/integrations/lepton_ai.ipynb
#	examples/notebooks/integrations/llama_index.ipynb
#	examples/notebooks/integrations/openai.ipynb
  • Loading branch information
TheVinhLuong102 committed Dec 14, 2023
2 parents 61cb809 + 26e9ad0 commit 7f44b43
Show file tree
Hide file tree
Showing 2 changed files with 708 additions and 0 deletions.
170 changes: 170 additions & 0 deletions examples/notebooks/integrations/lepton_ai.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Lepton.AI Integration\n",
"\n",
"This notebook demonstrates how to use the Lepton.AI integration."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Import OpenSSA package \"live\" from the source code\n",
"import sys\n",
"from pathlib import Path\n",
"sys.path.insert(0, str(Path('../../').resolve()))\n",
"\n",
"# Configure logging for some informative output\n",
"# from openssa import Logs, logger\n",
"# logger.setLevel(logger.WARNING)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from openssa import LeptonLlamaIndexSSM\n",
"ssm = LeptonLlamaIndexSSM(name=\"eos\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'role': 'assistant',\n",
" 'content': 'You can ask me any questions related to EOS support and service. I can provide you with detailed information and help you troubleshoot any issues you may encounter.'}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ssm.discuss(\"What can I ask you?\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'role': 'assistant',\n",
" 'content': 'The M290 is a machine that performs a specific task or set of tasks. It is used in industrial settings to ensure the efficient operation of the system. It is important to check the M290 regularly for any errors or malfunctions.'}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ssm.discuss(\"What does the M290 do?\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'role': 'assistant',\n",
" 'content': 'The EOS M290 and the EOS M400 are both laser-sintering systems used for metal powder, but they have some key differences. The M290 is designed for smaller projects and is more portable, while the M400 is designed for larger projects and is more powerful. The M290 has a lower maximum build size and a lower maximum laser power compared to the M400. Additionally, the M290 has a more user-friendly interface and is easier to operate, while the M400 is more complex and requires more maintenance.'}"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ssm.discuss(\"What are the key differences between the M290 and the M400?\", \"test_id\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ssm.discuss(\"What’s the difference between M290 and M400-4?\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ssm.discuss(\"My M290 print has curling open layers. What might be the cause?\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.12"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 7f44b43

Please sign in to comment.