Spaces:
Build error
Build error
Update selfapi_writer.py
Browse files- selfapi_writer.py +5 -3
selfapi_writer.py
CHANGED
|
@@ -17,6 +17,7 @@ class SelfApiWriter:
|
|
| 17 |
if not ANTHROPIC_API_KEY:
|
| 18 |
raise ValueError("Anthropic API key not found in HuggingFace secrets. Please ensure ANTHROPIC_API_KEY is set in your space's secrets.")
|
| 19 |
self.client = Anthropic(api_key=ANTHROPIC_API_KEY)
|
|
|
|
| 20 |
self.context = {}
|
| 21 |
self.book_structure = None
|
| 22 |
self.writing_guidelines = None
|
|
@@ -69,7 +70,8 @@ class SelfApiWriter:
|
|
| 69 |
Return only the JSON structure without any additional text."""
|
| 70 |
|
| 71 |
response = self.client.messages.create(
|
| 72 |
-
model="claude-3-sonnet-20240229",
|
|
|
|
| 73 |
max_tokens=2000,
|
| 74 |
temperature=0,
|
| 75 |
system=system_prompt,
|
|
@@ -117,7 +119,7 @@ class SelfApiWriter:
|
|
| 117 |
Follow ALL provided guidelines for style, tone, and content."""
|
| 118 |
|
| 119 |
response = self.client.messages.create(
|
| 120 |
-
model=
|
| 121 |
max_tokens=4000,
|
| 122 |
temperature=0.7,
|
| 123 |
system=system_prompt,
|
|
@@ -171,7 +173,7 @@ class SelfApiWriter:
|
|
| 171 |
Begin writing the complete chapter now."""
|
| 172 |
|
| 173 |
response = self.client.messages.create(
|
| 174 |
-
model=
|
| 175 |
max_tokens=4000,
|
| 176 |
temperature=0.7,
|
| 177 |
system=system_prompt,
|
|
|
|
| 17 |
if not ANTHROPIC_API_KEY:
|
| 18 |
raise ValueError("Anthropic API key not found in HuggingFace secrets. Please ensure ANTHROPIC_API_KEY is set in your space's secrets.")
|
| 19 |
self.client = Anthropic(api_key=ANTHROPIC_API_KEY)
|
| 20 |
+
self.model = "claude-3-opus-20240229"
|
| 21 |
self.context = {}
|
| 22 |
self.book_structure = None
|
| 23 |
self.writing_guidelines = None
|
|
|
|
| 70 |
Return only the JSON structure without any additional text."""
|
| 71 |
|
| 72 |
response = self.client.messages.create(
|
| 73 |
+
#model="claude-3-sonnet-20240229",
|
| 74 |
+
model=self.model,
|
| 75 |
max_tokens=2000,
|
| 76 |
temperature=0,
|
| 77 |
system=system_prompt,
|
|
|
|
| 119 |
Follow ALL provided guidelines for style, tone, and content."""
|
| 120 |
|
| 121 |
response = self.client.messages.create(
|
| 122 |
+
model=self.model,
|
| 123 |
max_tokens=4000,
|
| 124 |
temperature=0.7,
|
| 125 |
system=system_prompt,
|
|
|
|
| 173 |
Begin writing the complete chapter now."""
|
| 174 |
|
| 175 |
response = self.client.messages.create(
|
| 176 |
+
model=self.model,
|
| 177 |
max_tokens=4000,
|
| 178 |
temperature=0.7,
|
| 179 |
system=system_prompt,
|