style: format all files with prettier

This commit is contained in:
Seth Hobson
2026-01-19 17:07:03 -05:00
parent 8d37048deb
commit 56848874a2
355 changed files with 15215 additions and 10241 deletions

View File

@@ -7,6 +7,7 @@ Chain-of-Thought (CoT) prompting elicits step-by-step reasoning from LLMs, drama
## Core Techniques
### Zero-Shot CoT
Add a simple trigger phrase to elicit reasoning:
```python
@@ -29,6 +30,7 @@ prompt = zero_shot_cot(query)
```
### Few-Shot CoT
Provide examples with explicit reasoning chains:
```python
@@ -53,6 +55,7 @@ A: Let's think step by step:"""
```
### Self-Consistency
Generate multiple reasoning paths and take the majority vote:
```python
@@ -85,6 +88,7 @@ def self_consistency_cot(query, n=5, temperature=0.7):
## Advanced Patterns
### Least-to-Most Prompting
Break complex problems into simpler subproblems:
```python
@@ -125,6 +129,7 @@ Final Answer:"""
```
### Tree-of-Thought (ToT)
Explore multiple reasoning branches:
```python
@@ -176,6 +181,7 @@ Score:"""
```
### Verification Step
Add explicit verification to catch errors:
```python
@@ -220,6 +226,7 @@ Corrected solution:"""
## Domain-Specific CoT
### Math Problems
```python
math_cot_template = """
Problem: {problem}
@@ -248,6 +255,7 @@ Answer: {final_answer}
```
### Code Debugging
```python
debug_cot_template = """
Code with error:
@@ -278,6 +286,7 @@ Fixed code:
```
### Logical Reasoning
```python
logic_cot_template = """
Premises:
@@ -305,6 +314,7 @@ Answer: {final_answer}
## Performance Optimization
### Caching Reasoning Patterns
```python
class ReasoningCache:
def __init__(self):
@@ -328,6 +338,7 @@ class ReasoningCache:
```
### Adaptive Reasoning Depth
```python
def adaptive_cot(problem, initial_depth=3):
depth = initial_depth
@@ -378,6 +389,7 @@ def evaluate_cot_quality(reasoning_chain):
## When to Use CoT
**Use CoT for:**
- Math and arithmetic problems
- Logical reasoning tasks
- Multi-step planning
@@ -385,6 +397,7 @@ def evaluate_cot_quality(reasoning_chain):
- Complex decision making
**Skip CoT for:**
- Simple factual queries
- Direct lookups
- Creative writing