From b51d005f911cf38269f623186220235d7f32dd83 Mon Sep 17 00:00:00 2001 From: Mandana Vaziri Date: Mon, 18 Nov 2024 14:49:36 -0500 Subject: [PATCH] update to README Signed-off-by: Mandana Vaziri --- README.md | 35 ++++++++--------------------------- docs/README.md | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 81a396ca9..7248cf525 100644 --- a/README.md +++ b/README.md @@ -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 @@ -159,40 +161,19 @@ text: ## Debugging Tools -### Trace Generation -```bash -pdl --trace -``` - ### Log Inspection ```bash pdl --log ``` -### 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 +``` -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 diff --git a/docs/README.md b/docs/README.md index e7c31c536..0aba1df8c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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