diff --git a/week8/agents/specialist_agent.py b/week8/agents/specialist_agent.py index 8ffc8ad..1bab0d5 100644 --- a/week8/agents/specialist_agent.py +++ b/week8/agents/specialist_agent.py @@ -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") diff --git a/week8/day1.ipynb b/week8/day1.ipynb index 5b539cd..1c54283 100644 --- a/week8/day1.ipynb +++ b/week8/day1.ipynb @@ -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,