Two young lovers from feuding families secretly marry, but miscommunication
leads to their tragic deaths, ultimately reconciling their warring houses.
Prompt Engineering
16 Sep 2025
Week Four
Two young lovers from feuding families secretly marry, but miscommunication
leads to their tragic deaths, ultimately reconciling their warring houses.
Now client
is an object (you can name it anything) and chat
is a component of that object.
Prince Hamlet seeks revenge against his uncle Claudius for murdering his
father, but his hesitation and madness lead to tragic consequences.
… and it remembers the question from the previous call.
First, say pip install chatlas
in a terminal.
Two young lovers from feuding families secretly marry, but miscommunication
leads to their tragic deaths, ultimately reconciling their warring houses. <chatlas._chat.ChatResponse object at 0x11244e5a0>
Notice that the same exact answer may not be provided. This is a completely different conversation from the one in R.
Yes, as a Posit employee, you can expense a hotel for business travel.
According to **Section 4.1 Travel Expenses**, accommodation expenses are
reimbursable with the following guidelines:
- **Standard**: You should book standard hotel rooms at a reasonable rate
- **Rate limit**: If a nightly rate exceeds $250, you'll need to provide a
justification
- **Business purpose**: The hotel stay must be directly related to company
business (as stated in **Section 3 General Principles**)
**Requirements for reimbursement:**
- Submit the expense within 30 days of incurring it
- Provide a corresponding receipt or proof of purchase
- Submit through the company's designated expense management software
- Get approval from your direct manager
Make sure to attach a clear, legible image of the hotel receipt to your expense
report as outlined in **Section 6.1 Submission**.
Anthropic isn’t too good about itemizing costs, so I’m going to guess that the above, after running many times, cost about 0.25 USD. If you want to know the cost per conversation, you have to keep looking at Anthropic’s up to the minute meter.
~/.Renviron
fileposit-expense-policy.md
to get started) to put in the system prompt.
instead of $
and ChatAnthropic instead of chat_anthropic (or whatever—I’ll show the possible models)I’ve lost interest in the tools we explored last semester but I haven’t deleted the slideware talking about how to use them. Instead, for iteration, I think we can just brainstorm a lot of prompts and use a foreach
to run them through chatlas
in different conversations. Remember that each time we initialized the variable client
, we were starting a new conversation where we could reuse that variable. We could instead give the conversations different names and run them in parallel, skipping back and forth as we get new ideas.
As for annotation, the effectiveness of system prompts makes it seem less pressing. Last semester, I asked students to annotate data for their projects. This semester, I’m not going to ask the same.
I’m thinking we should write and deploy a number of chatbots using Shiny
. That means we have to learn a little bit about Shiny. What do you think?
The remaining slides are a holdover from iteration and annotation from last semester.
example_tweets_test
without success, so I switched to example_tweets_test_tiny
potato/project-hub/politeness_rating/annotation_output/full/<your account name>/
Ctrl-C
and use that window to navigate to the folderannotation_order.txt
is a list of the instances you annotated in orderassigned_user_data.json
is a list of the instances you annotated, with the annotations you madeannotated_instances.jsonl
is a list of the instances you annotated, with the annotations you made, in JSON Lines formatvi
to change the word scale_1
to scale
vi
command :%s/scale_[1-5]/scale/
extractIDandScale.py
script to extract the ID and scale from the JSON Lines filevi
to get rid of lines that start with Politenessvi
command :g/^Politeness/d
calcAvg.py
script to calculate the average rating 5 | 000000
4 | 00000000000
3 | 00000000000000000
2 | 00000000000
1 | 00000
See if you can make a stem-and-leaf plot for your data with an LLM
END
This slideshow was produced using quarto
Fonts are Roboto Light, Roboto Bold, and JetBrains Mono Nerd Font