Updated modal with API changes - thank you to student Sayak
This commit is contained in:
@@ -15,7 +15,7 @@ class SpecialistAgent(Agent):
|
||||
Set up this Agent by creating an instance of the modal class
|
||||
"""
|
||||
self.log("Specialist Agent is initializing - connecting to modal")
|
||||
Pricer = modal.Cls.lookup("pricer-service", "Pricer")
|
||||
Pricer = modal.Cls.from_name("pricer-service", "Pricer")
|
||||
self.pricer = Pricer()
|
||||
self.log("Specialist Agent is ready")
|
||||
|
||||
|
||||
@@ -185,6 +185,9 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# This import may give a deprecation warning about adding local Python modules to the Image\n",
|
||||
"# That warning can be safely ignored. You may get the same warning in other places, too..\n",
|
||||
"\n",
|
||||
"from llama import app, generate"
|
||||
]
|
||||
},
|
||||
@@ -259,7 +262,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!modal deploy pricer_service"
|
||||
"# You can also run \"modal deploy -m pricer_service\" at the command line in an activated environment\n",
|
||||
"!modal deploy -m pricer_service"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -269,7 +273,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"pricer = modal.Function.lookup(\"pricer-service\", \"price\")"
|
||||
"pricer = modal.Function.from_name(\"pricer-service\", \"price\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -279,6 +283,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# This can take a while! We'll use faster approaches shortly\n",
|
||||
"\n",
|
||||
"pricer.remote(\"Quadcast HyperX condenser mic, connects via usb-c to your computer for crystal clear audio\")"
|
||||
]
|
||||
},
|
||||
@@ -290,6 +296,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# You can also run \"modal deploy -m pricer_service2\" at the command line in an activated environment\n",
|
||||
"\n",
|
||||
"!modal deploy -m pricer_service2"
|
||||
]
|
||||
},
|
||||
@@ -300,22 +307,12 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"Pricer = modal.Cls.lookup(\"pricer-service\", \"Pricer\")\n",
|
||||
"Pricer = modal.Cls.from_name(\"pricer-service\", \"Pricer\")\n",
|
||||
"pricer = Pricer()\n",
|
||||
"reply = pricer.price.remote(\"Quadcast HyperX condenser mic, connects via usb-c to your computer for crystal clear audio\")\n",
|
||||
"print(reply)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c29b8c58-4cb7-44b0-ab7e-6469d3a318e8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!pip install --upgrade modal"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9c1b1451-6249-4462-bf2d-5937c059926c",
|
||||
@@ -390,7 +387,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.11"
|
||||
"version": "3.11.12"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user