Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
t11z authored Jul 11, 2023
1 parent b56b814 commit 1c8b83b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serverless-twitter-bot/tweet_phrase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Azure Function
def main(mytimer: TimerRequest) -> None:
probability = random.random()
if probability < os.getenv('PROBABILITY') or 0.2:
if probability < float(os.getenv('PROBABILITY')) or 0.2:
tweet_gpt_response()

def tweet_gpt_response():
Expand All @@ -21,7 +21,7 @@ def tweet_gpt_response():
{"role": "system", "content": openai_system_prompt },
{"role": "user", "content": openai_user_prompt }
],
temperature = os.getenv('OPENAI_TEMPERATURE') or 1,
temperature = float(os.getenv('OPENAI_TEMPERATURE')) or 1,
)

tweet = response['choices'][0]['message']['content']
Expand Down

0 comments on commit 1c8b83b

Please sign in to comment.