You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
423 B
22 lines
423 B
1 year ago
|
from swarms.models import OpenAIChat
|
||
|
from swarms.structs import Flow
|
||
|
|
||
|
api_key = ""
|
||
|
|
||
|
|
||
|
# Initialize the language model,
|
||
|
# This model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
|
||
|
llm = OpenAIChat(
|
||
|
openai_api_key=api_key,
|
||
|
temperature=0.5,
|
||
|
)
|
||
|
|
||
|
# Initialize the flow
|
||
|
flow = Flow(
|
||
|
llm=llm,
|
||
|
max_loops=5,
|
||
|
)
|
||
|
|
||
|
out = flow.run("Generate a 10,000 word blog, say Stop when done")
|
||
|
print(out)
|