A guidance language for controlling large language models with interleaved generation, prompting, and logical control in a single continuous flow.
A guidance language for controlling large language models with interleaved generation, prompting, and logical control in a single continuous flow.
Guidance enables you to control modern language models more effectively and efficiently than traditional prompting or chaining. Guidance programs allow you to interleave generation, prompting, and logical control into a single continuous flow matching how the language model actually processes the text.
When the user requests to use or learn about the guidance package:
1. **Install the Package**
- Install using pip: `pip install guidance==0.3.0`
- Or use the user's preferred package manager (uv, poetry, pipenv, conda)
2. **Explain Key Capabilities**
- Guidance allows interleaving generation, prompting, and logical control
- Provides more effective and efficient control than traditional prompting or chaining
- Enables a continuous flow that matches how language models process text
3. **Provide Usage Examples**
- Show how to import and initialize guidance
- Demonstrate basic guidance program structure
- Illustrate how to combine prompts with generation and control flow
- Show how guidance differs from traditional prompting approaches
4. **Best Practices**
- Explain when to use guidance over traditional prompting
- Show how to structure guidance programs for optimal performance
- Demonstrate how to leverage the continuous flow approach
- Provide tips for debugging and optimizing guidance programs
5. **Integration Patterns**
- Show how to integrate guidance with existing LLM workflows
- Demonstrate how to use guidance with different language model providers
- Explain how to combine guidance with other AI tools and frameworks
```python
pip install guidance==0.3.0
import guidance
program = guidance("""
The best thing about the beach is {{~gen 'best' temperature=0.7 max_tokens=50}}
""")
result = program()
print(result)
```
```python
import guidance
program = guidance("""
Question: {{question}}
Let's think step by step:
{{~gen 'reasoning' temperature=0.7 max_tokens=200}}
Based on this reasoning, the answer is: {{~gen 'answer' temperature=0.3 max_tokens=50}}
""")
result = program(question="What are the benefits of using guidance over traditional prompting?")
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/pypi-package-guidance/raw