Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Minimum installation.
```bash
pip install prompt-declaration-language
```
See [here](https://ibm.github.io/prompt-declaration-language/tutorial/#using-ollama-models) for
instructions on how to install an Ollama model locally.

you can create a PDL file (YAML format):
You can create a PDL file (YAML format):

```yaml
description: Simple LLM interaction
Expand Down Expand Up @@ -159,40 +161,19 @@ text:

## Debugging Tools

### Trace Generation
```bash
pdl --trace <file.json> <my-example.pdl>
```

### Log Inspection
```bash
pdl --log <my-logfile> <my-example.pdl>
```

### Live Document Visualization
Upload trace files to the [Live Document Viewer](https://ibm.github.io/prompt-declaration-language/viewer/) for visual debugging.

## Best Practices
### Trace Generation and Live Document Visualization

1. **Template Organization**:
- Keep templates modular and reusable
- Use variables for dynamic content
- Document template purpose and requirements

2. **Error Handling**:
- Validate model inputs/outputs
- Include fallback logic
- Log intermediate results
```bash
pdl --trace <file.json> <my-example.pdl>
```

3. **Performance**:
- Cache frequent LLM calls
- Use appropriate temperature settings
- Implement retry logic for API calls
Upload trace files to the [Live Document Viewer](https://ibm.github.io/prompt-declaration-language/viewer/) for visual debugging.

4. **Security**:
- Enabling sandbox mode for untrusted code
- Validate all inputs
- Follow API key best practices

## Contributing

Expand Down
22 changes: 22 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,28 @@ in the right pane.

This is similar to a spreadsheet for tabular data, where data is in the forefront and the user can inspect the formula that generates the data in each cell. In the Live Document, cells are not uniform but can take arbitrary extents. Clicking on them similarly reveals the part of the code that produced them.

## Best Practices

1. **Template Organization**:
- Keep templates modular and reusable
- Use variables for dynamic content
- Document template purpose and requirements

2. **Error Handling**:
- Validate model inputs/outputs
- Include fallback logic
- Log intermediate results

3. **Performance**:
- Cache frequent LLM calls
- Use appropriate temperature settings
- Implement retry logic for API calls

4. **Security**:
- Enabling sandbox mode for untrusted code
- Validate all inputs
- Follow API key best practices


## Additional Notes

Expand Down