Spaces:
Sleeping
Sleeping
File size: 2,735 Bytes
5fdb69e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "a0adab93-e569-4af0-80f1-ce5b7a116507",
"metadata": {},
"outputs": [],
"source": [
"# imports\n",
"\n",
"%run week2/community-contributions/day1_class_definition.ipynb"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4566399a-e16d-41cd-bef4-f34b811e6377",
"metadata": {},
"outputs": [],
"source": [
"system_msg = \"You are an assistant that is great at telling jokes\"\n",
"user_msg = \"Tell a light-hearted joke for an audience of Software Engineers\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "362759bc-ce43-4f54-b8e2-1dab19c66a62",
"metadata": {},
"outputs": [],
"source": [
"# Easy to instantiate and use, just create an object \n",
"# using the right Wrapper"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a6e5468e-1f1d-40e4-afae-c292abc26c12",
"metadata": {},
"outputs": [],
"source": [
"gpt=GPT_Wrapper(system_msg, user_msg)\n",
"print(\"GPT: \" + gpt.getResult())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e650839a-7bc4-4b6c-b6ea-e836644b076f",
"metadata": {},
"outputs": [],
"source": [
"claude=Claude_Wrapper(system_msg, user_msg)\n",
"print(\"Claude: \" + claude.getResult())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "49335337-d713-4d9e-aba0-41a309c37699",
"metadata": {},
"outputs": [],
"source": [
"gemini=Gemini_Wrapper(system_msg, user_msg)\n",
"print(\"Gemini: \" + gemini.getResult())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "31d11b7b-5d14-4e3d-88e1-29239b667f3f",
"metadata": {},
"outputs": [],
"source": [
"ollama=Ollama_Wrapper(system_msg, user_msg)\n",
"print(\"Ollama: \" + ollama.getResult())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "282efb89-23b0-436e-8458-d6aef7d23117",
"metadata": {},
"outputs": [],
"source": [
"#Easy to change the prompt and reuse\n",
"\n",
"ollama.setUserPrompt(\"Tell a light-hearted joke for an audience of Managers\")\n",
"print(\"Ollama: \" + ollama.getResult())"
]
}
],
"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.11.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|