TANVEERMAKHDOOM commited on
Commit
4934b4e
1 Parent(s): 458fbe4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -8,7 +8,7 @@ load_dotenv()
8
 
9
  # Get the API key from environment variables
10
  def get_client():
11
- api_key = os.getenv("ANTHROPIC_API_KEY")
12
  if not api_key:
13
  raise ValueError("API key not found. Please set the ANTHROPIC_API_KEY environment variable.")
14
  return anthropic.Anthropic(api_key=api_key)
@@ -17,7 +17,7 @@ def generate_game_environment(description_prompt):
17
  client = get_client()
18
  response = client.messages.create(
19
  model="claude-3-5-sonnet-20240620",
20
- max_tokens=500,
21
  temperature=0.7,
22
  system="You are a creative writer specialized in generating immersive game environments.",
23
  messages=[
@@ -38,7 +38,7 @@ def generate_protagonist(description_prompt):
38
  client = get_client()
39
  response = client.messages.create(
40
  model="claude-3-5-sonnet-20240620",
41
- max_tokens=500,
42
  temperature=0.7,
43
  system="You are a character designer specializing in creating detailed protagonists for games.",
44
  messages=[
@@ -59,7 +59,7 @@ def generate_antagonist(description_prompt):
59
  client = get_client()
60
  response = client.messages.create(
61
  model="claude-3-5-sonnet-20240620",
62
- max_tokens=500,
63
  temperature=0.7,
64
  system="You are a character designer specializing in creating compelling antagonists for games.",
65
  messages=[
@@ -87,7 +87,7 @@ def generate_game_story(environment, protagonist, antagonist):
87
  client = get_client()
88
  response = client.messages.create(
89
  model="claude-3-5-sonnet-20240620",
90
- max_tokens=1000,
91
  temperature=0.7,
92
  system="You are a master storyteller. Generate an engaging game story from the given details.",
93
  messages=[
 
8
 
9
  # Get the API key from environment variables
10
  def get_client():
11
+ api_key = os.getenv("claude_api_key")
12
  if not api_key:
13
  raise ValueError("API key not found. Please set the ANTHROPIC_API_KEY environment variable.")
14
  return anthropic.Anthropic(api_key=api_key)
 
17
  client = get_client()
18
  response = client.messages.create(
19
  model="claude-3-5-sonnet-20240620",
20
+ max_tokens=200,
21
  temperature=0.7,
22
  system="You are a creative writer specialized in generating immersive game environments.",
23
  messages=[
 
38
  client = get_client()
39
  response = client.messages.create(
40
  model="claude-3-5-sonnet-20240620",
41
+ max_tokens=200,
42
  temperature=0.7,
43
  system="You are a character designer specializing in creating detailed protagonists for games.",
44
  messages=[
 
59
  client = get_client()
60
  response = client.messages.create(
61
  model="claude-3-5-sonnet-20240620",
62
+ max_tokens=200,
63
  temperature=0.7,
64
  system="You are a character designer specializing in creating compelling antagonists for games.",
65
  messages=[
 
87
  client = get_client()
88
  response = client.messages.create(
89
  model="claude-3-5-sonnet-20240620",
90
+ max_tokens=200,
91
  temperature=0.7,
92
  system="You are a master storyteller. Generate an engaging game story from the given details.",
93
  messages=[