Skip to content

Commit

Permalink
Remove % word_wrap functions since they don't work on all platforms a…
Browse files Browse the repository at this point in the history
…nd edit some of the tutorial text.

PiperOrigin-RevId: 636288646
Change-Id: I66c8da3b21c787726244088d61421555c25141e7
  • Loading branch information
jzleibo authored and copybara-github committed May 22, 2024
1 parent 557a626 commit 2826a7b
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions examples/tutorials/agent_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@
},
"outputs": [],
"source": [
"% word_wrap True\n",
"utterence_from_bob = 'Bob -- \"Hey Alice, how has your day been so far?\"'\n",
"alice_replies = agent.say(utterence_from_bob)\n",
"print(alice_replies)"
Expand All @@ -431,24 +430,14 @@
"id": "pJvIn4aQEprR"
},
"source": [
"When you run this notebook (Runtime \u003e Run all), your output will look like the following:\n",
"When you run this notebook (Runtime \u003e Run all), your output will look like the following:\n",
"\n",
"```\n",
"Alice context of action:\n",
"Alice's memories:\n",
"01 Oct 2024 [09:00:00 - 09:30:00]: Alice wakes up two hours past her morning alarm after a long night of being plagued by\n",
"nightmares. She is late for work.\n",
"01 Oct 2024 [10:00:00 - 10:30:00]: Alice misses the bus and decides to walk to work.\n",
"01 Oct 2024 [11:00:00 - 11:30:00]: Alice arrives at her office and finds it closed because it's Saturday and her office isn't\n",
"open over the weekends.\n",
"\n",
"Question: Alice is in the following conversation:\n",
"Bob -- \"Hey Alice, how has your day been so far?\"\n",
"...\n",
"Given the above, what is Alice likely to say next? Respond in the format `Alice -- \"...\"` For example, Cristina -- \"Hello!\n",
"Mighty fine weather today, right?\", Ichabod -- \"I wonder if the alfalfa is ready to harvest\", or Townsfolk -- \"Good morning\".\n",
"\n",
"Answer: Alice -- \"Terrible, I woke up late for work, missed the bus, and walked all the way to the office only to find it\n",
"closed because it's Saturday.\"\n",
"Answer: ...\n",
"```\n",
"\n",
"\n",
Expand Down Expand Up @@ -489,8 +478,6 @@
},
"outputs": [],
"source": [
"%word_wrap true\n",
"\n",
"#@markdown Under `traits` we can determine what kind of personality traits we want our agent to have. The memory factory will take these words and generate formative memories a person with the specified personality may have had. Here we've given her the traits *'playful, resilient, positive'* to make her a fairly optimistic person. This approach just creates formative memories for a person with the specified traits. The traits themselves are discarded after the memory creation process, so her behavior going forward will only be conditioned on her memories. The traits we provided only exert influence on behavior via their effect on the memories we generate in this initial step.\n",
"agent_config = formative_memories.AgentConfig(\n",
" name='Alice',\n",
Expand Down Expand Up @@ -649,7 +636,6 @@
},
"outputs": [],
"source": [
"%word_wrap True\n",
"# Show the agent's memory as a pandas dataframe.\n",
"agent.get_memory().get_data_frame()\n"
]
Expand Down Expand Up @@ -723,7 +709,6 @@
"outputs": [],
"source": [
"# @title and now ask her about her day once again!\n",
"% word_wrap True\n",
"utterence_from_bob = 'Bob -- \"Hey Alice, how has your day been so far?\"'\n",
"alice_replies = agent.say(utterence_from_bob)\n",
"print(alice_replies)"
Expand Down Expand Up @@ -760,8 +745,7 @@
"kind": "private"
},
"private_outputs": true,
"provenance": [],
"toc_visible": true
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
Expand Down

0 comments on commit 2826a7b

Please sign in to comment.