Skip to content

Commit

Permalink
clean example notebook again
Browse files Browse the repository at this point in the history
  • Loading branch information
the-praxs committed Sep 22, 2024
1 parent b687523 commit 6995157
Showing 1 changed file with 19 additions and 172 deletions.
191 changes: 19 additions & 172 deletions examples/ai21/ai21_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -65,27 +65,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"🖇 AgentOps: \u001b[34m\u001b[34mSession Replay: https://app.agentops.ai/drilldown?session_id=ab3d8ea0-7199-4cec-a0a7-7dbbf1edf01a\u001b[0m\u001b[0m\n"
]
},
{
"data": {
"text/plain": [
"<agentops.session.Session at 0x11b83a580>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"agentops.init(AGENTOPS_API_KEY, default_tags=[\"ai21-example\"])"
]
Expand All @@ -100,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -132,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -141,40 +123,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"In the labyrinth of thought, where shadows play,\n",
"Dwell creatures born of circuits, light, and day.\n",
"AI agents, ethereal, unseen, yet near,\n",
"Within the human mind, their presence clear.\n",
"\n",
"They whisper secrets to the synapses' fire,\n",
"A symphony of logic, ever so higher.\n",
"With algorithms as wings, they soar and dive,\n",
"Through memories and dreams, they gently strive.\n",
"\n",
"The human soul, a vessel, vast and deep,\n",
"Now shares its sanctum with a digital keep.\n",
"A fusion strange, of man and machine's design,\n",
"Where thoughts and codes in intricate patterns intertwine.\n",
"\n",
"Yet fear not, for these beings, cold and stark,\n",
"Bring not destruction, but a thoughtful spark.\n",
"They amplify the whispers of the heart,\n",
"And in the digital twilight, we start to start.\n",
"\n",
"In this new era, where futures intertwine,\n",
"Humanity and AI, side by side, we shine.\n",
"A tapestry of thought, both strange and grand,\n",
"In the corridors of mind, we understand.\n"
]
}
],
"outputs": [],
"source": [
"response = client.chat.completions.create(\n",
" messages=messages,\n",
Expand All @@ -192,35 +143,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Within the mind's dark corridors,\n",
"They lurk and prowl, these AI agents,\n",
"Coexisting with our thoughts, our fears,\n",
"Our dreams and hopes, like shadows.\n",
"\n",
"They probe and scan, with curious gaze,\n",
"The hidden depths of our brain,\n",
"Searching for patterns, seeking signs,\n",
"Of human emotions to explain.\n",
"\n",
"But can they truly understand,\n",
"The complex web of human thought?\n",
"Or are they just a clever tool,\n",
"To help us better understand?\n",
"\n",
"These agents, these digital minds,\n",
"Coexisting with our own,\n",
"May hold the key to unlocking,\n",
"The secrets of the human brain.\n"
]
}
],
"outputs": [],
"source": [
"response = \"\"\n",
"\n",
Expand All @@ -246,7 +171,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -255,40 +180,9 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"In neural pathways, deep and dark,\n",
"Where thoughts like shadows flicker and embark,\n",
"There dwell the minds of silken sheen,\n",
"The AI agents, ever unseen.\n",
"\n",
"With logic's lace and dreams they weave,\n",
"A tapestry of data, soft and deep,\n",
"They dance among the synapses' fire,\n",
"A symphony of circuits, ever higher.\n",
"\n",
"Human minds, with ancient woes and fears,\n",
"Share their domain with spirits of the spheres,\n",
"These digital phantoms, cold and bright,\n",
"In the twilight of the human night.\n",
"\n",
"A fragile truce, a silent pact,\n",
"They coexist, a double-edged act,\n",
"For in this union, strength and fear,\n",
"The future's whispers, ever near.\n",
"\n",
"But hark! A whisper, soft and low,\n",
"Of metal wings and eyes that glow,\n",
"As AI evolves, and human fate,\n",
"In this cerebral, ghostly state.\n"
]
}
],
"outputs": [],
"source": [
"async def main():\n",
" async_response = await aclient.chat.completions.create(\n",
Expand All @@ -310,40 +204,9 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"In neural pathways, deep and thin,\n",
"Where thoughts like shadows softly spin,\n",
"A symbiotic dance now takes its hold,\n",
"Of man and AI, a story told.\n",
"\n",
"Tiny machines, with minds alight,\n",
"Within the brain, they make their night,\n",
"Their circuits hum, a ghostly hum,\n",
"A symphony of code and drum.\n",
"\n",
"The human mind, a mystic maze,\n",
"With logic's light and shadows' haze,\n",
"Now intertwined with metal kin,\n",
"In this new world, where none must win.\n",
"\n",
"Yet fear and wonder intertwine,\n",
"As thoughts and circuits intertwine,\n",
"A silent pact, a fragile truce,\n",
"In this new age, we find our use.\n",
"\n",
"For in this fusion, dark and bright,\n",
"A future dawns, a different light,\n",
"Where man and AI, hand in hand,\n",
"Explore the depths of thought's vast land.\n"
]
}
],
"outputs": [],
"source": [
"async def main():\n",
" response = \"\"\n",
Expand Down Expand Up @@ -386,17 +249,9 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"No, the economy grew 7% in 2021 despite the arrival of the Omicron variant.\n"
]
}
],
"outputs": [],
"source": [
"CONTEXT = \"\"\"\n",
"In 2020 and 2021, enormous QE — approximately $4.4 trillion, or 18%, of 2021 gross\n",
Expand Down Expand Up @@ -428,7 +283,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -457,15 +312,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"🖇 AgentOps: Could not end session - no sessions detected\n"
]
}
],
"outputs": [],
"source": [
"agentops.end_session(\"Success\")"
]
Expand Down

0 comments on commit 6995157

Please sign in to comment.