Skip to content

Typo: Remove Unnecessary f Format String Literal #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryanoneill
Copy link

This commit removes an unnecessary Python f format string literal in the "02 Messages Format" lesson of the "API Fundamentals" course. It is used twice for the prompt which asks Claude to "Generate a beautiful haiku", however no Python variables are present within the prompt, and so the f is not needed.

This commit removes an unnecessary Python `f` format string literal in
the "02 Messages Format" lesson of the "API Fundamentals" course. It is
used twice for the prompt which asks Claude to "Generate a beautiful
haiku", however no Python variables are present within the prompt, and
so the `f` is not needed.
@ryanoneill
Copy link
Author

Testing done:

❯ uv run ipython
Python 3.12.8 (main, Jan 14 2025, 22:49:14) [Clang 19.1.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.0.2 -- An enhanced Interactive Python. Type '?' for help.
Tip: You can use `files = !ls *.png`

In [1]: from dotenv import load_dotenv

In [2]: load_dotenv()
Out[2]: True

In [3]: from anthropic import Client

In [4]: client = Client()

In [5]: response = client.messages.create(
   ...:     model="claude-3-haiku-20240307",
   ...:     max_tokens=500,
   ...:     messages=[
   ...:         {"role": "user", "content": "Ge
      ⋮ nerate a beautiful haiku"},
   ...:         {"role": "assistant", "content"
      ⋮ : "calming mountain air"}
   ...:     ]
   ...: )
   ...: print(response.content[0].text)
,
gentle breeze, blooming flowers sway,
peaceful solitude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant