jinja2 support
This commit is contained in:
44
prompts/api_documentation.md
Normal file
44
prompts/api_documentation.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# API Documentation: {{ api_name }}
|
||||
|
||||
Base URL: `{{ base_url }}`
|
||||
Version: {{ version }}
|
||||
|
||||
## Authentication
|
||||
{{ auth_method }}
|
||||
|
||||
## Endpoints
|
||||
|
||||
{% for endpoint in endpoints %}
|
||||
### {{ endpoint.method }} {{ endpoint.path }}
|
||||
|
||||
**Description:** {{ endpoint.description }}
|
||||
|
||||
{% if endpoint.params %}
|
||||
**Parameters:**
|
||||
{% for param in endpoint.params %}
|
||||
- `{{ param.name }}` ({{ param.type }}): {{ param.description }}{% if param.required %} *[Required]*{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if endpoint.request_body %}
|
||||
**Request Body:**
|
||||
```json
|
||||
{{ endpoint.request_body | tojson(indent=2) }}
|
||||
```
|
||||
{% endif %}
|
||||
|
||||
**Response:** `{{ endpoint.response_code }}`
|
||||
```json
|
||||
{{ endpoint.response_example | tojson(indent=2) }}
|
||||
```
|
||||
|
||||
---
|
||||
{% endfor %}
|
||||
|
||||
## Rate Limiting
|
||||
{{ rate_limit }} requests per {{ rate_limit_window }}
|
||||
|
||||
## Error Codes
|
||||
{% for error in error_codes %}
|
||||
- `{{ error.code }}`: {{ error.message }}
|
||||
{% endfor %}
|
||||
32
prompts/code_generator.md
Normal file
32
prompts/code_generator.md
Normal file
@@ -0,0 +1,32 @@
|
||||
Generate a Python class with the following specifications:
|
||||
|
||||
Class Name: {{ class_name }}
|
||||
{% if parent_class %}
|
||||
Inherits from: {{ parent_class }}
|
||||
{% endif %}
|
||||
|
||||
## Attributes:
|
||||
{% for attr in attributes %}
|
||||
- {{ attr.name }}: {{ attr.type }}{% if attr.default %} = {{ attr.default }}{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
## Methods:
|
||||
{% for method in methods %}
|
||||
### {{ method.name }}({{ method.params | join(', ') }})
|
||||
{{ method.description }}
|
||||
Returns: {{ method.returns }}
|
||||
{% endfor %}
|
||||
|
||||
## Example Usage:
|
||||
```python
|
||||
{% for example in examples %}
|
||||
{{ example }}
|
||||
{% endfor %}
|
||||
```
|
||||
|
||||
{% if additional_notes %}
|
||||
## Notes:
|
||||
{% for note in additional_notes %}
|
||||
- {{ note }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user