Skip to content

Commit

Permalink
Create autotemp_example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
elder-plinius authored Nov 23, 2023
1 parent 00325e5 commit d61ba72
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions playground/demos/autotemp/autotemp_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from swarms.models import OpenAIChat
from swarms.models.autotemp import AutoTemp

# Your OpenAI API key
api_key = ""

autotemp_agent = AutoTemp(
api_key=api_key,
alt_temps=[0.4, 0.6, 0.8, 1.0, 1.2],
auto_select=False,
# model_version="gpt-3.5-turbo" # Specify the model version if needed
)

# Define the task and temperature string
task = "Generate a short story about a lost civilization."
temperature_string = "0.4,0.6,0.8,1.0,1.2,"

# Run the AutoTempAgent
result = autotemp_agent.run(task, temperature_string)

# Print the result
print(result)

0 comments on commit d61ba72

Please sign in to comment.