Skip to content

Commit

Permalink
πŸš€ Add story generator stream
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Nov 20, 2023
1 parent 14bc9c6 commit 613314d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/stream.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from funcchain import chain, settings
from funcchain.streaming import stream_to

settings.MODEL_TEMPERATURE = 1
settings.MODEL_NAME = "gpt-3.5-turbo-1106"


def generate_story_of(topic: str) -> str:
"""
Write a short story based on the topic.
"""
return chain()

with stream_to(print):
generate_story_of("a space cat")

0 comments on commit 613314d

Please sign in to comment.