Skip to content

Commit

Permalink
Update example.
Browse files Browse the repository at this point in the history
  • Loading branch information
madiator committed Dec 14, 2024
1 parent 80121c2 commit 574aee5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions examples/simple_poem.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
"""Curator example that uses `SimpleLLM` to generate poems.
Please see the poem.py for more complex use cases.
"""
from bespokelabs import curator

# Use GPT-4o-mini for this example.
llm = curator.SimpleLLM(model_name="gpt-4o-mini")

poem = llm("Write a poem about the bitter lesson in AI and keep it 100 words or less.")
poem = llm("Write a poem about the importance of data in AI.")
print(poem)

# Use Claude 3.5 Sonnet for this example.
llm = curator.SimpleLLM(model_name="claude-3-5-sonnet-20240620", backend="litellm")

poem = llm("Write a sonnet about the bitter lesson in AI and make it visual.")
poem = llm("Write a poem about the importance of data in AI.")
print(poem)

# Note that we can also pass a list of prompts to generate multiple responses.
poems = llm(["Write a sonnet about the importance of data in AI.",
"Write a haiku about the importance of data in AI."])
print(poems)

0 comments on commit 574aee5

Please sign in to comment.