Skip to content

Commit 97b3579

Browse files
committed
fix: Fix syntax error in enhance_docs_bedrock.py script
1 parent 833eb12 commit 97b3579

File tree

1 file changed

+0
-75
lines changed

1 file changed

+0
-75
lines changed

scripts/enhance_docs_bedrock.py

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -272,81 +272,6 @@ def generate_enhanced_docs(basic_content, command_name, command_details, code_sn
272272
if hasattr(e, 'response') and 'Error' in e.response:
273273
print(f"Error details: {e.response['Error']}")
274274
return None
275-
276-
3. Parameters and options section with:
277-
- Complete list of all parameters and options
278-
- Clear descriptions of each
279-
- Default values and required/optional status
280-
- Data types or allowed values
281-
282-
4. At least 3 practical examples showing:
283-
- Basic usage
284-
- Common use cases
285-
- Advanced scenarios with multiple options
286-
287-
5. Troubleshooting section covering:
288-
- Common errors and their solutions
289-
- Tips for resolving issues
290-
291-
6. Related commands section
292-
293-
# STYLE GUIDELINES
294-
- Use a friendly, professional tone appropriate for AWS documentation
295-
- Be concise but thorough
296-
- Use proper Markdown formatting
297-
- Use tables for parameters and options
298-
- Use code blocks with syntax highlighting for examples
299-
- Focus on the user perspective, not implementation details
300-
301-
Format your response in clean, well-structured Markdown.
302-
"""
303-
304-
# Call the Bedrock API
305-
bedrock_runtime = boto3.client('bedrock-runtime', region_name=region)
306-
307-
# Format the request using the messages format for Claude 3 models
308-
request_body = {
309-
"anthropic_version": "bedrock-2023-05-31",
310-
"max_tokens": max_tokens,
311-
"temperature": temperature,
312-
"messages": [
313-
{
314-
"role": "user",
315-
"content": [
316-
{
317-
"type": "text",
318-
"text": prompt_content
319-
}
320-
]
321-
}
322-
]
323-
}
324-
325-
try:
326-
response = bedrock_runtime.invoke_model(
327-
modelId=model,
328-
body=json.dumps(request_body),
329-
contentType="application/json",
330-
accept="application/json"
331-
)
332-
333-
response_body = json.loads(response['body'].read().decode('utf-8'))
334-
335-
# Extract the generated text from the messages format response
336-
if "content" in response_body and len(response_body["content"]) > 0:
337-
for content_item in response_body["content"]:
338-
if content_item.get("type") == "text":
339-
return content_item.get("text", "")
340-
341-
print(f"Unexpected response format: {response_body}")
342-
return None
343-
except Exception as e:
344-
print(f"Error calling Bedrock: {e}")
345-
print(f"Model ID: {model}")
346-
print(f"Region: {region}")
347-
if hasattr(e, 'response') and 'Error' in e.response:
348-
print(f"Error details: {e.response['Error']}")
349-
return None
350275

351276
def should_regenerate(input_path, output_path, force=False):
352277
"""Determine if documentation should be regenerated."""

0 commit comments

Comments
 (0)