Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
knowsuchagency committed Nov 25, 2024
1 parent 5a48301 commit 9043b13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ from promptic import llm

@llm
def translate(text, target_language="Chinese"):
"""Translate this text: {text}
Target language: {target_language}"""
"""Translate this text: {text} to {target_language}"""

print(translate("Hello world!"))
# 您好,世界!
Expand Down Expand Up @@ -343,15 +342,13 @@ def count_words(text: str) -> int:
"""Count words in the provided text"""
return len(text.split())

# First interaction
story1 = story_assistant("Write a short story about a magical library")
print(f"Title: {story1.title}")
print(f"Style: {story1.style}")
print(f"Words: {story1.word_count}")
print(story1.content)
story = story_assistant("Write a short story about a magical library")
print(f"Title: {story.title}")
print(f"Style: {story.style}")
print(f"Words: {story.word_count}")
print(story.content)

# Second interaction (with memory context)
story2 = story_assistant("Write another story with the same style but about a time traveler")
print(story_assistant("Write another story with the same style but about a time traveler"))
```

## Limitations
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"litellm~=1.38",
"pydantic~=2.7",
]
version = "2.1.1"
version = "2.1.2"
readme = "README.md"
requires-python = ">=3.11"

Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9043b13

Please sign in to comment.